Skip to content

Commit d30f1ce

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 d30f1ce

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/material/chips/_chips-theme.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ $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-color: mat-color($palette, default-contrast);
23+
background-color: $ripple-color;
24+
25+
// If the ripple color is a CSS variable, `mat-color` will
26+
// return a solid color so we have to apply the opacity separately.
27+
@if (type-of($ripple-color) != color) {
28+
opacity: 0.1;
29+
}
2330
}
2431
}
2532

0 commit comments

Comments
 (0)