@angular/material 20.1.0-next.0 → 20.1.0-next.2

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 (243) hide show
  1. package/_index.scss +1 -2
  2. package/autocomplete/_autocomplete-theme.scss +28 -37
  3. package/autocomplete/_m2-autocomplete.scss +5 -2
  4. package/badge/_badge-theme.scss +35 -44
  5. package/badge/_m2-badge.scss +3 -2
  6. package/bottom-sheet/_bottom-sheet-theme.scss +28 -40
  7. package/bottom-sheet/_m2-bottom-sheet.scss +12 -11
  8. package/button/_button-theme.scss +37 -55
  9. package/button/_fab-theme.scss +42 -56
  10. package/button/_icon-button-theme.scss +30 -48
  11. package/button/_m2-button.scss +60 -59
  12. package/button/_m2-fab.scss +19 -15
  13. package/button/_m2-icon-button.scss +7 -5
  14. package/button/testing/index.d.ts +1 -0
  15. package/button-toggle/_button-toggle-theme.scss +29 -44
  16. package/button-toggle/_m2-button-toggle.scss +11 -17
  17. package/card/_card-theme.scss +28 -36
  18. package/card/_m2-card.scss +12 -14
  19. package/checkbox/_checkbox-theme.scss +35 -50
  20. package/checkbox/_m2-checkbox.scss +8 -8
  21. package/chips/_chips-theme.scss +24 -30
  22. package/chips/_m2-chip.scss +12 -28
  23. package/core/_core-theme.scss +48 -67
  24. package/core/focus-indicators/_private.scss +2 -5
  25. package/core/m2/_theming.scss +68 -113
  26. package/core/option/_m2-optgroup.scss +10 -7
  27. package/core/option/_m2-option.scss +13 -11
  28. package/core/option/_optgroup-theme.scss +28 -30
  29. package/core/option/_option-theme.scss +35 -34
  30. package/core/ripple/_m2-ripple.scss +6 -10
  31. package/core/ripple/_ripple-theme.scss +28 -33
  32. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +2 -3
  33. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +55 -45
  34. package/core/theming/_all-theme.scss +38 -42
  35. package/core/theming/_definition.scss +20 -13
  36. package/core/theming/_inspection.scss +0 -12
  37. package/core/theming/_m2-inspection.scss +0 -33
  38. package/core/theming/_theming.scss +4 -172
  39. package/core/tokens/_m2-utils.scss +5 -75
  40. package/core/tokens/_m3-system.scss +11 -9
  41. package/core/tokens/_m3-utils.scss +2 -14
  42. package/core/tokens/_token-utils.scss +7 -27
  43. package/core/tokens/m2/_index.scss +6 -0
  44. package/core/tokens/m2/_md-sys-color.scss +123 -0
  45. package/core/tokens/m2/_md-sys-elevation.scss +16 -0
  46. package/core/tokens/m2/_md-sys-motion.scss +36 -0
  47. package/core/tokens/m2/_md-sys-shape.scss +22 -0
  48. package/core/tokens/m2/_md-sys-state.scss +15 -0
  49. package/core/tokens/m2/_md-sys-typescale.scss +68 -0
  50. package/core/tokens/m3/_md-sys-color.scss +2 -2
  51. package/core/tokens/m3/_md-sys-typescale.scss +1 -1
  52. package/core/tokens/m3/_theme.scss +14 -26
  53. package/datepicker/_datepicker-theme.scss +47 -87
  54. package/datepicker/_m2-datepicker.scss +33 -123
  55. package/datepicker/index.d.ts +1 -1
  56. package/dialog/_dialog-theme.scss +28 -34
  57. package/dialog/_m2-dialog.scss +17 -17
  58. package/divider/_divider-theme.scss +28 -30
  59. package/divider/_m2-divider.scss +4 -2
  60. package/expansion/_expansion-theme.scss +28 -39
  61. package/expansion/_m2-expansion.scss +11 -10
  62. package/expansion/_m3-expansion.scss +2 -0
  63. package/fesm2022/animation-DfMFjxHu.mjs.map +1 -1
  64. package/fesm2022/autocomplete/testing.mjs.map +1 -1
  65. package/fesm2022/autocomplete.mjs +1 -1
  66. package/fesm2022/autocomplete.mjs.map +1 -1
  67. package/fesm2022/badge/testing.mjs.map +1 -1
  68. package/fesm2022/badge.mjs.map +1 -1
  69. package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
  70. package/fesm2022/bottom-sheet.mjs.map +1 -1
  71. package/fesm2022/button/testing.mjs +7 -4
  72. package/fesm2022/button/testing.mjs.map +1 -1
  73. package/fesm2022/button-toggle/testing.mjs.map +1 -1
  74. package/fesm2022/button-toggle.mjs.map +1 -1
  75. package/fesm2022/button.mjs +2 -2
  76. package/fesm2022/button.mjs.map +1 -1
  77. package/fesm2022/card/testing.mjs.map +1 -1
  78. package/fesm2022/card.mjs.map +1 -1
  79. package/fesm2022/checkbox/testing.mjs.map +1 -1
  80. package/fesm2022/checkbox.mjs.map +1 -1
  81. package/fesm2022/chips/testing.mjs.map +1 -1
  82. package/fesm2022/chips.mjs +1 -1
  83. package/fesm2022/chips.mjs.map +1 -1
  84. package/fesm2022/common-module-cKSwHniA.mjs.map +1 -1
  85. package/fesm2022/core/testing.mjs.map +1 -1
  86. package/fesm2022/core.mjs +1 -1
  87. package/fesm2022/core.mjs.map +1 -1
  88. package/fesm2022/date-formats-K6TQue-Y.mjs.map +1 -1
  89. package/fesm2022/date-range-input-harness-DEyfkeOs.mjs.map +1 -1
  90. package/fesm2022/datepicker/testing.mjs.map +1 -1
  91. package/fesm2022/datepicker.mjs +1 -1
  92. package/fesm2022/datepicker.mjs.map +1 -1
  93. package/fesm2022/dialog/testing.mjs.map +1 -1
  94. package/fesm2022/dialog.mjs.map +1 -1
  95. package/fesm2022/divider/testing.mjs.map +1 -1
  96. package/fesm2022/divider.mjs.map +1 -1
  97. package/fesm2022/error-options-DCNQlTOA.mjs.map +1 -1
  98. package/fesm2022/error-state-Dtb1IHM-.mjs.map +1 -1
  99. package/fesm2022/expansion/testing.mjs.map +1 -1
  100. package/fesm2022/expansion.mjs +2 -2
  101. package/fesm2022/expansion.mjs.map +1 -1
  102. package/fesm2022/form-field/testing/control.mjs.map +1 -1
  103. package/fesm2022/form-field/testing.mjs.map +1 -1
  104. package/fesm2022/{form-field-C9DZXojn.mjs → form-field-CFbrnFED.mjs} +3 -3
  105. package/fesm2022/form-field-CFbrnFED.mjs.map +1 -0
  106. package/fesm2022/form-field.mjs +2 -2
  107. package/fesm2022/form-field.mjs.map +1 -1
  108. package/fesm2022/grid-list/testing.mjs.map +1 -1
  109. package/fesm2022/grid-list.mjs.map +1 -1
  110. package/fesm2022/icon/testing.mjs.map +1 -1
  111. package/fesm2022/icon-button-DxiIc1ex.mjs.map +1 -1
  112. package/fesm2022/icon-registry-CwOTJ7YM.mjs.map +1 -1
  113. package/fesm2022/icon.mjs.map +1 -1
  114. package/fesm2022/index-BFRo2fUq.mjs.map +1 -1
  115. package/fesm2022/index-DwiL-HGk.mjs.map +1 -1
  116. package/fesm2022/input/testing.mjs.map +1 -1
  117. package/fesm2022/input-harness-C5Msdc4-.mjs.map +1 -1
  118. package/fesm2022/input-value-accessor-D1GvPuqO.mjs.map +1 -1
  119. package/fesm2022/input.mjs +3 -27
  120. package/fesm2022/input.mjs.map +1 -1
  121. package/fesm2022/internal-form-field-D5iFxU6d.mjs.map +1 -1
  122. package/fesm2022/line-Bz5f9Cyx.mjs.map +1 -1
  123. package/fesm2022/list/testing.mjs.map +1 -1
  124. package/fesm2022/list.mjs.map +1 -1
  125. package/fesm2022/material.mjs.map +1 -1
  126. package/fesm2022/menu/testing.mjs +97 -13
  127. package/fesm2022/menu/testing.mjs.map +1 -1
  128. package/fesm2022/menu.mjs +343 -122
  129. package/fesm2022/menu.mjs.map +1 -1
  130. package/fesm2022/{module-BDiw_nWS.mjs → module-B0CLRw5e.mjs} +3 -3
  131. package/fesm2022/module-B0CLRw5e.mjs.map +1 -0
  132. package/fesm2022/{module-DzZHEh7B.mjs → module-B62K-792.mjs} +2 -2
  133. package/fesm2022/module-B62K-792.mjs.map +1 -0
  134. package/fesm2022/module-CWxMD37a.mjs.map +1 -1
  135. package/fesm2022/module-Ce6F7TNm.mjs.map +1 -1
  136. package/fesm2022/option-BzhYL_xC.mjs.map +1 -1
  137. package/fesm2022/option-harness-BFcc-M_4.mjs.map +1 -1
  138. package/fesm2022/paginator/testing.mjs.map +1 -1
  139. package/fesm2022/paginator.mjs +3 -3
  140. package/fesm2022/paginator.mjs.map +1 -1
  141. package/fesm2022/progress-bar/testing.mjs.map +1 -1
  142. package/fesm2022/progress-bar.mjs.map +1 -1
  143. package/fesm2022/progress-spinner/testing.mjs.map +1 -1
  144. package/fesm2022/progress-spinner.mjs.map +1 -1
  145. package/fesm2022/pseudo-checkbox-DDmgx3P4.mjs.map +1 -1
  146. package/fesm2022/pseudo-checkbox-module-4F8Up4PL.mjs.map +1 -1
  147. package/fesm2022/public-api-BoO5eSq-.mjs.map +1 -1
  148. package/fesm2022/radio/testing.mjs.map +1 -1
  149. package/fesm2022/radio.mjs.map +1 -1
  150. package/fesm2022/ripple-BYgV4oZC.mjs.map +1 -1
  151. package/fesm2022/ripple-loader-BnMiRtmT.mjs.map +1 -1
  152. package/fesm2022/select/testing.mjs.map +1 -1
  153. package/fesm2022/select.mjs +3 -3
  154. package/fesm2022/select.mjs.map +1 -1
  155. package/fesm2022/sidenav/testing.mjs.map +1 -1
  156. package/fesm2022/sidenav.mjs.map +1 -1
  157. package/fesm2022/slide-toggle/testing.mjs.map +1 -1
  158. package/fesm2022/slide-toggle.mjs +2 -2
  159. package/fesm2022/slide-toggle.mjs.map +1 -1
  160. package/fesm2022/slider/testing.mjs.map +1 -1
  161. package/fesm2022/slider.mjs +2 -2
  162. package/fesm2022/slider.mjs.map +1 -1
  163. package/fesm2022/snack-bar/testing.mjs.map +1 -1
  164. package/fesm2022/snack-bar.mjs +2 -2
  165. package/fesm2022/snack-bar.mjs.map +1 -1
  166. package/fesm2022/sort/testing.mjs.map +1 -1
  167. package/fesm2022/sort.mjs.map +1 -1
  168. package/fesm2022/stepper/testing.mjs.map +1 -1
  169. package/fesm2022/stepper.mjs.map +1 -1
  170. package/fesm2022/structural-styles-CObeNzjn.mjs.map +1 -1
  171. package/fesm2022/table/testing.mjs.map +1 -1
  172. package/fesm2022/table.mjs.map +1 -1
  173. package/fesm2022/tabs/testing.mjs.map +1 -1
  174. package/fesm2022/tabs.mjs.map +1 -1
  175. package/fesm2022/timepicker/testing.mjs.map +1 -1
  176. package/fesm2022/timepicker.mjs +1 -1
  177. package/fesm2022/timepicker.mjs.map +1 -1
  178. package/fesm2022/toolbar/testing.mjs.map +1 -1
  179. package/fesm2022/toolbar.mjs.map +1 -1
  180. package/fesm2022/tooltip/testing.mjs.map +1 -1
  181. package/fesm2022/tooltip.mjs.map +1 -1
  182. package/fesm2022/tree/testing.mjs.map +1 -1
  183. package/fesm2022/tree.mjs.map +1 -1
  184. package/form-field/_form-field-theme.scss +35 -51
  185. package/form-field/_m2-form-field.scss +23 -31
  186. package/grid-list/_grid-list-theme.scss +28 -28
  187. package/grid-list/_m2-grid-list.scss +7 -9
  188. package/icon/_icon-theme.scss +40 -41
  189. package/input/_input-theme.scss +1 -4
  190. package/input/index.d.ts +0 -11
  191. package/list/_list-theme.scss +55 -53
  192. package/list/_m2-list.scss +21 -35
  193. package/menu/_m2-menu.scss +18 -15
  194. package/menu/_menu-theme.scss +28 -33
  195. package/menu/index.d.ts +145 -61
  196. package/menu/testing/index.d.ts +50 -2
  197. package/package.json +2 -2
  198. package/paginator/_m2-paginator.scss +9 -9
  199. package/paginator/_paginator-theme.scss +28 -33
  200. package/prebuilt-themes/azure-blue.css +1 -1
  201. package/prebuilt-themes/cyan-orange.css +1 -1
  202. package/prebuilt-themes/deeppurple-amber.css +1 -1
  203. package/prebuilt-themes/indigo-pink.css +1 -1
  204. package/prebuilt-themes/magenta-violet.css +1 -1
  205. package/prebuilt-themes/pink-bluegrey.css +1 -1
  206. package/prebuilt-themes/purple-green.css +1 -1
  207. package/prebuilt-themes/rose-red.css +1 -1
  208. package/progress-bar/_progress-bar-theme.scss +35 -43
  209. package/progress-spinner/_progress-spinner-theme.scss +42 -43
  210. package/radio/_m2-radio.scss +6 -5
  211. package/radio/_m3-radio.scss +1 -1
  212. package/radio/_radio-theme.scss +33 -46
  213. package/schematics/ng-add/index.js +1 -1
  214. package/select/_m2-select.scss +10 -8
  215. package/select/_select-theme.scss +38 -48
  216. package/sidenav/_sidenav-theme.scss +28 -30
  217. package/slide-toggle/_m2-slide-toggle.scss +45 -58
  218. package/slide-toggle/_m3-slide-toggle.scss +1 -0
  219. package/slide-toggle/_slide-toggle-theme.scss +41 -79
  220. package/slider/_m2-slider.scss +33 -35
  221. package/slider/_slider-theme.scss +38 -45
  222. package/snack-bar/_m2-snack-bar.scss +5 -6
  223. package/snack-bar/_snack-bar-theme.scss +28 -31
  224. package/sort/_m2-sort.scss +5 -2
  225. package/sort/_sort-theme.scss +28 -33
  226. package/stepper/_m2-stepper.scss +10 -13
  227. package/stepper/_stepper-theme.scss +41 -49
  228. package/table/_m2-table.scss +23 -28
  229. package/table/_table-theme.scss +28 -36
  230. package/tabs/_m2-tabs.scss +11 -16
  231. package/tabs/_tabs-theme.scss +35 -43
  232. package/timepicker/_m2-timepicker.scss +5 -2
  233. package/timepicker/_timepicker-theme.scss +28 -46
  234. package/toolbar/_m2-toolbar.scss +10 -9
  235. package/toolbar/_toolbar-theme.scss +55 -46
  236. package/tooltip/_m2-tooltip.scss +5 -6
  237. package/tooltip/_tooltip-theme.scss +28 -37
  238. package/tree/_m2-tree.scss +9 -5
  239. package/tree/_tree-theme.scss +28 -38
  240. package/core/tokens/_format-tokens.scss +0 -5
  241. package/fesm2022/form-field-C9DZXojn.mjs.map +0 -1
  242. package/fesm2022/module-BDiw_nWS.mjs.map +0 -1
  243. package/fesm2022/module-DzZHEh7B.mjs.map +0 -1
