Skip to content

Commit 593fc79

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

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/material/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
progress-bar-density, progress-bar-base;
144144
@forward './progress-spinner/progress-spinner-theme' as progress-spinner-* show
145145
progress-spinner-theme, progress-spinner-color, progress-spinner-typography,
146-
progress-spinner-density;
146+
progress-spinner-density, progress-spinner-base;
147147
@forward './legacy-progress-spinner/progress-spinner-theme' as legacy-progress-spinner-* show
148148
legacy-progress-spinner-theme, legacy-progress-spinner-color, legacy-progress-spinner-typography;
149149
@forward './radio/radio-theme' as radio-* show radio-theme, radio-color, radio-typography,

src/material/progress-spinner/_progress-spinner-theme.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
@use 'sass:map';
2+
@use '../core/style/sass-utils';
23
@use '../core/theming/theming';
34
@use '../core/tokens/m2/mdc/circular-progress' as tokens-mdc-circular-progress;
45
@use '@material/circular-progress/circular-progress-theme' as mdc-circular-progress-theme;
56

7+
@mixin base($config-or-theme) {
8+
// Add default values for tokens not related to color, typography, or density.
9+
@include sass-utils.current-selector-or-root() {
10+
@include mdc-circular-progress-theme.theme(
11+
tokens-mdc-circular-progress.get-unthemable-tokens()
12+
);
13+
}
14+
}
15+
616
@mixin color($config-or-theme) {
717
$config: theming.get-color-config($config-or-theme);
818
$mdc-circular-progress-color-tokens: tokens-mdc-circular-progress.get-color-tokens($config);
@@ -33,6 +43,7 @@
3343
$density: theming.get-density-config($theme);
3444
$typography: theming.get-typography-config($theme);
3545

46+
@include base($theme);
3647
@if $color != null {
3748
@include color($color);
3849
}

src/material/progress-spinner/progress-spinner.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
.mat-mdc-progress-spinner {
1515
// Add the official slots for the MDC circular progress.
1616
@include mdc-circular-progress-theme.theme-styles($mdc-circular-progress-token-slots);
17-
18-
// Add default values for tokens that aren't outputted by the theming API.
19-
@include mdc-circular-progress-theme.theme(m2-mdc-circular-progress.get-unthemable-tokens());
2017
}
2118
}
2219

0 commit comments

Comments
 (0)