Skip to content

Commit

Permalink
fix(material/bottom-sheet): move unthemable tokens to theme mixin
Browse files Browse the repository at this point in the history
Though these tokens are not currently affected by the theme, in the
future they will be affected by the design system used for theming (M2
or M3)

BREAKING CHANGE:
There are new styles emitted by mat.bottom-sheet-theme that are not
emitted by any of: mat.bottom-sheet-color, mat.bottom-sheet-typography,
mat.bottom-sheet-density. If you rely on the partial mixins only and don't
call mat.bottom-sheet-theme, you can add mat.bottom-sheet-base to get the
missing styles.
  • Loading branch information
mmalerba committed Oct 5, 2023
1 parent 3e31986 commit ca1396a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/material/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
@forward './badge/badge-theme' as badge-* show badge-theme, badge-color, badge-typography,
badge-density, badge-base;
@forward './bottom-sheet/bottom-sheet-theme' as bottom-sheet-* show bottom-sheet-theme,
bottom-sheet-color, bottom-sheet-typography, bottom-sheet-density;
bottom-sheet-color, bottom-sheet-typography, bottom-sheet-density, bottom-sheet-base;
@forward './button/button-theme' as button-* show button-theme, button-color, button-typography,
button-density;
@forward './button/fab-theme' as fab-* show fab-color, fab-typography,
Expand Down
8 changes: 8 additions & 0 deletions src/material/bottom-sheet/_bottom-sheet-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
@use '../core/tokens/token-utils';
@use '../core/tokens/m2/mat/bottom-sheet' as tokens-mat-bottom-sheet;

@mixin base($theme) {
@include sass-utils.current-selector-or-root() {
@include token-utils.create-token-values(
tokens-mat-bottom-sheet.$prefix, tokens-mat-bottom-sheet.get-unthemable-tokens());
}
}

@mixin color($theme) {
@include sass-utils.current-selector-or-root() {
@include token-utils.create-token-values(tokens-mat-bottom-sheet.$prefix,
Expand All @@ -23,6 +30,7 @@

@mixin theme($theme) {
@include theming.private-check-duplicate-theme-styles($theme, 'mat-bottom-sheet') {
@include base($theme);
@if inspection.theme-has($theme, color) {
@include color($theme);
}
Expand Down
2 changes: 0 additions & 2 deletions src/material/bottom-sheet/bottom-sheet-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ $container-vertical-padding: 8px !default;
$container-horizontal-padding: 16px !default;

.mat-bottom-sheet-container {
@include token-utils.create-token-values(
tokens-mat-bottom-sheet.$prefix, tokens-mat-bottom-sheet.get-unthemable-tokens());
@include elevation.elevation(16);
padding: $container-vertical-padding
$container-horizontal-padding;
Expand Down

0 comments on commit ca1396a

Please sign in to comment.