From 026e965e8a787fdccba57e4587602e6d5d501ee5 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 15 Dec 2022 10:28:57 +0100 Subject: [PATCH] fix(material/snack-bar): set explicit color on action in dark themes 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. --- src/material/snack-bar/_snack-bar-theme.scss | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/material/snack-bar/_snack-bar-theme.scss b/src/material/snack-bar/_snack-bar-theme.scss index d54e31a122f6..4bcf36f1d638 100644 --- a/src/material/snack-bar/_snack-bar-theme.scss +++ b/src/material/snack-bar/_snack-bar-theme.scss @@ -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);