Skip to content

fix(material-experimental/mdc-snack-bar): increase the specificity of styles targeting the action buttons #22959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/material-experimental/mdc-snack-bar/_snack-bar-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@
mdc-snackbar.$label-ink-color: $orig-label-ink-color;
mdc-snackbar.$dismiss-ink-color: $orig-dismiss-ink-color;

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