Skip to content

Commit 20ac2b2

Browse files
andrewseguinAndrew Seguin
andauthored
fix(material/core): improve disabled psuedo checkbox contrast (#31464)
* fix(material/core): improve disabled psuedo checkbox contrast * refactor: lint --------- Co-authored-by: Andrew Seguin <andrewseguin@google.com>
1 parent 8860e65 commit 20ac2b2

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@use '../../theming/inspection';
21
@use 'sass:map';
3-
@use 'sass:meta';
42
@use '../../tokens/m2-utils';
53
@use '../../tokens/m3-utils';
64

@@ -15,12 +13,6 @@
1513

1614
// Tokens that can be configured through Angular Material's color theming API.
1715
@function private-get-color-palette-color-tokens($theme, $color-variant) {
18-
// TODO: Use system colors instead of checking theme type
19-
$is-dark: false;
20-
@if (meta.type-of($theme) == map and map.get($theme, color)) {
21-
$is-dark: inspection.get-theme-type($theme) == dark;
22-
}
23-
$disabled-color: if($is-dark, #686868, #b0b0b0);
2416
$system: m2-utils.get-system($theme);
2517
$system: m3-utils.replace-colors-with-variant($system, secondary, $color-variant);
2618

@@ -29,9 +21,12 @@
2921
pseudo-checkbox-full-selected-checkmark-color: map.get($system, background),
3022
pseudo-checkbox-full-unselected-icon-color: map.get($system, on-surface-variant),
3123
pseudo-checkbox-full-disabled-selected-checkmark-color: map.get($system, background),
32-
pseudo-checkbox-full-disabled-unselected-icon-color: $disabled-color,
33-
pseudo-checkbox-full-disabled-selected-icon-color: $disabled-color,
24+
pseudo-checkbox-full-disabled-unselected-icon-color:
25+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
26+
pseudo-checkbox-full-disabled-selected-icon-color:
27+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
3428
pseudo-checkbox-minimal-selected-checkmark-color: map.get($system, secondary),
35-
pseudo-checkbox-minimal-disabled-selected-checkmark-color: $disabled-color,
29+
pseudo-checkbox-minimal-disabled-selected-checkmark-color:
30+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
3631
);
3732
}

0 commit comments

Comments
 (0)