@@ -1,50 +1,47 @@
1
- @use '../core/style/sass-utils';
2
1
  @use '../core/theming/inspection';
3
- @use '../core/theming/theming';
4
2
  @use '../core/tokens/token-utils';
5
3
  @use './m2-icon';
6
4
  @use './m3-icon';
7
5
  @use 'sass:map';
8
6
 
9
- @mixin _palette-colors($theme, $palette-name) {
10
- $color: inspection.get-theme-color($theme, $palette-name, text);
11
- $tokens: m2-icon.private-get-icon-color-tokens($color);
12
- @include token-utils.create-token-values-mixed($tokens);
13
- }
14
-
15
- /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
16
- /// for the mat-icon.
17
- /// @param {Map} $theme The theme to generate base styles for.
18
7
  @mixin base($theme) {
8
+ $tokens: m2-icon.get-unthemable-tokens();
19
9
  @if inspection.get-theme-version($theme) == 1 {
20
- @include token-utils.create-token-values(map.get(m3-icon.get-tokens($theme), base));
21
- } @else {
10
+ $tokens: map.get(m3-icon.get-tokens($theme), base);
22
11
  }
12
+
13
+ @include token-utils.values($tokens);
23
14
  }
24
15
 
25
16
  /// Outputs color theme styles for the mat-icon.
