Skip to content

Commit 257c183

Browse files
committed
Revert "feat(button): align with 2018 material design spec (angular#12537)"
This reverts commit 4ddbde9.
1 parent 7c4fa66 commit 257c183

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

src/lib/button/_button-base.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66

77
// Flat and raised button standards
88
$mat-button-padding: 0 16px !default;
9-
$mat-button-min-width: 64px !default;
9+
$mat-button-min-width: 88px !default;
1010
$mat-button-margin: 0 !default;
1111
$mat-button-line-height: 36px !default;
12-
$mat-button-border-radius: 4px !default;
12+
$mat-button-border-radius: 2px !default;
1313
$mat-button-focus-transition: opacity 200ms $swift-ease-in-out-timing-function,
1414
background-color 200ms $swift-ease-in-out-timing-function !default;
1515

16+
// Stroked Button standards
17+
$mat-stroked-button-line-height: $mat-button-line-height - 2;
1618
// Stroked button padding is 1px less horizontally than default/flat/raised
1719
// button's padding.
18-
$mat-stroked-button-line-height: $mat-button-line-height - 2;
1920
$mat-stroked-button-padding: 0 15px;
2021

2122
// Icon Button standards
@@ -63,7 +64,7 @@ $mat-mini-fab-padding: 8px !default;
6364

6465
&.cdk-keyboard-focused, &.cdk-program-focused {
6566
.mat-button-focus-overlay {
66-
opacity: 0.12;
67+
opacity: 1;
6768
}
6869
}
6970

src/lib/button/_button-theme.scss

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
$warn: map-get($theme, warn);
99

1010
&.mat-primary .mat-button-focus-overlay {
11-
background-color: mat-color($primary);
11+
background-color: mat-color($primary, 0.12);
1212
}
1313

1414
&.mat-accent .mat-button-focus-overlay {
15-
background-color: mat-color($accent);
15+
background-color: mat-color($accent, 0.12);
1616
}
1717

1818
&.mat-warn .mat-button-focus-overlay {
19-
background-color: mat-color($warn);
19+
background-color: mat-color($warn, 0.12);
2020
}
2121

2222
&[disabled] .mat-button-focus-overlay {
@@ -91,16 +91,6 @@
9191
@include _mat-button-ripple-color($theme, default);
9292
}
9393

94-
.mat-button-focus-overlay {
95-
background: map_get($foreground, base);
96-
}
97-
98-
// Note: this needs a bit extra specificity, because we're not guaranteed the inclusion
99-
// order of the theme styles and the button reset may end up resetting this as well.
100-
.mat-stroked-button:not(.mat-button-disabled) {
101-
border-color: mat-color($foreground, divider);
102-
}
103-
10494
.mat-flat-button, .mat-raised-button, .mat-fab, .mat-mini-fab {
10595
// Default font and background color when not using any color palette.
10696
color: mat-color($foreground, text);

src/lib/button/button.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// Use the same visual treatment for hover as for focus.
2020
.mat-button:hover .mat-button-focus-overlay,
2121
.mat-stroked-button:hover .mat-button-focus-overlay {
22-
opacity: 0.04;
22+
opacity: 1;
2323
}
2424

2525
// Disable the hover styles on non-hover devices. Since this is more of a progressive
@@ -38,7 +38,8 @@
3838

3939
.mat-stroked-button {
4040
@include mat-overridable-elevation(0);
41-
border: solid 1px currentColor;
41+
42+
border: 1px solid currentColor;
4243
padding: $mat-stroked-button-padding;
4344
line-height: $mat-stroked-button-line-height;
4445
}
@@ -65,6 +66,7 @@
6566
height: $mat-icon-button-size;
6667

6768
flex-shrink: 0;
69+
6870
line-height: $mat-icon-button-size;
6971
border-radius: $mat-icon-button-border-radius;
7072

@@ -91,6 +93,9 @@
9193

9294
// Element that overlays the button to show focus and hover effects.
9395
.mat-button-focus-overlay {
96+
// The button spec calls for focus on raised buttons (and FABs) to be indicated with a
97+
// black, 12% opacity shade over the normal color (for both light and dark themes).
98+
background-color: rgba(black, 0.12);
9499
border-radius: inherit;
95100
opacity: 0;
96101

0 commit comments

Comments
 (0)