@angular/material 20.1.0-next.1 → 20.1.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/_index.scss +1 -2
  2. package/autocomplete/_autocomplete-theme.scss +28 -37
  3. package/autocomplete/_m2-autocomplete.scss +10 -22
  4. package/badge/_badge-theme.scss +35 -44
  5. package/badge/_m2-badge.scss +46 -59
  6. package/bottom-sheet/_bottom-sheet-theme.scss +28 -40
  7. package/bottom-sheet/_m2-bottom-sheet.scss +16 -33
  8. package/button/_button-theme.scss +37 -55
  9. package/button/_fab-theme.scss +42 -56
  10. package/button/_icon-button-theme.scss +33 -49
  11. package/button/_m2-button.scss +135 -158
  12. package/button/_m2-fab.scss +60 -69
  13. package/button/_m2-icon-button.scss +30 -50
  14. package/button/_m3-button.scss +1 -2
  15. package/button/_m3-fab.scss +1 -2
  16. package/button/_m3-icon-button.scss +1 -2
  17. package/button/testing/index.d.ts +1 -0
  18. package/button-toggle/_button-toggle-theme.scss +29 -44
  19. package/button-toggle/_m2-button-toggle.scss +58 -81
  20. package/button-toggle/_m3-button-toggle.scss +1 -2
  21. package/card/_card-theme.scss +28 -36
  22. package/card/_m2-card.scss +30 -45
  23. package/checkbox/_checkbox-theme.scss +37 -50
  24. package/checkbox/_m2-checkbox.scss +30 -40
  25. package/checkbox/_m3-checkbox.scss +1 -2
  26. package/chips/_chips-theme.scss +27 -30
  27. package/chips/_m2-chip.scss +40 -53
  28. package/chips/_m3-chip.scss +1 -2
  29. package/core/_core-theme.scss +48 -67
  30. package/core/_m2-app.scss +11 -23
  31. package/core/focus-indicators/_private.scss +2 -5
  32. package/core/m2/_theming.scss +36 -41
  33. package/core/option/_m2-optgroup.scss +13 -25
  34. package/core/option/_m2-option.scss +16 -22
  35. package/core/option/_optgroup-theme.scss +28 -30
  36. package/core/option/_option-theme.scss +35 -34
  37. package/core/ripple/_m2-ripple.scss +8 -20
  38. package/core/ripple/_ripple-theme.scss +28 -33
  39. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +14 -21
  40. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +55 -45
  41. package/core/theming/_all-theme.scss +38 -42
  42. package/core/theming/_definition.scss +22 -13
  43. package/core/theming/_inspection.scss +0 -12
  44. package/core/theming/_m2-inspection.scss +0 -33
  45. package/core/theming/_theming.scss +4 -172
  46. package/core/tokens/_m2-utils.scss +16 -68
  47. package/core/tokens/_m3-utils.scss +2 -14
  48. package/core/tokens/_token-utils.scss +7 -27
  49. package/core/tokens/m2/_index.scss +6 -0
  50. package/core/tokens/m2/_md-sys-color.scss +123 -0
  51. package/core/tokens/m2/_md-sys-elevation.scss +16 -0
  52. package/core/tokens/m2/_md-sys-motion.scss +36 -0
  53. package/core/tokens/m2/_md-sys-shape.scss +22 -0
  54. package/core/tokens/m2/_md-sys-state.scss +15 -0
  55. package/core/tokens/m2/_md-sys-typescale.scss +68 -0
  56. package/core/tokens/m3/_md-sys-color.scss +2 -2
  57. package/core/tokens/m3/_md-sys-typescale.scss +1 -1
  58. package/core/tokens/m3/_theme.scss +14 -26
  59. package/datepicker/_datepicker-theme.scss +38 -40
  60. package/datepicker/_m2-datepicker.scss +26 -40
  61. package/dialog/_dialog-theme.scss +28 -34
  62. package/dialog/_m2-dialog.scss +34 -48
  63. package/divider/_divider-theme.scss +28 -30
  64. package/divider/_m2-divider.scss +10 -21
  65. package/expansion/_expansion-theme.scss +28 -39
  66. package/expansion/_m2-expansion.scss +52 -67
  67. package/expansion/_m3-expansion.scss +3 -2
  68. package/fesm2022/autocomplete.mjs +1 -1
  69. package/fesm2022/button/testing.mjs +7 -4
  70. package/fesm2022/button/testing.mjs.map +1 -1
  71. package/fesm2022/chips.mjs +1 -1
  72. package/fesm2022/core.mjs +1 -1
  73. package/fesm2022/core.mjs.map +1 -1
  74. package/fesm2022/datepicker.mjs +1 -1
  75. package/fesm2022/expansion.mjs +2 -2
  76. package/fesm2022/expansion.mjs.map +1 -1
  77. package/fesm2022/{form-field-C9DZXojn.mjs → form-field-CFbrnFED.mjs} +3 -3
  78. package/fesm2022/{form-field-C9DZXojn.mjs.map → form-field-CFbrnFED.mjs.map} +1 -1
  79. package/fesm2022/form-field.mjs +2 -2
  80. package/fesm2022/input.mjs +3 -27
  81. package/fesm2022/input.mjs.map +1 -1
  82. package/fesm2022/menu/testing.mjs +97 -13
  83. package/fesm2022/menu/testing.mjs.map +1 -1
  84. package/fesm2022/menu.mjs +343 -122
  85. package/fesm2022/menu.mjs.map +1 -1
  86. package/fesm2022/{module-BDiw_nWS.mjs → module-B0CLRw5e.mjs} +3 -3
  87. package/fesm2022/{module-BDiw_nWS.mjs.map → module-B0CLRw5e.mjs.map} +1 -1
  88. package/fesm2022/{module-DzZHEh7B.mjs → module-B62K-792.mjs} +2 -2
  89. package/fesm2022/{module-DzZHEh7B.mjs.map → module-B62K-792.mjs.map} +1 -1
  90. package/fesm2022/paginator.mjs +3 -3
  91. package/fesm2022/select.mjs +3 -3
  92. package/fesm2022/sidenav.mjs +2 -4
  93. package/fesm2022/sidenav.mjs.map +1 -1
  94. package/fesm2022/slide-toggle.mjs +2 -2
  95. package/fesm2022/slide-toggle.mjs.map +1 -1
  96. package/fesm2022/snack-bar.mjs +2 -2
  97. package/fesm2022/timepicker.mjs +1 -1
  98. package/form-field/_form-field-theme.scss +35 -51
  99. package/form-field/_m2-form-field.scss +125 -146
  100. package/form-field/_m3-form-field.scss +1 -2
  101. package/grid-list/_grid-list-theme.scss +28 -28
  102. package/grid-list/_m2-grid-list.scss +16 -29
  103. package/icon/_icon-theme.scss +40 -41
  104. package/icon/_m2-icon.scss +7 -21
  105. package/input/_input-theme.scss +1 -4
  106. package/input/index.d.ts +0 -11
  107. package/list/_list-theme.scss +57 -53
  108. package/list/_m2-list.scss +84 -108
  109. package/list/_m3-list.scss +1 -2
  110. package/menu/_m2-menu.scss +33 -46
  111. package/menu/_menu-theme.scss +28 -33
  112. package/menu/index.d.ts +145 -61
  113. package/menu/testing/index.d.ts +50 -2
  114. package/package.json +2 -2
  115. package/paginator/_m2-paginator.scss +38 -58
  116. package/paginator/_m3-paginator.scss +1 -2
  117. package/paginator/_paginator-theme.scss +28 -33
  118. package/prebuilt-themes/deeppurple-amber.css +1 -1
  119. package/prebuilt-themes/indigo-pink.css +1 -1
  120. package/prebuilt-themes/pink-bluegrey.css +1 -1
  121. package/prebuilt-themes/purple-green.css +1 -1
  122. package/progress-bar/_m2-progress-bar.scss +11 -24
  123. package/progress-bar/_progress-bar-theme.scss +35 -43
  124. package/progress-spinner/_m2-progress-spinner.scss +9 -20
  125. package/progress-spinner/_progress-spinner-theme.scss +42 -43
  126. package/radio/_m2-radio.scss +30 -40
  127. package/radio/_m3-radio.scss +1 -2
  128. package/radio/_radio-theme.scss +33 -46
  129. package/schematics/ng-add/index.js +1 -1
  130. package/schematics/ng-generate/theme-color/schema.json +1 -1
  131. package/select/_m2-select.scss +23 -30
  132. package/select/_m3-select.scss +1 -2
  133. package/select/_select-theme.scss +38 -51
  134. package/sidenav/_m2-sidenav.scss +26 -36
  135. package/sidenav/_sidenav-theme.scss +28 -30
  136. package/slide-toggle/_m2-slide-toggle.scss +111 -143
  137. package/slide-toggle/_m3-slide-toggle.scss +1 -0
  138. package/slide-toggle/_slide-toggle-theme.scss +42 -80
  139. package/slider/_m2-slider.scss +34 -55
  140. package/slider/_slider-theme.scss +38 -45
  141. package/snack-bar/_m2-snack-bar.scss +16 -36
  142. package/snack-bar/_snack-bar-theme.scss +28 -31
  143. package/sort/_m2-sort.scss +7 -18
  144. package/sort/_sort-theme.scss +28 -33
  145. package/stepper/_m2-stepper.scss +39 -57
  146. package/stepper/_m3-stepper.scss +1 -2
  147. package/stepper/_stepper-theme.scss +41 -49
  148. package/table/_m2-table.scss +54 -72
  149. package/table/_m3-table.scss +1 -2
  150. package/table/_table-theme.scss +28 -36
  151. package/tabs/_m2-tabs.scss +31 -46
  152. package/tabs/_m3-tabs.scss +1 -2
  153. package/tabs/_tabs-theme.scss +41 -49
  154. package/timepicker/_m2-timepicker.scss +10 -22
  155. package/timepicker/_timepicker-theme.scss +28 -46
  156. package/toolbar/_m2-toolbar.scss +26 -46
  157. package/toolbar/_m3-toolbar.scss +1 -2
  158. package/toolbar/_toolbar-theme.scss +55 -46
  159. package/tooltip/_m2-tooltip.scss +16 -34
  160. package/tooltip/_tooltip-theme.scss +28 -37
  161. package/tree/_m2-tree.scss +21 -38
  162. package/tree/_m3-tree.scss +1 -2
  163. package/tree/_tree-theme.scss +28 -38
  164. package/core/tokens/_format-tokens.scss +0 -5
