Skip to content

Commit 2c57c58

Browse files
authored
fix(material-experimental/mdc-snack-bar): increase the specificity of styles targeting the action buttons (#22959)
* fix(material-experimental/mdc-snack-bar): increase the specificity of styles targeting the action buttons. Currently the order of the button theme vs the snackbar theme matters, this will make the snackbar theme always take precedence * fix(material-experimental/mdc-snack-bar): increase the specificity of styles targeting the action buttons.
1 parent 2cd745a commit 2c57c58

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
mdc-snackbar.$label-ink-color: $orig-label-ink-color;
3636
mdc-snackbar.$dismiss-ink-color: $orig-dismiss-ink-color;
3737

38-
// The extra level of nesting here is to increase the specificity.
39-
.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-actions .mdc-snackbar__action {
38+
// Four classes is necessary to make it higher specificity than the mdc-button theme styles.
39+
// This ensures the correct styles will be applied regardless of the order te mixins are
40+
// @included.
41+
.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-actions .mdc-snackbar__action.mdc-snackbar__action {
4042
$is-dark-theme: map.get($config, is-dark);
4143
$accent: map.get($config, accent);
4244
color: if($is-dark-theme, inherit, theming.get-color-from-palette($accent, text));

0 commit comments

Comments
 (0)