26
17
  /// @param {Map} $theme The theme to generate color styles for.
27
18
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
28
19
  @mixin color($theme, $color-variant: null) {
20
+ $tokens: m2-icon.get-color-tokens($theme);
29
21
  @if inspection.get-theme-version($theme) == 1 {
30
- @include token-utils.create-token-values(
31
- map.get(m3-icon.get-tokens($theme, $color-variant), color));
32
- } @else {
33
- @include sass-utils.current-selector-or-root() {
34
- @include token-utils.create-token-values-mixed(m2-icon.get-color-tokens($theme));
35
- }
22
+ $tokens: map.get(m3-icon.get-tokens($theme, $color-variant), color);
23
+ }
24
+
25
+ @include token-utils.values($tokens);
36
26
 
27
+ @if inspection.get-theme-version($theme) != 1 {
37
28
  .mat-icon {
38
29
  &.mat-primary {
39
- @include _palette-colors($theme, primary);
30
+ $color: inspection.get-theme-color($theme, primary, text);
31
+ $tokens: m2-icon.private-get-icon-color-tokens($color);
32
+ @include token-utils.values($tokens);
40
33
  }
41
34
 
42
35
  &.mat-accent {
43
- @include _palette-colors($theme, accent);
36
+ $color: inspection.get-theme-color($theme, accent, text);
37
+ $tokens: m2-icon.private-get-icon-color-tokens($color);
38
+ @include token-utils.values($tokens);
44
39
  }
45
40
 
46
41
  &.mat-warn {
47
- @include _palette-colors($theme, warn);
42
+ $color: inspection.get-theme-color($theme, warn, text);
43
+ $tokens: m2-icon.private-get-icon-color-tokens($color);
44
+ @include token-utils.values($tokens);
48
45
  }
49
46
  }
50
47
  }
@@ -53,19 +50,23 @@
53
50
  /// Outputs typography theme styles for the mat-icon.
54
51
  /// @param {Map} $theme The theme to generate typography styles for.
55
52
  @mixin typography($theme) {
53
+ $tokens: m2-icon.get-typography-tokens($theme);
56
54
  @if inspection.get-theme-version($theme) == 1 {
57
- @include token-utils.create-token-values(map.get(m3-icon.get-tokens($theme), typography));
58
- } @else {
55
+ $tokens: map.get(m3-icon.get-tokens($theme), typography);
59
56
  }
57
+
58
+ @include token-utils.values($tokens);
60
59
  }
61
60
 
62
61
  /// Outputs density theme styles for the mat-icon.
63
62
  /// @param {Map} $theme The theme to generate density styles for.
64
63
  @mixin density($theme) {
64
+ $tokens: m2-icon.get-density-tokens($theme);
65
65
  @if inspection.get-theme-version($theme) == 1 {
66
- @include token-utils.create-token-values(map.get(m3-icon.get-tokens($theme), density));
67
- } @else {
66
+ $tokens: map.get(m3-icon.get-tokens($theme), density);
68
67
  }
68
+
69
+ @include token-utils.values($tokens);
69
70
  }
70
71
 
71
72
  /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
@@ -88,23 +89,21 @@
88
89
  /// @param {Map} $theme The theme to generate styles for.
89
90
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
90
91
  @mixin theme($theme, $color-variant: null) {
91
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-icon') {
92
- @if inspection.get-theme-version($theme) == 1 {
93
- @include base($theme);
94
- @include color($theme, $color-variant);
92
+ @if inspection.get-theme-version($theme) == 1 {
93
+ @include base($theme);
94
+ @include color($theme, $color-variant);
95
+ @include density($theme);
96
+ @include typography($theme);
97
+ } @else {
98
+ @include base($theme);
99
+ @if inspection.theme-has($theme, color) {
100
+ @include color($theme);
101
+ }
102
+ @if inspection.theme-has($theme, density) {
95
103
  @include density($theme);
104
+ }
105
+ @if inspection.theme-has($theme, typography) {
96
106
  @include typography($theme);
97
- } @else {
98
- @include base($theme);
99
- @if inspection.theme-has($theme, color) {
100
- @include color($theme);
101
- }
102
- @if inspection.theme-has($theme, density) {
103
- @include density($theme);
104
- }
105
- @if inspection.theme-has($theme, typography) {
106
- @include typography($theme);
107
- }
108
107
  }
109
108
  }
110
109
  }
@@ -1,4 +1,3 @@
1
- @use '../core/theming/theming';
2
1
  @use '../core/typography/typography';
3
2
  @use '../core/tokens/token-utils';
4
3
 
@@ -33,7 +32,5 @@
33
32
  }
34
33
 
35
34
  @mixin theme($theme) {
36
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-input') {
37
- // No-op
38
- }
35
+ // No-op
39
36
  }
