Skip to content
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

fix(material/snack-bar): Move unthemable tokens to theme mixin #27596

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/material/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
@forward './slider/slider-theme' as slider-* show slider-theme, slider-color, slider-typography,
slider-density, slider-base;
@forward './snack-bar/snack-bar-theme' as snack-bar-* show snack-bar-theme, snack-bar-color,
snack-bar-typography, snack-bar-density;
snack-bar-typography, snack-bar-density, snack-bar-base;
@forward './sort/sort-theme' as sort-* show sort-theme, sort-color, sort-typography, sort-density;
@forward './stepper/stepper-theme' as stepper-* show stepper-theme, stepper-color,
stepper-typography, stepper-density;
Expand Down
8 changes: 8 additions & 0 deletions src/material/snack-bar/_snack-bar-theme.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
@use '@material/snackbar/snackbar-theme' as mdc-snackbar-theme;
@use '../core/theming/theming';
@use '../core/style/sass-utils';
@use '../core/typography/typography';
@use '../core/tokens/token-utils';
@use '../core/tokens/m2/mdc/snack-bar' as tokens-mdc-snack-bar;
@use '../core/tokens/m2/mat/snack-bar' as tokens-mat-snack-bar;

@mixin base($config-or-theme) {
// Add default values for tokens not related to color, typography, or density.
@include sass-utils.current-selector-or-root() {
@include mdc-snackbar-theme.theme(tokens-mdc-snack-bar.get-unthemable-tokens());
}
}

@mixin color($config-or-theme) {
$config: theming.get-color-config($config-or-theme);
Expand Down Expand Up @@ -36,6 +43,7 @@
$density: theming.get-density-config($theme);
$typography: theming.get-typography-config($theme);

@include base($theme);
@if $color != null {
@include color($color);
}
Expand Down
1 change: 0 additions & 1 deletion src/material/snack-bar/snack-bar-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
// surface element.
@include mdc-snackbar-theme.elevation(mdc-snackbar-theme.$elevation);
@include mdc-snackbar-theme.theme-styles(tokens-mdc-snack-bar.get-token-slots());
@include mdc-snackbar-theme.theme(tokens-mdc-snack-bar.get-unthemable-tokens());

// MDC sets the position as fixed and sets the container on the bottom center of the page (or
// otherwise can be set to be "leading"). Our overlay handles a more advanced configuration
Expand Down
Loading