Skip to content

Commit cbeeb3a

Browse files
committed
fix(material/checkbox): use token for disabled label color
Fixes that we were emitting a concrete style for the checkbox instead of using a token.
1 parent 064415b commit cbeeb3a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/material/checkbox/_checkbox-theme.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
&.mat-warn {
4545
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, warn));
4646
}
47-
48-
&.mat-mdc-checkbox-disabled label {
49-
// MDC should set the disabled color on the label, but doesn't, so we do it here instead.
50-
color: inspection.get-theme-color($theme, foreground, disabled-text);
51-
}
5247
}
5348
}
5449
}

src/material/checkbox/checkbox.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@
171171

172172
&.mat-mdc-checkbox-disabled label {
173173
cursor: default;
174+
175+
@include token-utils.use-tokens(tokens-mat-checkbox.$prefix,
176+
tokens-mat-checkbox.get-token-slots()) {
177+
@include token-utils.create-token-slot(color, disabled-label-color);
178+
}
174179
}
175180

176181
// The MDC styles result in extra padding if the label is present but empty. To fix this we hide

src/material/core/tokens/m2/mat/_checkbox.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ $prefix: (mat, checkbox);
1414

1515
// Tokens that can be configured through Angular Material's color theming API.
1616
@function get-color-tokens($theme) {
17-
@return ();
17+
@return (
18+
disabled-label-color: inspection.get-theme-color($theme, foreground, disabled-text),
19+
);
1820
}
1921

2022
// Tokens that can be configured through Angular Material's typography theming API.

0 commit comments

Comments
 (0)