package/input/index.d.ts CHANGED
@@ -179,17 +179,6 @@ declare class MatInput implements MatFormFieldControl<any>, OnChanges, OnDestroy
179
179
  /** Whether the form control is a native select that is displayed inline. */
180
180
  _isInlineSelect(): boolean;
181
181
  private _iOSKeyupListener;
182
- private _webkitBlinkWheelListener;
183
- /**
184
- * In blink and webkit browsers a focused number input does not increment or decrement its value
185
- * on mouse wheel interaction unless a wheel event listener is attached to it or one of its
186
- * ancestors or a passive wheel listener is attached somewhere in the DOM. For example: Hitting
187
- * a tooltip once enables the mouse wheel input for all number inputs as long as it exists. In
188
- * order to get reliable and intuitive behavior we apply a wheel event on our own thus making
189
- * sure increment and decrement by mouse wheel works every time.
190
- * @docs-private
191
- */
192
- private _ensureWheelDefaultBehavior;
193
182
  /** Gets the value to set on the `readonly` attribute. */
194
183
  protected _getReadonlyAttribute(): string | null;
195
184
  static ɵfac: i0.ɵɵFactoryDeclaration<MatInput, never>;
@@ -1,66 +1,67 @@
1
1
  @use 'sass:map';
2
2
 
