Skip to content

Commit 5dfa115

Browse files
mmalerbazarend
authored andcommitted
fix(material/sidenav): move unthemable tokens to theme mixin (#27889)
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.sidenav-theme that are not emitted by any of: mat.sidenav-color, mat.sidenav-typography, mat.sidenav-density. If you rely on the partial mixins only and don't call mat.sidenav-theme, you can add mat.sidenav-base to get the missing styles.
1 parent 079a3a7 commit 5dfa115

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/material/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ list-density, list-base;
117117
@forward './select/select-theme' as select-* show select-theme, select-color, select-typography,
118118
select-density, select-base;
119119
@forward './sidenav/sidenav-theme' as sidenav-* show sidenav-theme, sidenav-color,
120-
sidenav-typography, sidenav-density;
120+
sidenav-typography, sidenav-density, sidenav-base;
121121
@forward './slide-toggle/slide-toggle-theme' as slide-toggle-* show
122122
slide-toggle-theme, slide-toggle-color, slide-toggle-typography, slide-toggle-density;
123123
@forward './slider/slider-theme' as slider-* show slider-theme, slider-color, slider-typography,

src/material/sidenav/_sidenav-theme.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
@use '../core/tokens/token-utils';
55
@use '../core/style/sass-utils';
66

7+
@mixin base($theme) {
8+
@include sass-utils.current-selector-or-root() {
9+
@include token-utils.create-token-values(
10+
tokens-mat-sidenav.$prefix, tokens-mat-sidenav.get-unthemable-tokens());
11+
}
12+
}
13+
714
@mixin color($theme) {
815
@include sass-utils.current-selector-or-root() {
916
@include token-utils.create-token-values(tokens-mat-sidenav.$prefix,
@@ -17,6 +24,7 @@
1724

1825
@mixin theme($theme) {
1926
@include theming.private-check-duplicate-theme-styles($theme, 'mat-sidenav') {
27+
@include base($theme);
2028
@if inspection.theme-has($theme, color) {
2129
@include color($theme);
2230
}

src/material/sidenav/drawer.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ $drawer-over-drawer-z-index: 4;
126126
// See https://material.io/design/components/navigation-drawer.html
127127
@include elevation.elevation(16);
128128
@include drawer-stacking-context($drawer-over-drawer-z-index);
129-
@include token-utils.create-token-values(
130-
tokens-mat-sidenav.$prefix, tokens-mat-sidenav.get-unthemable-tokens());
131129

132130
@include token-utils.use-tokens(
133131
tokens-mat-sidenav.$prefix, tokens-mat-sidenav.get-token-slots()) {

0 commit comments

Comments
 (0)