Skip to content

Commit 9089cfc

Browse files
committed
fix(material/checkbox): derive checkmark color from palette
Fixes that the checkbox's checkmark color isn't derived from the palette.
1 parent cfdfa9a commit 9089cfc

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,10 @@
44
@use '../../../theming/inspection';
55
@use '../../../style/sass-utils';
66
@use '../../token-utils';
7-
@use '@material/theme/theme-color' as mdc-theme-color;
87

98
// The prefix used to generate the fully qualified name for tokens in this file.
109
$prefix: (mdc, checkbox);
1110

12-
// MDC logs a warning if the `contrast-tone` function is called with a CSS variable.
13-
// This function falls back to determining the tone based on whether the theme is light or dark.
14-
@function _contrast-tone($value, $is-dark, $light-color: '#fff', $dark-color: '#000') {
15-
@if ($value == 'dark' or $value == 'light' or type-of($value) == 'color') {
16-
@return if(mdc-theme-color.contrast-tone($value) == 'dark', $dark-color, $light-color);
17-
}
18-
19-
@return if($is-dark, $light-color, $dark-color);
20-
}
21-
2211
// Tokens that can't be configured through Angular Material's current theming API,
2312
// but may be in a future version of the theming API.
2413
//
@@ -69,7 +58,8 @@ $prefix: (mdc, checkbox);
6958
// The color of the checkbox border when the checkbox is unselected and disabled.
7059
disabled-unselected-icon-color: $disabled-color,
7160
// The color of the checkmark when the checkbox is selected.
72-
selected-checkmark-color: _contrast-tone($palette-selected, $is-dark),
61+
selected-checkmark-color:
62+
inspection.get-theme-color($theme, $palette-name, default-contrast, 1),
7363
// The color of the checkbox fill when the checkbox is selected and focused.
7464
selected-focus-icon-color: $palette-selected,
7565
// The color of the checkbox fill when the checkbox is selected and hovered.

0 commit comments

Comments
 (0)