Skip to content

fix(material/tabs): incorrect ripple color when CSS variables are used for theme #23686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/material/tabs/_tabs-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,19 @@

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

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

Expand Down