Skip to content

Commit 1f8b130

Browse files
authored
fix(material/button-toggle): use system colors (#31231)
# Conflicts: # src/material/button-toggle/_m2-button-toggle.scss
1 parent 55b7ba0 commit 1f8b130

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

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

Lines changed: 14 additions & 13 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.
@@ -24,28 +25,28 @@
2425
@return (
2526
button-toggle-background-color: map.get($system, surface),
2627
button-toggle-disabled-selected-state-background-color:
27-
inspection.get-theme-color($theme, background, selected-disabled-button),
28-
button-toggle-disabled-selected-state-text-color: map.get($system, on-surface),
28+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
29+
button-toggle-disabled-selected-state-text-color:
30+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
2931
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),
33+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
3234
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: map.get($system, surface-variant),
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),
4243
button-toggle-legacy-state-layer-color:
43-
inspection.get-theme-color($theme, background, focused-button),
44-
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),
4546
button-toggle-selected-state-background-color:
46-
inspection.get-theme-color($theme, background, selected-button),
47+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
4748
button-toggle-selected-state-text-color: map.get($system, on-surface),
48-
button-toggle-state-layer-color: inspection.get-theme-color($theme, system, on-surface),
49+
button-toggle-state-layer-color: map.get($system, on-surface),
4950
button-toggle-text-color: map.get($system, on-surface),
5051
);
5152
}

0 commit comments

Comments
 (0)