Skip to content

Commit a6c3f79

Browse files
authored
fix(material/snack-bar): set explicit color on action in dark themes (#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 #26247.
1 parent 79bd976 commit a6c3f79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/material/snack-bar/_snack-bar-theme.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616

1717
@include mdc-helpers.using-mdc-theme($config) {
1818
.mat-mdc-snack-bar-container {
19-
$button-color:
20-
if($is-dark-theme, currentColor, theming.get-color-from-palette($accent, text));
19+
$button-color: if(
20+
$is-dark-theme,
21+
mdc-theme-color.prop-value(text-primary-on-light),
22+
theming.get-color-from-palette($accent, text)
23+
);
2124
--mat-mdc-snack-bar-button-color: #{$button-color};
2225
$on-surface: mdc-theme-color.prop-value(on-surface);
2326
$surface: mdc-theme-color.prop-value(surface);

0 commit comments

Comments
 (0)