Skip to content

Commit 865014a

Browse files
committed
fix(material/expansion): move unthemable tokens to theme mixin
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.expansion-theme that are not emitted by any of: mat.expansion-color, mat.expansion-typography, mat.expansion-density. If you rely on the partial mixins only and don't call mat.expansion-theme, you can add mat.expansion-base to get the missing styles.
1 parent 2f958ac commit 865014a

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
@@ -92,7 +92,7 @@
9292
@forward './divider/divider-theme' as divider-* show divider-theme, divider-color,
9393
divider-typography, divider-density;
9494
@forward './expansion/expansion-theme' as expansion-* show expansion-theme, expansion-color,
95-
expansion-typography, expansion-density;
95+
expansion-typography, expansion-density, expansion-base;
9696
@forward './form-field/form-field-theme' as form-field-* show form-field-theme,
9797
form-field-color, form-field-typography, form-field-density;
9898
@forward './grid-list/grid-list-theme' as grid-list-* show grid-list-theme, grid-list-color,

src/material/expansion/_expansion-theme.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
@use '../core/tokens/token-utils';
66
@use '../core/tokens/m2/mat/expansion' as tokens-mat-expansion;
77

8+
@mixin base($theme) {
9+
@include sass-utils.current-selector-or-root() {
10+
@include token-utils.create-token-values(
11+
tokens-mat-expansion.$prefix, tokens-mat-expansion.get-unthemable-tokens());
12+
}
13+
}
14+
815
@mixin color($theme) {
916
@include sass-utils.current-selector-or-root() {
1017
@include token-utils.create-token-values(tokens-mat-expansion.$prefix,
@@ -31,6 +38,7 @@
3138

3239
@mixin theme($theme) {
3340
@include theming.private-check-duplicate-theme-styles($theme, 'mat-expansion') {
41+
@include base($theme);
3442
@if inspection.theme-has($theme, color) {
3543
@include color($theme);
3644
}

src/material/expansion/expansion-panel.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
@use '../core/style/elevation';
77

88
.mat-expansion-panel {
9-
@include token-utils.create-token-values(
10-
tokens-mat-expansion.$prefix, tokens-mat-expansion.get-unthemable-tokens());
119
@include elevation.overridable-elevation(2);
1210
box-sizing: content-box;
1311
display: block;

0 commit comments

Comments
 (0)