Skip to content

fix(material/radio): Apply tokens at mixin root #27864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/material/list/_list-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@
@include mdc-list-theme.theme($mdc-list-density-tokens);
}

.mdc-list-item__start,
.mdc-list-item__end {
@include mdc-radio-theme.theme(tokens-mdc-radio.get-density-tokens($theme));
}

// TODO(mmalerba): This is added to maintain the same style MDC used prior to the token-based API,
// to avoid screenshot diffs. We should remove it in favor of following MDC's current style, or
// add custom tokens for it.
Expand Down
11 changes: 7 additions & 4 deletions src/material/radio/_radio-theme.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '@material/radio/radio' as mdc-radio;
@use '@material/radio/radio-theme' as mdc-radio-theme;
@use '@material/form-field' as mdc-form-field;
@use '../core/mdc-helpers/mdc-helpers';
@use '../core/style/sass-utils';
@use '../core/theming/theming';
@use '../core/theming/inspection';
@use '../core/tokens/token-utils';
Expand All @@ -10,7 +10,7 @@
@use '../core/tokens/m2/mat/radio' as tokens-mat-radio;

@mixin base($theme) {
.mat-mdc-radio-button {
@include sass-utils.current-selector-or-root() {
@include mdc-radio-theme.theme(tokens-mdc-radio.get-unthemable-tokens());
@include token-utils.create-token-values(
tokens-mat-radio.$prefix, tokens-mat-radio.get-unthemable-tokens());
Expand Down Expand Up @@ -46,8 +46,11 @@
}

@mixin typography($theme) {
.mat-mdc-radio-button {
@include sass-utils.current-selector-or-root() {
@include mdc-radio-theme.theme(tokens-mdc-radio.get-typography-tokens($theme));
}

.mat-mdc-radio-button {
@include mdc-helpers.using-mdc-typography($theme) {
@include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
}
Expand All @@ -57,7 +60,7 @@
@mixin density($theme) {
$density-scale: inspection.get-theme-density($theme);

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

Expand Down