@@ -1,116 +1,92 @@
1
- @use '../core/theming/inspection';
2
1
  @use 'sass:map';
3
2
  @use '../core/tokens/m2-utils';
3
+ @use '../core/theming/theming';
4
4
 
5
- // Tokens that can't be configured through Angular Material's current theming API,
6
- // but may be in a future version of the theming API.
7
- @function get-unthemable-tokens() {
8
- @return (
9
- list-active-indicator-color: transparent,
10
- list-active-indicator-shape: 4px,
11
- list-list-item-container-shape: 0,
12
- list-list-item-leading-avatar-shape: 50%,
13
- list-list-item-container-color: transparent,
14
- list-list-item-selected-container-color: transparent,
15
- list-list-item-leading-avatar-color: transparent,
16
- list-list-item-leading-icon-size: 24px,
17
- list-list-item-leading-avatar-size: 40px,
18
- list-list-item-trailing-icon-size: 24px,
19
- list-list-item-disabled-state-layer-color: transparent,
20
- list-list-item-disabled-state-layer-opacity: 0,
21
- list-list-item-disabled-label-text-opacity: 0.38,
22
- list-list-item-disabled-leading-icon-opacity: 0.38,
23
- list-list-item-disabled-trailing-icon-opacity: 0.38,
24
- );
25
- }
26
-
27
- // Tokens that can be configured through Angular Material's color theming API.
28
- @function get-color-tokens($theme) {
5
+ @function get-tokens($theme) {
29
6
  $system: m2-utils.get-system($theme);
7
+ $density-scale: theming.clamp-density(map.get($system, density-scale), -5);
30
8
 
31
9
  @return (
32
- list-list-item-label-text-color: map.get($system, on-surface),
33
- list-list-item-supporting-text-color: map.get($system, on-surface-variant),
34
- list-list-item-leading-icon-color: map.get($system, on-surface-variant),
35
- list-list-item-trailing-supporting-text-color: map.get($system, on-surface-variant),
36
- list-list-item-trailing-icon-color: map.get($system, on-surface-variant),
37
- list-list-item-selected-trailing-icon-color: map.get($system, on-surface-variant),
38
- list-list-item-disabled-label-text-color: map.get($system, on-surface),
39
- list-list-item-disabled-leading-icon-color: map.get($system, on-surface),
40
- list-list-item-disabled-trailing-icon-color: map.get($system, on-surface),
41
- list-list-item-hover-label-text-color: map.get($system, on-surface),
42
- list-list-item-hover-leading-icon-color: map.get($system, on-surface-variant),
43
- list-list-item-hover-state-layer-color: map.get($system, on-surface),
44
- list-list-item-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
45
- list-list-item-hover-trailing-icon-color: map.get($system, on-surface-variant),
46
- list-list-item-focus-label-text-color: map.get($system, on-surface),
47
- list-list-item-focus-state-layer-color: map.get($system, on-surface),
48
- list-list-item-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
49
- );
50
- }
51
-
52
- // Tokens that can be configured through Angular Material's typography theming API.
53
- @function get-typography-tokens($theme) {
54
- @return (
55
- list-list-item-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
56
- list-list-item-label-text-line-height:
57
- inspection.get-theme-typography($theme, body-1, line-height),
58
- list-list-item-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
59
- list-list-item-label-text-tracking:
60
- inspection.get-theme-typography($theme, body-1, letter-spacing),
61
- list-list-item-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
62
- list-list-item-supporting-text-font:
63
- inspection.get-theme-typography($theme, body-2, font-family),
64
- list-list-item-supporting-text-line-height:inspection.get-theme-typography(
65
- $theme, body-2, line-height),
66
- list-list-item-supporting-text-size: inspection.get-theme-typography($theme, body-2, font-size),
67
- list-list-item-supporting-text-tracking: inspection.get-theme-typography(
68
- $theme, body-2, letter-spacing),
69
- list-list-item-supporting-text-weight:
70
- inspection.get-theme-typography($theme, body-2, font-weight),
71
- list-list-item-trailing-supporting-text-font: inspection.get-theme-typography(
72
- $theme, caption, font-family),
73
- list-list-item-trailing-supporting-text-line-height: inspection.get-theme-typography(
74
- $theme, caption, line-height),
75
- list-list-item-trailing-supporting-text-size: inspection.get-theme-typography(
76
- $theme, caption, font-size),
77
- list-list-item-trailing-supporting-text-tracking: inspection.get-theme-typography(
78
- $theme, caption, letter-spacing),
79
- list-list-item-trailing-supporting-text-weight: inspection.get-theme-typography(
80
- $theme, caption, font-weight),
81
- );
82
- }
83
-
84
- // Tokens that can be configured through Angular Material's density theming API.
85
- @function get-density-tokens($theme) {
86
- $scale: inspection.get-theme-density($theme);
87
-
88
- @return (
89
- list-list-item-leading-icon-start-space: 16px,
90
- list-list-item-leading-icon-end-space: 32px,
91
- list-list-item-one-line-container-height: map.get((
92
- 0: 48px,
93
- -1: 44px,
94
- -2: 40px,
95
- -3: 36px,
96
- -4: 32px,
97
- -5: 24px,
98
- ), $scale),
99
- list-list-item-two-line-container-height: map.get((
100
- 0: 64px,
101
- -1: 60px,
102
- -2: 56px,
103
- -3: 52px,
104
- -4: 48px,
105
- -5: 48px,
106
- ), $scale),
107
- list-list-item-three-line-container-height: map.get((
108
- 0: 88px,
109
- -1: 84px,
110
- -2: 80px,
111
- -3: 76px,
112
- -4: 72px,
113
- -5: 56px,
114
- ), $scale),
10
+ base: (
11
+ list-active-indicator-color: transparent,
12
+ list-active-indicator-shape: 4px,
13
+ list-list-item-container-shape: 0,
14
+ list-list-item-leading-avatar-shape: 50%,
15
+ list-list-item-container-color: transparent,
16
+ list-list-item-selected-container-color: transparent,
17
+ list-list-item-leading-avatar-color: transparent,
18
+ list-list-item-leading-icon-size: 24px,
19
+ list-list-item-leading-avatar-size: 40px,
20
+ list-list-item-trailing-icon-size: 24px,
21
+ list-list-item-disabled-state-layer-color: transparent,
22
+ list-list-item-disabled-state-layer-opacity: 0,
23
+ list-list-item-disabled-label-text-opacity: 0.38,
24
+ list-list-item-disabled-leading-icon-opacity: 0.38,
25
+ list-list-item-disabled-trailing-icon-opacity: 0.38,
26
+ ),
27
+ color: (
28
+ list-list-item-label-text-color: map.get($system, on-surface),
29
+ list-list-item-supporting-text-color: map.get($system, on-surface-variant),
30
+ list-list-item-leading-icon-color: map.get($system, on-surface-variant),
31
+ list-list-item-trailing-supporting-text-color: map.get($system, on-surface-variant),
32
+ list-list-item-trailing-icon-color: map.get($system, on-surface-variant),
33
+ list-list-item-selected-trailing-icon-color: map.get($system, on-surface-variant),
34
+ list-list-item-disabled-label-text-color: map.get($system, on-surface),
35
+ list-list-item-disabled-leading-icon-color: map.get($system, on-surface),
36
+ list-list-item-disabled-trailing-icon-color: map.get($system, on-surface),
37
+ list-list-item-hover-label-text-color: map.get($system, on-surface),
38
+ list-list-item-hover-leading-icon-color: map.get($system, on-surface-variant),
39
+ list-list-item-hover-state-layer-color: map.get($system, on-surface),
40
+ list-list-item-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
41
+ list-list-item-hover-trailing-icon-color: map.get($system, on-surface-variant),
42
+ list-list-item-focus-label-text-color: map.get($system, on-surface),
43
+ list-list-item-focus-state-layer-color: map.get($system, on-surface),
44
+ list-list-item-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
45
+ ),
46
+ typography: (
47
+ list-list-item-label-text-font: map.get($system, body-large-font),
48
+ list-list-item-label-text-line-height: map.get($system, body-large-line-height),
49
+ list-list-item-label-text-size: map.get($system, body-large-size),
50
+ list-list-item-label-text-tracking: map.get($system, body-large-tracking),
51
+ list-list-item-label-text-weight: map.get($system, body-large-weight),
52
+ list-list-item-supporting-text-font: map.get($system, body-medium-font),
53
+ list-list-item-supporting-text-line-height: map.get($system, body-medium-line-height),
54
+ list-list-item-supporting-text-size: map.get($system, body-medium-size),
55
+ list-list-item-supporting-text-tracking: map.get($system, body-medium-tracking),
56
+ list-list-item-supporting-text-weight: map.get($system, body-medium-weight),
57
+ list-list-item-trailing-supporting-text-font: map.get($system, body-small-font),
58
+ list-list-item-trailing-supporting-text-line-height: map.get($system, body-small-line-height),
59
+ list-list-item-trailing-supporting-text-size: map.get($system, body-small-size),
60
+ list-list-item-trailing-supporting-text-tracking: map.get($system, body-small-tracking),
61
+ list-list-item-trailing-supporting-text-weight: map.get($system, body-small-weight),
62
+ ),
63
+ density: (
64
+ list-list-item-leading-icon-start-space: 16px,
65
+ list-list-item-leading-icon-end-space: 32px,
66
+ list-list-item-one-line-container-height: map.get((
67
+ 0: 48px,
68
+ -1: 44px,
69
+ -2: 40px,
70
+ -3: 36px,
71
+ -4: 32px,
72
+ -5: 24px,
73
+ ), $density-scale),
74
+ list-list-item-two-line-container-height: map.get((
75
+ 0: 64px,
76
+ -1: 60px,
77
+ -2: 56px,
78
+ -3: 52px,
79
+ -4: 48px,
80
+ -5: 48px,
81
+ ), $density-scale),
82
+ list-list-item-three-line-container-height: map.get((
83
+ 0: 88px,
84
+ -1: 84px,
85
+ -2: 80px,
86
+ -3: 76px,
87
+ -4: 72px,
88
+ -5: 56px,
89
+ ), $density-scale),
90
+ ),
115
91
  );
116
92
  }
@@ -2,7 +2,6 @@
2
2
  @use 'sass:list';
3
3
  @use '../core/tokens/m3-utils';
4
4
  @use '../core/theming/theming';
5
- @use '../core/theming/inspection';
6
5
  @use '../core/tokens/m3';
7
6
 
8
7
  /// Generates custom tokens for the mat-list.
@@ -72,7 +71,7 @@
72
71
  list-list-item-trailing-supporting-text-tracking: map.get($system, label-small-tracking),
73
72
  list-list-item-trailing-supporting-text-weight: map.get($system, label-small-weight),
74
73
  ),