3
3
  @use '../checkbox/m2-checkbox';
4
- @use '../core/style/sass-utils';
5
4
  @use '../core/theming/inspection';
6
- @use '../core/theming/theming';
7
5
  @use '../core/tokens/token-utils';
8
6
  @use '../core/typography/typography';
9
7
  @use '../radio/m2-radio';
10
8
  @use './m2-list';
11
9
  @use './m3-list';
10
+ @use '../core/tokens/m2-utils';
12
11
 
13
12
  @mixin base($theme) {
14
- // Add default values for tokens not related to color, typography, or density.
13
+ $tokens: m2-list.get-unthemable-tokens();
15
14
  @if inspection.get-theme-version($theme) == 1 {
16
- @include token-utils.create-token-values(map.get(m3-list.get-tokens($theme), base));
17
- } @else {
18
- @include sass-utils.current-selector-or-root() {
19
- @include token-utils.create-token-values-mixed(m2-list.get-unthemable-tokens());
20
- }
15
+ $tokens: map.get(m3-list.get-tokens($theme), base);
21
16
  }
17
+
18
+ @include token-utils.values($tokens);
22
19
  }
23
20
 
24
21
  @mixin color($theme) {
22
+ $tokens: m2-list.get-color-tokens($theme);
25
23
  @if inspection.get-theme-version($theme) == 1 {
26
- @include token-utils.create-token-values(map.get(m3-list.get-tokens($theme), color));
27
- } @else {
28
- @include sass-utils.current-selector-or-root() {
29
- @include token-utils.create-token-values-mixed(m2-list.get-color-tokens($theme));
30
- }
24
+ $tokens: map.get(m3-list.get-tokens($theme), color);
25
+ }
26
+
27
+ @include token-utils.values($tokens);
31
28
 
29
+ @if inspection.get-theme-version($theme) != 1 {
32
30
  .mdc-list-item__start,
33
31
  .mdc-list-item__end {
34
- @include token-utils.create-token-values-mixed(m2-radio.get-color-tokens($theme, primary));
32
+ $tokens: m2-radio.get-color-tokens($theme, primary);
33
+ @include token-utils.values($tokens);
35
34
  }
36
35
 
37
36
  .mat-accent {
38
37
  .mdc-list-item__start,
39
38
  .mdc-list-item__end {
40
- @include token-utils.create-token-values-mixed(
41
- m2-radio.get-color-tokens($theme, secondary));
39
+ $tokens: m2-radio.get-color-tokens($theme, secondary);
40
+ @include token-utils.values($tokens);
42
41
  }
43
42
  }
44
43
 
45
44
  .mat-warn {
46
45
  .mdc-list-item__start,
47
46
  .mdc-list-item__end {
48
- @include token-utils.create-token-values-mixed(
49
- m2-radio.get-color-tokens($theme, error));
47
+ $tokens: m2-radio.get-color-tokens($theme, error);
48
+ @include token-utils.values($tokens);
50
49
  }
51
50
  }
52
51
 
53
52
  .mat-mdc-list-option {
54
- @include token-utils.create-token-values-mixed(
55
- m2-checkbox.get-color-tokens($theme, primary));
53
+ $tokens: m2-checkbox.get-color-tokens($theme, primary);
54
+ @include token-utils.values($tokens);
56
55
  }
56
+
57
57
  .mat-mdc-list-option.mat-accent {
58
- @include token-utils.create-token-values-mixed(
59
- m2-checkbox.get-color-tokens($theme, secondary));
58
+ $tokens: m2-checkbox.get-color-tokens($theme, secondary);
59
+ @include token-utils.values($tokens);
60
60
  }
61
+
61
62
  .mat-mdc-list-option.mat-warn {
62
- @include token-utils.create-token-values-mixed(
63
- m2-checkbox.get-color-tokens($theme, error));
63
+ $tokens: m2-checkbox.get-color-tokens($theme, error);
64
+ @include token-utils.values($tokens);
64
65
  }
65
66
 
66
67
  // There is no token for activated color on nav list.
@@ -89,19 +90,20 @@
89
90
  }
90
91
 
91
92
  @mixin density($theme) {
93
+ $tokens: m2-list.get-density-tokens($theme);
92
94
  @if inspection.get-theme-version($theme) == 1 {
93
- @include token-utils.create-token-values(map.get(m3-list.get-tokens($theme), density));
94
- } @else {
95
- $density-scale: inspection.get-theme-density($theme);
95
+ $tokens: map.get(m3-list.get-tokens($theme), density);
96
+ }
96
97
 
97
- @include sass-utils.current-selector-or-root() {
98
- // TODO: See if this can be removed
99
- @include token-utils.create-token-values-mixed(m2-list.get-density-tokens($theme));
100
- }
98
+ @include token-utils.values($tokens);
99
+
100
+ @if inspection.get-theme-version($theme) != 1 {
101
+ $density-scale: inspection.get-theme-density($theme);
101
102
 
102
103
  .mdc-list-item__start,
103
104
  .mdc-list-item__end {
104
- @include token-utils.create-token-values-mixed(m2-radio.get-density-tokens($theme));
105
+ $tokens: m2-radio.get-density-tokens($theme);
106
+ @include token-utils.values($tokens);
105
107
  }
106
108
 
107
109
  // TODO(mmalerba): This is added to maintain the same style MDC used prior to the token-based
@@ -144,18 +146,20 @@
144
146
  }
145
147
 
146
148
  @mixin typography($theme) {
149
+ $tokens: m2-list.get-typography-tokens($theme);
147
150
  @if inspection.get-theme-version($theme) == 1 {
148
- @include token-utils.create-token-values(map.get(m3-list.get-tokens($theme), typography));
149
- } @else {
150
- @include sass-utils.current-selector-or-root() {
151
- @include token-utils.create-token-values-mixed(m2-list.get-typography-tokens($theme));
152
- }
151
+ $tokens: map.get(m3-list.get-tokens($theme), typography);
152
+ }
153
+
154
+ @include token-utils.values($tokens);
153
155
 
156
+ @if inspection.get-theme-version($theme) != 1 {
154
157
  // MDC does not have tokens for the subheader.
155
158
  // TODO(mmalerba): Discuss with MDC about adding them, or create custom tokens.
156
159
  .mdc-list-group__subheader {
157
- font: inspection.get-theme-typography($theme, subtitle-1, font);
158
- letter-spacing: inspection.get-theme-typography($theme, subtitle-1, letter-spacing);
160
+ $system: m2-utils.get-system($theme);
161
+ font: map.get($system, label-large);
162
+ letter-spacing: map.get($system, label-large-tracking);
159
163
  }
160
164
  }
161
165
  }
@@ -175,23 +179,21 @@
175
179
  }
176
180
 
177
181
  @mixin theme($theme) {
178
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-list') {
179
- @if inspection.get-theme-version($theme) == 1 {
180
- @include base($theme);
182
+ @if inspection.get-theme-version($theme) == 1 {
183
+ @include base($theme);
184
+ @include color($theme);
185
+ @include density($theme);
186
+ @include typography($theme);
187
+ } @else {
188
+ @include base($theme);
189
+ @if inspection.theme-has($theme, color) {
181
190
  @include color($theme);
191
+ }
192
+ @if inspection.theme-has($theme, density) {
182
193
  @include density($theme);
194
+ }
195
+ @if inspection.theme-has($theme, typography) {
183
196
  @include typography($theme);
184
- } @else {
185
- @include base($theme);
186
- @if inspection.theme-has($theme, color) {
187
- @include color($theme);
188
- }
189
- @if inspection.theme-has($theme, density) {
190
- @include density($theme);
191
- }
192
- @if inspection.theme-has($theme, typography) {
193
- @include typography($theme);
194
- }
195
197
  }
196
198
  }
197
199
  }
@@ -28,25 +28,21 @@
28
28
  @function get-color-tokens($theme) {
29
29
  $system: m2-utils.get-system($theme);
30
30
 
31
- $is-dark: inspection.get-theme-type($theme) == dark;
32
- $text-icon-on-background:
33
- inspection.get-theme-color($theme, foreground, base, if($is-dark, 0.5, 0.38));
34
-
35
31
  @return (
36
32
  list-list-item-label-text-color: map.get($system, on-surface),
37
33
  list-list-item-supporting-text-color: map.get($system, on-surface-variant),
38
- list-list-item-leading-icon-color: $text-icon-on-background,
34
+ list-list-item-leading-icon-color: map.get($system, on-surface-variant),
39
35
  list-list-item-trailing-supporting-text-color: map.get($system, on-surface-variant),
40
- list-list-item-trailing-icon-color: $text-icon-on-background,
41
- list-list-item-selected-trailing-icon-color: $text-icon-on-background,
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),
42
38
  list-list-item-disabled-label-text-color: map.get($system, on-surface),
43
39
  list-list-item-disabled-leading-icon-color: map.get($system, on-surface),
44
40
  list-list-item-disabled-trailing-icon-color: map.get($system, on-surface),
45
41
  list-list-item-hover-label-text-color: map.get($system, on-surface),
46
- list-list-item-hover-leading-icon-color: $text-icon-on-background,
42
+ list-list-item-hover-leading-icon-color: map.get($system, on-surface-variant),
47
43
  list-list-item-hover-state-layer-color: map.get($system, on-surface),
48
44
  list-list-item-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
49
- list-list-item-hover-trailing-icon-color: $text-icon-on-background,
45
+ list-list-item-hover-trailing-icon-color: map.get($system, on-surface-variant),
50
46
  list-list-item-focus-label-text-color: map.get($system, on-surface),
51
47
  list-list-item-focus-state-layer-color: map.get($system, on-surface),
52
48
  list-list-item-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
@@ -55,33 +51,23 @@
55
51
 
56
52
  // Tokens that can be configured through Angular Material's typography theming API.
57
53
  @function get-typography-tokens($theme) {
54
+ $system: m2-utils.get-system($theme);
58
55
  @return (
59
- list-list-item-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
60
- list-list-item-label-text-line-height:
61
- inspection.get-theme-typography($theme, body-1, line-height),
62
- list-list-item-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
63
- list-list-item-label-text-tracking:
64
- inspection.get-theme-typography($theme, body-1, letter-spacing),
65
- list-list-item-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
66
- list-list-item-supporting-text-font:
67
- inspection.get-theme-typography($theme, body-2, font-family),
68
- list-list-item-supporting-text-line-height:inspection.get-theme-typography(
69
- $theme, body-2, line-height),
70
- list-list-item-supporting-text-size: inspection.get-theme-typography($theme, body-2, font-size),
71
- list-list-item-supporting-text-tracking: inspection.get-theme-typography(
72
- $theme, body-2, letter-spacing),
73
- list-list-item-supporting-text-weight:
74
- inspection.get-theme-typography($theme, body-2, font-weight),
75
- list-list-item-trailing-supporting-text-font: inspection.get-theme-typography(
76
- $theme, caption, font-family),
77
- list-list-item-trailing-supporting-text-line-height: inspection.get-theme-typography(
78
- $theme, caption, line-height),
79
- list-list-item-trailing-supporting-text-size: inspection.get-theme-typography(
80
- $theme, caption, font-size),
81
- list-list-item-trailing-supporting-text-tracking: inspection.get-theme-typography(
82
- $theme, caption, letter-spacing),
83
- list-list-item-trailing-supporting-text-weight: inspection.get-theme-typography(
84
- $theme, caption, font-weight),
56
+ list-list-item-label-text-font: map.get($system, body-large-font),
57
+ list-list-item-label-text-line-height: map.get($system, body-large-line-height),
58
+ list-list-item-label-text-size: map.get($system, body-large-size),
59
+ list-list-item-label-text-tracking: map.get($system, body-large-tracking),
60
+ list-list-item-label-text-weight: map.get($system, body-large-weight),
61
+ list-list-item-supporting-text-font: map.get($system, body-medium-font),
62
+ list-list-item-supporting-text-line-height: map.get($system, body-medium-line-height),
63
+ list-list-item-supporting-text-size: map.get($system, body-medium-size),
64
+ list-list-item-supporting-text-tracking: map.get($system, body-medium-tracking),
65
+ list-list-item-supporting-text-weight: map.get($system, body-medium-weight),
66
+ list-list-item-trailing-supporting-text-font: map.get($system, body-small-font),
67
+ list-list-item-trailing-supporting-text-line-height: map.get($system, body-small-line-height),
68
+ list-list-item-trailing-supporting-text-size: map.get($system, body-small-size),
69
+ list-list-item-trailing-supporting-text-tracking: map.get($system, body-small-tracking),
70
+ list-list-item-trailing-supporting-text-weight: map.get($system, body-small-weight),
85
71
  );
86
72
  }
87
73
 
@@ -1,5 +1,7 @@
1
- @use '../core/theming/inspection';
2
1
  @use '../core/style/elevation';
2
+ @use 'sass:map';
3
+ @use '../core/tokens/m2-utils';
4
+ @use '../core/tokens/m3-utils';
3
5
 
4
6
  // Tokens that can't be configured through Angular Material's current theming API,
5
7
  // but may be in a future version of the theming API.
@@ -23,28 +25,29 @@
23
25
 
24
26
  // Tokens that can be configured through Angular Material's color theming API.
25
27
  @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));
28
+ $system: m2-utils.get-system($theme);
29
29
 
30
30
  @return (
31
- menu-item-label-text-color: inspection.get-theme-color($theme, system, on-surface),
32
- 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,
35
- menu-container-color: inspection.get-theme-color($theme, system, surface),
36
- menu-divider-color: inspection.get-theme-color($theme, system, outline),
31
+ menu-item-label-text-color: map.get($system, on-surface),
32
+ menu-item-icon-color: map.get($system, on-surface),
33
+ menu-item-hover-state-layer-color: m3-utils.color-with-opacity(
34
+ map.get($system, on-surface), map.get($system, hover-state-layer-opacity)),
35
+ menu-item-focus-state-layer-color: m3-utils.color-with-opacity(
36
+ map.get($system, on-surface), map.get($system, focus-state-layer-opacity)),
37
+ menu-container-color: map.get($system, surface),
38
+ menu-divider-color: map.get($system, outline),
37
39
  );
38
40
  }
39
41
 
40
42
  // Tokens that can be configured through Angular Material's typography theming API.
41
43
  @function get-typography-tokens($theme) {
44
+ $system: m2-utils.get-system($theme);
42
45
  @return (
43
- menu-item-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
44
- menu-item-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
45
- menu-item-label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
46
- menu-item-label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
47
- menu-item-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
46
+ menu-item-label-text-font: map.get($system, body-large-font),
47
+ menu-item-label-text-size: map.get($system, body-large-size),
48
+ menu-item-label-text-tracking: map.get($system, body-large-tracking),
49
+ menu-item-label-text-line-height: map.get($system, body-large-line-height),
50
+ menu-item-label-text-weight: map.get($system, body-large-weight),
48
51
  );
49
52
  }
50
53
 
@@ -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: m2-menu.get-unthemable-tokens();
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: m2-menu.get-color-tokens($theme);
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: m2-menu.get-typography-tokens($theme);
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: m2-menu.get-density-tokens($theme);
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
  }