Skip to content

Commit 16593f1

Browse files
knoakemmalerba
authored andcommittedFeb 14, 2025·
fix(material/snack-bar): snack-bar action button does not follow material guidelines (#27769)
Fixes a bug in the Angular Material snack-bar, where accent color is used for action button color in light themes and grey is used in dark themes. This does not follow the material design guidelines which recommend a tone of primary color is used in both light and dark themes, and that the color should contrast with the background. Fixes #13905 (cherry picked from commit 3d7f271)
1 parent 96d7d87 commit 16593f1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/material/core/tokens/m2/mat/_snack-bar.scss

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ $prefix: (mat, snack-bar);
1616
$is-dark: inspection.get-theme-type($theme) == dark;
1717

1818
@return (
19-
button-color: if(
20-
$is-dark, rgba(0, 0, 0, 0.87), inspection.get-theme-color($theme, accent, text))
19+
button-color:
20+
if(
21+
$is-dark,
22+
inspection.get-theme-color($theme, primary, 500),
23+
inspection.get-theme-color($theme, primary, 100)
24+
)
2125
);
2226
}
2327

0 commit comments

Comments
 (0)
Please sign in to comment.