Skip to content

Commit dde0310

Browse files
committed
fix(chips): handle ripple color in theme using CSS variables
The ripple color for selected chips is set through `rgba` which won't work properly if the theme uses CSS variables. These changes add a fallback.
1 parent d3d8859 commit dde0310

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/material/chips/_chips-theme.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ $mat-chip-remove-font-size: 18px;
1919
@include mat-chips-color(mat-color($palette, default-contrast), mat-color($palette));
2020

2121
.mat-ripple-element {
22-
background: mat-color($palette, default-contrast, 0.1);
22+
$ripple-opacity: 0.1;
23+
$ripple-color: mat-color($palette, default-contrast, $ripple-opacity);
24+
background-color: $ripple-color;
25+
26+
// If the ripple color is a CSS variable, `mat-color` will
27+
// return a solid color so we have to apply the opacity separately.
28+
@if (type-of($ripple-color) != color) {
29+
opacity: $ripple-opacity;
30+
}
2331
}
2432
}
2533

0 commit comments

Comments
 (0)