Skip to content

Commit 00bf17c

Browse files
committed
fix(material/button-toggle): use system colors
1 parent 6082c1f commit 00bf17c

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/material/button-toggle/_m2-button-toggle.scss

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@use '../core/theming/theming';
33
@use '../core/theming/inspection';
44
@use '../core/tokens/m2-utils';
5+
@use '../core/tokens/m3-utils';
56

67
// Tokens that can't be configured through Angular Material's current theming API,
78
// but may be in a future version of the theming API.
@@ -19,35 +20,34 @@
1920

2021
// Tokens that can be configured through Angular Material's color theming API.
2122
@function get-color-tokens($theme) {
23+
$system: m2-utils.get-system($theme);
24+
2225
@return (
23-
button-toggle-background-color: inspection.get-theme-color($theme, system, surface),
26+
button-toggle-background-color: map.get($system, surface),
2427
button-toggle-disabled-selected-state-background-color:
25-
inspection.get-theme-color($theme, background, selected-disabled-button),
28+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
2629
button-toggle-disabled-selected-state-text-color:
27-
inspection.get-theme-color($theme, system, on-surface),
28-
button-toggle-disabled-state-background-color:
29-
inspection.get-theme-color($theme, system, surface),
30+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
31+
button-toggle-disabled-state-background-color: map.get($system, surface),
3032
button-toggle-disabled-state-text-color:
31-
inspection.get-theme-color($theme, foreground, disabled-button),
32-
button-toggle-divider-color: inspection.get-theme-color($theme, system, outline),
33+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
34+
button-toggle-divider-color: map.get($system, outline),
3335
button-toggle-legacy-disabled-selected-state-background-color:
34-
inspection.get-theme-color($theme, background, selected-disabled-button),
35-
button-toggle-legacy-disabled-state-background-color:
36-
inspection.get-theme-color($theme, background, disabled-button-toggle),
36+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
37+
button-toggle-legacy-disabled-state-background-color: map.get($system, surface),
3738
button-toggle-legacy-disabled-state-text-color:
38-
inspection.get-theme-color($theme, foreground, disabled-button),
39+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
3940
button-toggle-legacy-selected-state-background-color:
40-
inspection.get-theme-color($theme, background, selected-button),
41-
button-toggle-legacy-selected-state-text-color:
42-
inspection.get-theme-color($theme, foreground, secondary-text),
41+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
42+
button-toggle-legacy-selected-state-text-color: map.get($system, on-surface),
4343
button-toggle-legacy-state-layer-color:
44-
inspection.get-theme-color($theme, background, focused-button),
45-
button-toggle-legacy-text-color: inspection.get-theme-color($theme, foreground, hint-text),
44+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
45+
button-toggle-legacy-text-color: map.get($system, on-surface),
4646
button-toggle-selected-state-background-color:
47-
inspection.get-theme-color($theme, background, selected-button),
48-
button-toggle-selected-state-text-color: inspection.get-theme-color($theme, system, on-surface),
49-
button-toggle-state-layer-color: inspection.get-theme-color($theme, background, base),
50-
button-toggle-text-color: inspection.get-theme-color($theme, system, on-surface),
47+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
48+
button-toggle-selected-state-text-color: map.get($system, on-surface),
49+
button-toggle-state-layer-color: map.get($system, on-surface),
50+
button-toggle-text-color: map.get($system, on-surface),
5151
);
5252
}
5353

0 commit comments

Comments
 (0)