Skip to content

Commit cef7de0

Browse files
committed
fix(material/radio): Apply tokens at mixin root
Applies radio tokens at the theme mixin's root selector (or html if the mixin is called with no selector). This makes it easier for users to override tokens without worrying about specificity.
1 parent 06559a0 commit cef7de0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/material/radio/_radio-theme.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@use '@material/radio/radio' as mdc-radio;
21
@use '@material/radio/radio-theme' as mdc-radio-theme;
32
@use '@material/form-field' as mdc-form-field;
43
@use '../core/mdc-helpers/mdc-helpers';
4+
@use '../core/style/sass-utils';
55
@use '../core/theming/theming';
66
@use '../core/theming/inspection';
77
@use '../core/tokens/token-utils';
@@ -10,7 +10,7 @@
1010
@use '../core/tokens/m2/mat/radio' as tokens-mat-radio;
1111

1212
@mixin base($theme) {
13-
.mat-mdc-radio-button {
13+
@include sass-utils.current-selector-or-root() {
1414
@include mdc-radio-theme.theme(tokens-mdc-radio.get-unthemable-tokens());
1515
@include token-utils.create-token-values(
1616
tokens-mat-radio.$prefix, tokens-mat-radio.get-unthemable-tokens());
@@ -46,7 +46,7 @@
4646
}
4747

4848
@mixin typography($theme) {
49-
.mat-mdc-radio-button {
49+
@include sass-utils.current-selector-or-root() {
5050
@include mdc-radio-theme.theme(tokens-mdc-radio.get-typography-tokens($theme));
5151
@include mdc-helpers.using-mdc-typography($theme) {
5252
@include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
@@ -57,7 +57,7 @@
5757
@mixin density($theme) {
5858
$density-scale: inspection.get-theme-density($theme);
5959

60-
.mat-mdc-radio-button .mdc-radio {
60+
@include sass-utils.current-selector-or-root() {
6161
@include mdc-radio-theme.theme(tokens-mdc-radio.get-density-tokens($theme));
6262
}
6363

0 commit comments

Comments
 (0)