75
- density: get-density-tokens(map.get($theme, inspection.$internals, density-scale)),
74
+ density: get-density-tokens(map.get($system, density-scale)),
76
75
  );
77
76
  }
78
77
 
@@ -1,57 +1,44 @@
1
- @use '../core/theming/inspection';
2
1
  @use '../core/style/elevation';
3
2
  @use 'sass:map';
4
3
  @use '../core/tokens/m2-utils';
5
4
  @use '../core/tokens/m3-utils';
6
5
 
7
- // Tokens that can't be configured through Angular Material's current theming API,
8
- // but may be in a future version of the theming API.
9
- @function get-unthemable-tokens() {
10
- @return (
11
- menu-container-shape: 4px,
12
- menu-divider-bottom-spacing: 0,
13
- menu-divider-top-spacing: 0,
14
- menu-item-spacing: 16px,
15
- menu-item-icon-size: 24px,
16
- menu-item-leading-spacing: 16px,
17
- menu-item-trailing-spacing: 16px,
18
- menu-item-with-icon-leading-spacing: 16px,
19
- menu-item-with-icon-trailing-spacing: 16px,
20
- menu-container-elevation-shadow: elevation.get-box-shadow(8),
21
-
22
- // Unused
23
- menu-base-elevation-level: null,
24
- );
25
- }
26
-
27
- // Tokens that can be configured through Angular Material's color theming API.
28
- @function get-color-tokens($theme) {
6
+ @function get-tokens($theme) {
29
7
  $system: m2-utils.get-system($theme);
30
8
 
31
9
  @return (
32
- menu-item-label-text-color: map.get($system, on-surface),
33
- menu-item-icon-color: map.get($system, on-surface),
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)),
38
- menu-container-color: map.get($system, surface),
39
- menu-divider-color: map.get($system, outline),
40
- );
41
- }
10
+ base: (
11
+ menu-container-shape: 4px,
12
+ menu-divider-bottom-spacing: 0,
13
+ menu-divider-top-spacing: 0,
14
+ menu-item-spacing: 16px,
15
+ menu-item-icon-size: 24px,
16
+ menu-item-leading-spacing: 16px,
17
+ menu-item-trailing-spacing: 16px,
18
+ menu-item-with-icon-leading-spacing: 16px,
19
+ menu-item-with-icon-trailing-spacing: 16px,
20
+ menu-container-elevation-shadow: elevation.get-box-shadow(8),
42
21
 
43
- // Tokens that can be configured through Angular Material's typography theming API.
44
- @function get-typography-tokens($theme) {
45
- @return (
46
- menu-item-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
47
- menu-item-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
48
- menu-item-label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
49
- menu-item-label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
50
- menu-item-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
22
+ // Unused
23
+ menu-base-elevation-level: null,
24
+ ),
25
+ color: (
26
+ menu-item-label-text-color: map.get($system, on-surface),
27
+ menu-item-icon-color: map.get($system, on-surface),
28
+ menu-item-hover-state-layer-color: m3-utils.color-with-opacity(
29
+ map.get($system, on-surface), map.get($system, hover-state-layer-opacity)),
30
+ menu-item-focus-state-layer-color: m3-utils.color-with-opacity(
31
+ map.get($system, on-surface), map.get($system, focus-state-layer-opacity)),
32
+ menu-container-color: map.get($system, surface),
33
+ menu-divider-color: map.get($system, outline),
34
+ ),
35
+ typography: (
36
+ menu-item-label-text-font: map.get($system, body-large-font),
37
+ menu-item-label-text-size: map.get($system, body-large-size),
38
+ menu-item-label-text-tracking: map.get($system, body-large-tracking),
39
+ menu-item-label-text-line-height: map.get($system, body-large-line-height),
40
+ menu-item-label-text-weight: map.get($system, body-large-weight),
41
+ ),
42
+ density: (),
51
43
  );
52
44
  }
