Skip to content

Commit

Permalink
fix(material/snack-bar): set explicit color on action in dark themes (a…
Browse files Browse the repository at this point in the history
…ngular#26268)

We were setting the snack bar action color to `currentColor` on dark themes which might not work as expected if there is a `color` on the `body`. These changes set it to an explicit color.

Fixes angular#26247.
  • Loading branch information
crisbeto committed Dec 16, 2022
1 parent 79bd976 commit a6c3f79
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/material/snack-bar/_snack-bar-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@

@include mdc-helpers.using-mdc-theme($config) {
.mat-mdc-snack-bar-container {
$button-color:
if($is-dark-theme, currentColor, theming.get-color-from-palette($accent, text));
$button-color: if(
$is-dark-theme,
mdc-theme-color.prop-value(text-primary-on-light),
theming.get-color-from-palette($accent, text)
);
--mat-mdc-snack-bar-button-color: #{$button-color};
$on-surface: mdc-theme-color.prop-value(on-surface);
$surface: mdc-theme-color.prop-value(surface);
Expand Down

0 comments on commit a6c3f79

Please sign in to comment.