Skip to content

Commit 9109c3c

Browse files
authored
fix(material/tabs): incorrect ripple color when CSS variables are used for theme (#23686)
Fixes that a tab group with a background color has a solid ripple color when the theme is based on CSS variables. Fixes #23681.
1 parent 032cb06 commit 9109c3c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/material/tabs/_tabs-theme.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,19 @@
126126

127127
> .mat-tab-header .mat-tab-header-pagination-disabled .mat-tab-header-pagination-chevron,
128128
> .mat-tab-header-pagination-disabled .mat-tab-header-pagination-chevron {
129-
border-color: theming.get-color-from-palette($background-color, default-contrast, 0.4);
129+
// Set the color opacity via `opacity`, rather than `rgba`, because it may be a CSS variable.
130+
border-color: theming.get-color-from-palette($background-color, default-contrast, 1);
131+
opacity: 0.4;
130132
}
131133

132134
// Set ripples color to be the contrast color of the new background. Otherwise the ripple
133135
// color will be based on the app background color.
134136
> .mat-tab-header .mat-ripple-element,
135137
> .mat-tab-link-container .mat-ripple-element,
136138
> .mat-tab-header-pagination .mat-ripple-element {
137-
background-color: theming.get-color-from-palette($background-color, default-contrast, 0.12);
139+
// Set the color opacity via `opacity`, rather than `rgba`, because it may be a CSS variable.
140+
background-color: theming.get-color-from-palette($background-color, default-contrast, 1);
141+
opacity: 0.12;
138142
}
139143
}
140144

0 commit comments

Comments
 (0)