53
-
54
- // Tokens that can be configured through Angular Material's density theming API.
55
- @function get-density-tokens($theme) {
56
- @return ();
57
- }
@@ -1,47 +1,44 @@
1
1
  @use 'sass:map';
2
2
  @use './m2-menu';
3
3
  @use './m3-menu';
4
- @use '../core/style/sass-utils';
5
4
  @use '../core/tokens/token-utils';
6
- @use '../core/theming/theming';
7
5
  @use '../core/theming/inspection';
8
6
  @use '../core/typography/typography';
9
7
 
10
8
  @mixin base($theme) {
9
+ $tokens: map.get(m2-menu.get-tokens($theme), base);
11
10
  @if inspection.get-theme-version($theme) == 1 {
12
- @include token-utils.create-token-values(map.get(m3-menu.get-tokens($theme), base));
13
- } @else {
14
- @include sass-utils.current-selector-or-root() {
15
- @include token-utils.create-token-values-mixed(m2-menu.get-unthemable-tokens());
16
- }
11
+ $tokens: map.get(m3-menu.get-tokens($theme), base);
17
12
  }
13
+
14
+ @include token-utils.values($tokens);
18
15
  }
19
16
 
20
17
  @mixin color($theme) {
18
+ $tokens: map.get(m2-menu.get-tokens($theme), color);
21
19
  @if inspection.get-theme-version($theme) == 1 {
22
- @include token-utils.create-token-values(map.get(m3-menu.get-tokens($theme), color));
23
- } @else {
24
- @include sass-utils.current-selector-or-root() {
25
- @include token-utils.create-token-values-mixed(m2-menu.get-color-tokens($theme));
26
- }
20
+ $tokens: map.get(m3-menu.get-tokens($theme), color);
27
21
  }
22
+
23
+ @include token-utils.values($tokens);
28
24
  }
