@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
@@ -14,7 +14,6 @@
14
14
  @function get-color-tokens($theme) {
15
15
  $is-dark: inspection.get-theme-type($theme) == dark;
16
16
  $system: m2-utils.get-system($theme);
17
- $surface: inspection.get-theme-color($theme, system, surface);
18
17
 
19
18
  @return (
20
19
  snack-bar-container-color: map.get($system, inverse-surface),
@@ -30,12 +29,12 @@
30
29
 
31
30
  // Tokens that can be configured through Angular Material's typography theming API.
32
31
  @function get-typography-tokens($theme) {
32
+ $system: m2-utils.get-system($theme);
33
33
  @return (
34
- snack-bar-supporting-text-font: inspection.get-theme-typography($theme, body-2, font-family),
35
- snack-bar-supporting-text-line-height:
36
- inspection.get-theme-typography($theme, body-2, line-height),
37
- snack-bar-supporting-text-size: inspection.get-theme-typography($theme, body-2, font-size),
38
- snack-bar-supporting-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
34
+ snack-bar-supporting-text-font: map.get($system, body-medium-font),
35
+ snack-bar-supporting-text-line-height: map.get($system, body-medium-line-height),
36
+ snack-bar-supporting-text-size: map.get($system, body-medium-size),
37
+ snack-bar-supporting-text-weight: map.get($system, body-medium-weight),
39
38
  );
40
39
  }
41
40
 
@@ -1,44 +1,43 @@
1
1
  @use 'sass:map';
2
- @use '../core/theming/theming';
3
2
  @use '../core/theming/inspection';
4
- @use '../core/style/sass-utils';
5
3
  @use '../core/typography/typography';
6
4
  @use '../core/tokens/token-utils';
7
5
  @use './m2-snack-bar';
8
6
  @use './m3-snack-bar';
9
7
 
10
8
  @mixin base($theme) {
9
+ $tokens: m2-snack-bar.get-unthemable-tokens();
11
10
  @if inspection.get-theme-version($theme) == 1 {
12
- @include token-utils.create-token-values(map.get(m3-snack-bar.get-tokens($theme), base));
13
- } @else {
14
- // Add default values for tokens not related to color, typography, or density.
15
- @include sass-utils.current-selector-or-root() {
16
- @include token-utils.create-token-values-mixed(m2-snack-bar.get-unthemable-tokens());
17
- }
11
+ $tokens: map.get(m3-snack-bar.get-tokens($theme), base);
18
12
  }
13
+
14
+ @include token-utils.values($tokens);
19
15
  }
20
16
 
21
17
  @mixin color($theme) {
22
18
  @if inspection.get-theme-version($theme) == 1 {
23
- @include token-utils.create-token-values(map.get(m3-snack-bar.get-tokens($theme), color));
19
+ @include token-utils.values(map.get(m3-snack-bar.get-tokens($theme), color));
24
20
  } @else {
25
- @include sass-utils.current-selector-or-root() {
26
- @include token-utils.create-token-values-mixed(m2-snack-bar.get-color-tokens($theme));
27
- }
21
+ @include token-utils.values(m2-snack-bar.get-color-tokens($theme));
28
22
  }
29
23
  }
30
24
 
31
25
  @mixin typography($theme) {
26
+ $tokens: m2-snack-bar.get-typography-tokens($theme);
32
27
  @if inspection.get-theme-version($theme) == 1 {
33
- @include token-utils.create-token-values(map.get(m3-snack-bar.get-tokens($theme), typography));
34
- } @else {
35
- @include sass-utils.current-selector-or-root() {
36
- @include token-utils.create-token-values-mixed(m2-snack-bar.get-typography-tokens($theme));
37
- }
28
+ $tokens: map.get(m3-snack-bar.get-tokens($theme), typography);
38
29
  }
30
+
31
+ @include token-utils.values($tokens);
39
32
  }
40
33
 
41
34
  @mixin density($theme) {
35
+ $tokens: m2-snack-bar.get-density-tokens($theme);
36
+ @if inspection.get-theme-version($theme) == 1 {
37
+ $tokens: map.get(m3-snack-bar.get-tokens($theme), density);
38
+ }
39
+
40
+ @include token-utils.values($tokens);
42
41
  }
43
42
 
44
43
  /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
@@ -58,23 +57,21 @@
58
57
  }
59
58
 
60
59
  @mixin theme($theme) {
61
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-snack-bar') {
62
- @if inspection.get-theme-version($theme) == 1 {
63
- @include base($theme);
60
+ @if inspection.get-theme-version($theme) == 1 {
61
+ @include base($theme);
62
+ @include color($theme);
63
+ @include density($theme);
64
+ @include typography($theme);
65
+ } @else {
66
+ @include base($theme);
67
+ @if inspection.theme-has($theme, color) {
64
68
  @include color($theme);
69
+ }
70
+ @if inspection.theme-has($theme, density) {
65
71
  @include density($theme);
72
+ }
73
+ @if inspection.theme-has($theme, typography) {
66
74
  @include typography($theme);
67
- } @else {
68
- @include base($theme);
69
- @if inspection.theme-has($theme, color) {
70
- @include color($theme);
71
- }
72
- @if inspection.theme-has($theme, density) {
73
- @include density($theme);
74
- }
75
- @if inspection.theme-has($theme, typography) {
76
- @include typography($theme);
77
- }
78
75
  }
79
76
  }
80
77
  }
@@ -1,4 +1,5 @@
1
- @use '../core/theming/inspection';
1
+ @use '../core/tokens/m2-utils';
2
+ @use 'sass:map';
2
3
 
3
4
  // Tokens that can't be configured through Angular Material's current theming API,
4
5
  // but may be in a future version of the theming API.
@@ -8,8 +9,10 @@
8
9
 
9
10
  // Tokens that can be configured through Angular Material's color theming API.
10
11
  @function get-color-tokens($theme) {
12
+ $system: m2-utils.get-system($theme);
13
+
11
14
  @return (
12
- sort-arrow-color: inspection.get-theme-color($theme, system, on-surface),
15
+ sort-arrow-color: map.get($system, on-surface),
13
16
  );
14
17
  }
15
18
 
@@ -1,47 +1,44 @@
1
1
  @use 'sass:map';
2
2
  @use './m2-sort';
3
3
  @use './m3-sort';
4
- @use '../core/style/sass-utils';
5
4
  @use '../core/typography/typography';
6
- @use '../core/theming/theming';
7
5
  @use '../core/theming/inspection';
8
6
  @use '../core/tokens/token-utils';
9
7
 
10
8
  @mixin base($theme) {
9
+ $tokens: m2-sort.get-unthemable-tokens();
11
10
  @if inspection.get-theme-version($theme) == 1 {
12
- @include token-utils.create-token-values(map.get(m3-sort.get-tokens($theme), base));
13
- } @else {
11
+ $tokens: map.get(m3-sort.get-tokens($theme), base);
14
12
  }
13
+
14
+ @include token-utils.values($tokens);
15
15
  }
16
16
 
17
17
  @mixin color($theme) {
18
+ $tokens: m2-sort.get-color-tokens($theme);
18
19
  @if inspection.get-theme-version($theme) == 1 {
19
- @include token-utils.create-token-values(map.get(m3-sort.get-tokens($theme), color));
20
- } @else {
21
- @include sass-utils.current-selector-or-root() {
22
- @include token-utils.create-token-values-mixed(m2-sort.get-color-tokens($theme));
23
- }
20
+ $tokens: map.get(m3-sort.get-tokens($theme), color);
24
21
  }
22
+
23
+ @include token-utils.values($tokens);
25
24
  }
26
25
 
27
26
  @mixin typography($theme) {
27
+ $tokens: m2-sort.get-typography-tokens($theme);
28
28
  @if inspection.get-theme-version($theme) == 1 {
29
- @include token-utils.create-token-values(map.get(m3-sort.get-tokens($theme), typography));
30
- } @else {
31
- @include sass-utils.current-selector-or-root() {
32
- @include token-utils.create-token-values-mixed(m2-sort.get-typography-tokens($theme));
33
- }
29
+ $tokens: map.get(m3-sort.get-tokens($theme), typography);
34
30
  }
31
+
32
+ @include token-utils.values($tokens);
35
33
  }
36
34
 
37
35
  @mixin density($theme) {
36
+ $tokens: m2-sort.get-density-tokens($theme);
38
37
  @if inspection.get-theme-version($theme) == 1 {
39
- @include token-utils.create-token-values(map.get(m3-sort.get-tokens($theme), density));
40
- } @else {
41
- @include sass-utils.current-selector-or-root() {
42
- @include token-utils.create-token-values-mixed(m2-sort.get-density-tokens($theme));
43
- }
38
+ $tokens: map.get(m3-sort.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-sort') {
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
  }
@@ -26,27 +26,24 @@
26
26
  stepper-header-label-text-color: map.get($system, on-surface-variant),
27
27
  stepper-header-optional-label-text-color: map.get($system, on-surface-variant),
28
28
  stepper-header-selected-state-label-text-color: map.get($system, on-surface),
29
- stepper-header-error-state-label-text-color: inspection.get-theme-color($theme, warn, text),
29
+ stepper-header-error-state-label-text-color: map.get($system, error),
30
30
  stepper-header-icon-background-color: map.get($system, on-surface-variant),
31
- stepper-header-error-state-icon-foreground-color:
32
- inspection.get-theme-color($theme, warn, text),
31
+ stepper-header-error-state-icon-foreground-color: map.get($system, error),
33
32
  stepper-header-error-state-icon-background-color: transparent,
34
33
  ));
35
34
  }
36
35
 
37
36
  // Tokens that can be configured through Angular Material's typography theming API.
38
37
  @function get-typography-tokens($theme) {
38
+ $system: m2-utils.get-system($theme);
39
39
  @return (
40
- stepper-container-text-font: inspection.get-theme-typography($theme, body-2, font-family),
41
- stepper-header-label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
42
- stepper-header-label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
43
- stepper-header-label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
44
- stepper-header-error-state-label-text-size:
45
- inspection.get-theme-typography($theme, body-1, font-size),
46
- stepper-header-selected-state-label-text-size: inspection.get-theme-typography(
47
- $theme, body-1, font-size),
48
- stepper-header-selected-state-label-text-weight: inspection.get-theme-typography(
49
- $theme, body-1, font-weight),
40
+ stepper-container-text-font: map.get($system, body-medium-font),
41
+ stepper-header-label-text-font: map.get($system, body-medium-font),
42
+ stepper-header-label-text-size: map.get($system, body-medium-size),
43
+ stepper-header-label-text-weight: map.get($system, body-medium-weight),
44
+ stepper-header-error-state-label-text-size: map.get($system, body-large-size),
45
+ stepper-header-selected-state-label-text-size: map.get($system, body-large-size),
46
+ stepper-header-selected-state-label-text-weight: map.get($system, body-large-weight),
50
47
  );
51
48
  }
52
49
 
@@ -1,7 +1,5 @@
1
- @use '../core/theming/theming';
2
1
  @use '../core/theming/inspection';
3
2
  @use '../core/typography/typography';
4
- @use '../core/style/sass-utils';
5
3
  @use '../core/tokens/token-utils';
6
4
  @use './m2-stepper';
7
5
  @use './m3-stepper';
@@ -11,58 +9,54 @@
11
9
  /// for mat-stepper.
12
10
  /// @param {Map} $theme The theme to generate base styles for.
13
11
  @mixin base($theme) {
12
+ $tokens: m2-stepper.get-unthemable-tokens();
14
13
  @if inspection.get-theme-version($theme) == 1 {
15
- @include token-utils.create-token-values(map.get(m3-stepper.get-tokens($theme), base));
16
- } @else {
14
+ $tokens: map.get(m3-stepper.get-tokens($theme), base);
17
15
  }
16
+
17
+ @include token-utils.values($tokens);
18
18
  }
19
19
 
20
20
  /// Outputs color theme styles for mat-stepper.
21
21
  /// @param {Map} $theme The theme to generate color styles for.
22
22
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
23
23
  @mixin color($theme, $color-variant: null) {
24
+ $tokens: m2-stepper.get-color-tokens($theme);
24
25
  @if inspection.get-theme-version($theme) == 1 {
25
- @include token-utils.create-token-values(
26
- map.get(m3-stepper.get-tokens($theme, $color-variant), color));
27
- } @else {
28
- @include sass-utils.current-selector-or-root() {
29
- @include token-utils.create-token-values-mixed(m2-stepper.get-color-tokens($theme));
26
+ $tokens: map.get(m3-stepper.get-tokens($theme, $color-variant), color);
27
+ }
30
28
 
31
- .mat-step-header.mat-accent {
32
- @include token-utils.create-token-values-mixed(
33
- m2-stepper.private-get-color-palette-color-tokens($theme, secondary));
34
- }
29
+ @include token-utils.values($tokens);
35
30
 
36
- .mat-step-header.mat-warn {
37
- @include token-utils.create-token-values-mixed(
38
- m2-stepper.private-get-color-palette-color-tokens($theme, error));
39
- }
31
+ @if inspection.get-theme-version($theme) != 1 {
32
+ .mat-step-header.mat-accent {
33
+ $tokens: m2-stepper.private-get-color-palette-color-tokens($theme, secondary);
34
+ @include token-utils.values($tokens);
35
+ }
36
+
37
+ .mat-step-header.mat-warn {
38
+ $tokens: m2-stepper.private-get-color-palette-color-tokens($theme, error);
39
+ @include token-utils.values($tokens);
40
40
  }
41
41
  }
42
42
  }
43
43
 
44
- /// Outputs typography theme styles for mat-stepper.
45
- /// @param {Map} $theme The theme to generate typography styles for.
46
44
  @mixin typography($theme) {
45
+ $tokens: m2-stepper.get-typography-tokens($theme);
47
46
  @if inspection.get-theme-version($theme) == 1 {
48
- @include token-utils.create-token-values(map.get(m3-stepper.get-tokens($theme), typography));
49
- } @else {
50
- @include sass-utils.current-selector-or-root() {
51
- @include token-utils.create-token-values-mixed(m2-stepper.get-typography-tokens($theme));
52
- }
47
+ $tokens: map.get(m3-stepper.get-tokens($theme), typography);
53
48
  }
49
+
50
+ @include token-utils.values($tokens);
54
51
  }
55
52
 
56
- /// Outputs density theme styles for mat-stepper.
57
- /// @param {Map} $theme The theme to generate density styles for.
58
53
  @mixin density($theme) {
54
+ $tokens: m2-stepper.get-density-tokens($theme);
59
55
  @if inspection.get-theme-version($theme) == 1 {
60
- @include token-utils.create-token-values(map.get(m3-stepper.get-tokens($theme), density));
61
- } @else {
62
- @include sass-utils.current-selector-or-root() {
63
- @include token-utils.create-token-values-mixed(m2-stepper.get-density-tokens($theme));
64
- }
56
+ $tokens: map.get(m3-stepper.get-tokens($theme), density);
65
57
  }
58
+
59
+ @include token-utils.values($tokens);
66
60
  }
67
61
 
68
62
  /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
@@ -85,26 +79,24 @@
85
79
  /// @param {Map} $theme The theme to generate color styles for.
86
80
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
87
81
  @mixin theme($theme, $color-variant: null) {
88
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-stepper') {
89
- @if inspection.get-theme-version($theme) == 1 {
90
- @include base($theme);
91
- @include color($theme, $color-variant);
82
+ @if inspection.get-theme-version($theme) == 1 {
83
+ @include base($theme);
84
+ @include color($theme, $color-variant);
85
+ @include density($theme);
86
+ @include typography($theme);
87
+ @if inspection.theme-has($theme, density) {
92
88
  @include density($theme);
89
+ }
90
+ } @else {
91
+ @include base($theme);
92
+ @if inspection.theme-has($theme, color) {
93
+ @include color($theme);
94
+ }
95
+ @if inspection.theme-has($theme, density) {
96
+ @include density($theme);
97
+ }
98
+ @if inspection.theme-has($theme, typography) {
93
99
  @include typography($theme);
94
- @if inspection.theme-has($theme, density) {
95
- @include density($theme);
96
- }
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
100
  }
109
101
  }
110
102
  }
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use '../core/theming/theming';
3
3
  @use '../core/theming/inspection';
4
+ @use '../core/tokens/m2-utils';
4
5
 
5
6
  // Tokens that can't be configured through Angular Material's current theming API,
6
7
  // but may be in a future version of the theming API.
@@ -12,44 +13,38 @@
12
13
 
13
14
  // Tokens that can be configured through Angular Material's color theming API.
14
15
  @function get-color-tokens($theme) {
15
- @return (
16
- table-background-color: inspection.get-theme-color($theme, system, surface),
16
+ $system: m2-utils.get-system($theme);
17
17
 
18
- table-header-headline-color: inspection.get-theme-color($theme, system, on-surface),
19
- table-row-item-label-text-color: inspection.get-theme-color($theme, system, on-surface),
20
- table-row-item-outline-color: inspection.get-theme-color($theme, system, outline),
18
+ @return (
19
+ table-background-color: map.get($system, surface),
20
+ table-header-headline-color: map.get($system, on-surface),
21
+ table-row-item-label-text-color: map.get($system, on-surface),
22
+ table-row-item-outline-color: map.get($system, outline),
21
23
  );
22
24
  }
23
25
 
24
26
  // Tokens that can be configured through Angular Material's typography theming API.
25
27
  @function get-typography-tokens($theme) {
26
- $cell-font-family: inspection.get-theme-typography($theme, body-2, font-family);
27
- $cell-line-height: inspection.get-theme-typography($theme, body-2, line-height);
28
- $cell-font-size: inspection.get-theme-typography($theme, body-2, font-size);
29
- $cell-font-weight: inspection.get-theme-typography($theme, body-2, font-weight);
30
- $cell-letter-spacing: inspection.get-theme-typography($theme, body-2, letter-spacing);
31
-
28
+ $system: m2-utils.get-system($theme);
32
29
  @return (
33
- table-header-headline-font: inspection.get-theme-typography($theme, subtitle-2, font-family),
34
- table-header-headline-line-height:
35
- inspection.get-theme-typography($theme, subtitle-2, line-height),
36
- table-header-headline-size: inspection.get-theme-typography($theme, subtitle-2, font-size),
37
- table-header-headline-weight: inspection.get-theme-typography($theme, subtitle-2, font-weight),
38
- table-header-headline-tracking:
39
- inspection.get-theme-typography($theme, subtitle-2, letter-spacing),
30
+ table-header-headline-font: map.get($system, label-medium-font),
31
+ table-header-headline-line-height: map.get($system, label-medium-line-height),
32
+ table-header-headline-size: map.get($system, label-medium-size),
33
+ table-header-headline-weight: map.get($system, label-medium-weight),
34
+ table-header-headline-tracking: map.get($system, label-medium-tracking),
40
35
 
41
36
  // Plain cells and footer cells have the same typography.
42
- table-row-item-label-text-font: $cell-font-family,
43
- table-row-item-label-text-line-height: $cell-line-height,
44
- table-row-item-label-text-size: $cell-font-size,
45
- table-row-item-label-text-weight: $cell-font-weight,
46
- table-row-item-label-text-tracking: $cell-letter-spacing,
37
+ table-row-item-label-text-font: map.get($system, body-medium-font),
38
+ table-row-item-label-text-line-height: map.get($system, body-medium-line-height),
39
+ table-row-item-label-text-size: map.get($system, body-medium-size),
40
+ table-row-item-label-text-weight: map.get($system, body-medium-weight),
41
+ table-row-item-label-text-tracking: map.get($system, body-medium-tracking),
47
42
 
48
- table-footer-supporting-text-font: $cell-font-family,
49
- table-footer-supporting-text-line-height: $cell-line-height,
50
- table-footer-supporting-text-size: $cell-font-size,
51
- table-footer-supporting-text-weight: $cell-font-weight,
52
- table-footer-supporting-text-tracking: $cell-letter-spacing,
43
+ table-footer-supporting-text-font: map.get($system, body-medium-font),
44
+ table-footer-supporting-text-line-height: map.get($system, body-medium-line-height),
45
+ table-footer-supporting-text-size: map.get($system, body-medium-size),
46
+ table-footer-supporting-text-weight: map.get($system, body-medium-weight),
47
+ table-footer-supporting-text-tracking: map.get($system, body-medium-tracking),
53
48
  );
54
49
  }
55
50
 
@@ -1,50 +1,44 @@
1
1
  @use 'sass:map';
2
2
  @use './m2-table';
3
3
  @use './m3-table';
4
- @use '../core/theming/theming';
5
4
  @use '../core/theming/inspection';
6
5
  @use '../core/typography/typography';
7
6
  @use '../core/tokens/token-utils';
8
- @use '../core/style/sass-utils';
9
7
 
10
8
  @mixin base($theme) {
9
+ $tokens: m2-table.get-unthemable-tokens();
11
10
  @if inspection.get-theme-version($theme) == 1 {
12
- @include token-utils.create-token-values(map.get(m3-table.get-tokens($theme), base));
13
- } @else {
14
- @include sass-utils.current-selector-or-root() {
15
- @include token-utils.create-token-values-mixed(m2-table.get-unthemable-tokens());
16
- }
11
+ $tokens: map.get(m3-table.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-table.get-color-tokens($theme);
21
19
  @if inspection.get-theme-version($theme) == 1 {
22
- @include token-utils.create-token-values(map.get(m3-table.get-tokens($theme), color));
23
- } @else {
24
- @include sass-utils.current-selector-or-root() {
25
- @include token-utils.create-token-values-mixed(m2-table.get-color-tokens($theme));
26
- }
20
+ $tokens: map.get(m3-table.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-table.get-typography-tokens($theme);
31
28
  @if inspection.get-theme-version($theme) == 1 {
32
- @include token-utils.create-token-values(map.get(m3-table.get-tokens($theme), typography));
33
- } @else {
34
- @include sass-utils.current-selector-or-root() {
35
- @include token-utils.create-token-values-mixed(m2-table.get-typography-tokens($theme));
36
- }
29
+ $tokens: map.get(m3-table.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-table.get-density-tokens($theme);
41
37
  @if inspection.get-theme-version($theme) == 1 {
42
- @include token-utils.create-token-values(map.get(m3-table.get-tokens($theme), density));
43
- } @else {
44
- @include sass-utils.current-selector-or-root() {
45
- @include token-utils.create-token-values-mixed(m2-table.get-density-tokens($theme));
46
- }
38
+ $tokens: map.get(m3-table.get-tokens($theme), density);
47
39
  }
40
+
41
+ @include token-utils.values($tokens);
48
42
  }
49
43
 
50
44
  /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
@@ -62,23 +56,21 @@
62
56
  }
63
57
 
64
58
  @mixin theme($theme) {
65
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-table') {
66
- @if inspection.get-theme-version($theme) == 1 {
67
- @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) {
68
67
  @include color($theme);
68
+ }
69
+ @if inspection.theme-has($theme, density) {
69
70
  @include density($theme);
71
+ }
72
+ @if inspection.theme-has($theme, typography) {
70
73
  @include typography($theme);
71
- } @else {
72
- @include base($theme);
73
- @if inspection.theme-has($theme, color) {
74
- @include color($theme);
75
- }
76
- @if inspection.theme-has($theme, density) {
77
- @include density($theme);
78
- }
79
- @if inspection.theme-has($theme, typography) {
80
- @include typography($theme);
81
- }
82
74
  }
83
75
  }
84
76
  }
@@ -29,22 +29,16 @@
29
29
  @function get-color-tokens($theme, $color-variant, $exclude: ()) {
30
30
  $system: m2-utils.get-system($theme);
31
31
  $system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
32
- $is-dark: inspection.get-theme-type($theme) == dark;
33
- $inactive-label-text-color: inspection.get-theme-color($theme, foreground, base, 0.6);
34
32
 
35
33
  $tokens: (
36
- tab-disabled-ripple-color: inspection.get-theme-color($theme, foreground, disabled),
37
- tab-pagination-icon-color: inspection.get-theme-color($theme, system, on-surface),
38
-
39
- // Note: MDC has equivalents of these tokens, but they lead to much higher selector specificity.
40
- tab-inactive-label-text-color: $inactive-label-text-color,
34
+ tab-disabled-ripple-color: map.get($system, on-surface-variant),
35
+ tab-pagination-icon-color: map.get($system, on-surface),
36
+ tab-inactive-label-text-color: map.get($system, on-surface-variant),
41
37
  tab-active-label-text-color: map.get($system, primary),
42
-
43
- // Tokens needed to implement the gmat styles. Externally they don't change.
44
38
  tab-active-ripple-color: map.get($system, primary),
45
39
  tab-inactive-ripple-color: map.get($system, primary),
46
- tab-inactive-focus-label-text-color: $inactive-label-text-color,
47
- tab-inactive-hover-label-text-color: $inactive-label-text-color,
40
+ tab-inactive-focus-label-text-color: map.get($system, on-surface-variant),
41
+ tab-inactive-hover-label-text-color: map.get($system, on-surface-variant),
48
42
  tab-active-focus-label-text-color: map.get($system, primary),
49
43
  tab-active-hover-label-text-color: map.get($system, primary),
50
44
  tab-active-focus-indicator-color: map.get($system, primary),
@@ -63,13 +57,14 @@
63
57
 
64
58
  // Tokens that can be configured through Angular Material's typography theming API.
65
59
  @function get-typography-tokens($theme) {
60
+ $system: m2-utils.get-system($theme);
66
61
  @return (
67
62
  // Note: MDC has equivalents of these tokens, but they lead to much higher selector specificity.
68
- tab-label-text-font: inspection.get-theme-typography($theme, button, font-family),
69
- tab-label-text-size: inspection.get-theme-typography($theme, button, font-size),
70
- tab-label-text-tracking: inspection.get-theme-typography($theme, button, letter-spacing),
71
- tab-label-text-line-height: inspection.get-theme-typography($theme, button, line-height),
72
- tab-label-text-weight: inspection.get-theme-typography($theme, button, font-weight),
63
+ tab-label-text-font: map.get($system, label-small-font),
64
+ tab-label-text-size: map.get($system, label-small-size),
65
+ tab-label-text-tracking: map.get($system, label-small-tracking),
66
+ tab-label-text-line-height: map.get($system, label-small-line-height),
67
+ tab-label-text-weight: map.get($system, label-small-weight),
73
68
  );
74
69
  }
75
70