Skip to content

Commit 623030b

Browse files
andrewseguinAndrew Seguin
and
Andrew Seguin
authored
fix(material/menu): update tokens to system colors (#31285)
Co-authored-by: Andrew Seguin <[email protected]>
1 parent 918b625 commit 623030b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/material/menu/_m2-menu.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
@use '../core/theming/inspection';
22
@use '../core/style/elevation';
3+
@use 'sass:map';
4+
@use '../core/tokens/m2-utils';
5+
@use '../core/tokens/m3-utils';
36

47
// Tokens that can't be configured through Angular Material's current theming API,
58
// but may be in a future version of the theming API.
@@ -23,15 +26,15 @@
2326

2427
// Tokens that can be configured through Angular Material's color theming API.
2528
@function get-color-tokens($theme) {
26-
$is-dark: inspection.get-theme-type($theme) == dark;
27-
$active-state-layer-color: inspection.get-theme-color($theme, foreground, base,
28-
if($is-dark, 0.08, 0.04));
29+
$system: m2-utils.get-system($theme);
2930

3031
@return (
3132
menu-item-label-text-color: inspection.get-theme-color($theme, system, on-surface),
3233
menu-item-icon-color: inspection.get-theme-color($theme, system, on-surface),
33-
menu-item-hover-state-layer-color: $active-state-layer-color,
34-
menu-item-focus-state-layer-color: $active-state-layer-color,
34+
menu-item-hover-state-layer-color: m3-utils.color-with-opacity(
35+
map.get($system, on-surface), map.get($system, hover-state-layer-opacity)),
36+
menu-item-focus-state-layer-color: m3-utils.color-with-opacity(
37+
map.get($system, on-surface), map.get($system, focus-state-layer-opacity)),
3538
menu-container-color: inspection.get-theme-color($theme, system, surface),
3639
menu-divider-color: inspection.get-theme-color($theme, system, outline),
3740
);

0 commit comments

Comments
 (0)