Skip to content

Commit f823c2a

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

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/material/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
@forward './checkbox/checkbox-theme' as checkbox-* show checkbox-theme, checkbox-color,
8484
checkbox-typography, checkbox-density, checkbox-base;
8585
@forward './chips/chips-theme' as chips-* show chips-theme, chips-color, chips-typography,
86-
chips-density;
86+
chips-density, chips-base;
8787
@forward './datepicker/datepicker-theme' as datepicker-* show datepicker-theme, datepicker-color,
8888
datepicker-typography, datepicker-date-range-colors, datepicker-density, datepicker-base;
8989
@forward './dialog/dialog-theme' as dialog-* show dialog-theme, dialog-color, dialog-typography,

src/material/chips/_chips-theme.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
@use '../core/theming/inspection';
66
@use '../core/typography/typography';
77

8+
@mixin base($theme) {
9+
.mat-mdc-standard-chip {
10+
@include mdc-chip-theme.theme(tokens-mdc-chip.get-unthemable-tokens());
11+
}
12+
}
13+
814
@mixin color($theme) {
915
.mat-mdc-standard-chip {
1016
$default-color-tokens: tokens-mdc-chip.get-color-tokens($theme);
@@ -48,6 +54,7 @@
4854

4955
@mixin theme($theme) {
5056
@include theming.private-check-duplicate-theme-styles($theme, 'mat-chips') {
57+
@include base($theme);
5158
@if inspection.theme-has($theme, color) {
5259
@include color($theme);
5360
}

src/material/chips/chip.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
.mat-mdc-standard-chip {
1919
// Add the official slots for the MDC chip.
2020
@include mdc-chip-theme.theme-styles($token-slots);
21-
22-
// Add default values for tokens that aren't outputted by the theming API.
23-
@include mdc-chip-theme.theme(m2-mdc-chip.get-unthemable-tokens());
2421
}
2522

2623
// Add additional slots for the MDC chip tokens, needed in Angular Material.

0 commit comments

Comments
 (0)