|
1 | 1 | @use '../core/theming/inspection';
|
2 | 2 | @use '../core/style/elevation';
|
| 3 | +@use 'sass:map'; |
| 4 | +@use '../core/tokens/m2-utils'; |
| 5 | +@use '../core/tokens/m3-utils'; |
3 | 6 |
|
4 | 7 | // Tokens that can't be configured through Angular Material's current theming API,
|
5 | 8 | // but may be in a future version of the theming API.
|
|
23 | 26 |
|
24 | 27 | // Tokens that can be configured through Angular Material's color theming API.
|
25 | 28 | @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); |
29 | 30 |
|
30 | 31 | @return (
|
31 | 32 | menu-item-label-text-color: inspection.get-theme-color($theme, system, on-surface),
|
32 | 33 | 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)), |
35 | 38 | menu-container-color: inspection.get-theme-color($theme, system, surface),
|
36 | 39 | menu-divider-color: inspection.get-theme-color($theme, system, outline),
|
37 | 40 | );
|
|
0 commit comments