29
25
 
30
26
  @mixin typography($theme) {
27
+ $tokens: map.get(m2-menu.get-tokens($theme), typography);
31
28
  @if inspection.get-theme-version($theme) == 1 {
32
- @include token-utils.create-token-values(map.get(m3-menu.get-tokens($theme), typography));
33
- } @else {
34
- @include sass-utils.current-selector-or-root() {
35
- @include token-utils.create-token-values-mixed(m2-menu.get-typography-tokens($theme));
36
- }
29
+ $tokens: map.get(m3-menu.get-tokens($theme), typography);
37
30
  }
31
+
32
+ @include token-utils.values($tokens);
38
33
  }
39
34
 
40
35
  @mixin density($theme) {
36
+ $tokens: map.get(m2-menu.get-tokens($theme), density);
41
37
  @if inspection.get-theme-version($theme) == 1 {
42
- @include token-utils.create-token-values(map.get(m3-menu.get-tokens($theme), density));
43
- } @else {
38
+ $tokens: map.get(m3-menu.get-tokens($theme), density);
44
39
  }
40
+
41
+ @include token-utils.values($tokens);
45
42
  }
46
43
 
47
44
  /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
@@ -59,23 +56,21 @@
59
56
  }
60
57
 
61
58
  @mixin theme($theme) {
62
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-menu') {
63
- @if inspection.get-theme-version($theme) == 1 {
64
- @include base($theme);
59
+ @if inspection.get-theme-version($theme) == 1 {
60
+ @include base($theme);
61
+ @include color($theme);
62
+ @include density($theme);
63
+ @include typography($theme);
64
+ } @else {
65
+ @include base($theme);
66
+ @if inspection.theme-has($theme, color) {
65
67
  @include color($theme);
68
+ }
69
+ @if inspection.theme-has($theme, density) {
66
70
  @include density($theme);
71
+ }
72
+ @if inspection.theme-has($theme, typography) {
67
73
  @include typography($theme);
68
- } @else {
69
- @include base($theme);
70
- @if inspection.theme-has($theme, color) {
71
- @include color($theme);
72
- }
73
- @if inspection.theme-has($theme, density) {
74
- @include density($theme);
75
- }
76
- @if inspection.theme-has($theme, typography) {
77
- @include typography($theme);
78
- }
79
74
  }
80
75
  }
81
76
  }