Skip to content

Commit ffa6d2b

Browse files
committed
Distinguish between buttons with focus overlay
1 parent 94e2411 commit ffa6d2b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/lib/button/_button-theme.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
background: transparent;
8686

8787
@include _mat-button-theme-color($theme, 'color');
88-
@include _mat-button-ripple-color($theme, default, 0.1);
8988
}
9089

9190
.mat-raised-button, .mat-fab, .mat-mini-fab {
@@ -95,8 +94,21 @@
9594

9695
@include _mat-button-theme-color($theme, 'color', default-contrast);
9796
@include _mat-button-theme-color($theme, 'background-color');
97+
98+
// Add ripple effect with contrast color to buttons that don't have a focus overlay.
9899
@include _mat-button-ripple-color($theme, default-contrast);
99100
}
101+
102+
// Add ripple effect with default color to the flat button, which doesn't have a focus overlay.
103+
.mat-button {
104+
@include _mat-button-ripple-color($theme, default, 0.1);
105+
}
106+
107+
// Add ripple effect with default color to the icon button. Ripple color needs to be stronger
108+
// since the icon button doesn't have a focus overlay.
109+
.mat-icon-button {
110+
@include _mat-button-ripple-color($theme, default);
111+
}
100112

101113
// TODO(devversion): The color class accent should be just set from TS code. No need for this.
102114
.mat-fab, .mat-mini-fab {

0 commit comments

Comments
 (0)