Skip to content

Commit 943b5da

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

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/material/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ list-density, list-base;
112112
progress-spinner-theme, progress-spinner-color, progress-spinner-typography,
113113
progress-spinner-density, progress-spinner-base;
114114
@forward './radio/radio-theme' as radio-* show radio-theme, radio-color, radio-typography,
115-
radio-density;
115+
radio-density, radio-base;
116116
@forward './select/select-theme' as select-* show select-theme, select-color, select-typography,
117117
select-density;
118118
@forward './sidenav/sidenav-theme' as sidenav-* show sidenav-theme, sidenav-color,

src/material/radio/_radio-theme.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
@use '../core/tokens/m2/mdc/radio' as tokens-mdc-radio;
1010
@use '../core/tokens/m2/mat/radio' as tokens-mat-radio;
1111

12+
@mixin base($theme) {
13+
.mat-mdc-radio-button {
14+
@include mdc-radio-theme.theme(tokens-mdc-radio.get-unthemable-tokens());
15+
@include token-utils.create-token-values(
16+
tokens-mat-radio.$prefix, tokens-mat-radio.get-unthemable-tokens());
17+
}
18+
}
19+
1220
@mixin color($theme) {
1321
@include mdc-helpers.using-mdc-theme($theme) {
1422
.mat-mdc-radio-button {
@@ -62,6 +70,7 @@
6270

6371
@mixin theme($theme) {
6472
@include theming.private-check-duplicate-theme-styles($theme, 'mat-radio') {
73+
@include base($theme);
6574
@if inspection.theme-has($theme, color) {
6675
@include color($theme);
6776
}

src/material/radio/radio.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
@include mdc-form-field.core-styles($query: mdc-helpers.$mdc-base-styles-query);
1818

1919
.mat-mdc-radio-button {
20-
@include token-utils.create-token-values(
21-
tokens-mat-radio.$prefix, tokens-mat-radio.get-unthemable-tokens());
22-
@include mdc-radio-theme.theme(tokens-mdc-radio.get-unthemable-tokens());
2320
-webkit-tap-highlight-color: transparent;
2421

2522
.mdc-radio {

0 commit comments

Comments
 (0)