@angular/material 20.1.0-next.2 → 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 (213) hide show
  1. package/autocomplete/_autocomplete-theme.scss +4 -4
  2. package/autocomplete/_m2-autocomplete.scss +10 -22
  3. package/badge/_badge-theme.scss +4 -4
  4. package/badge/_m2-badge.scss +49 -63
  5. package/bottom-sheet/_bottom-sheet-theme.scss +4 -4
  6. package/bottom-sheet/_m2-bottom-sheet.scss +16 -30
  7. package/button/_button-theme.scss +4 -4
  8. package/button/_fab-theme.scss +4 -4
  9. package/button/_icon-button-theme.scss +10 -8
  10. package/button/_m2-button.scss +135 -154
  11. package/button/_m2-fab.scss +60 -69
  12. package/button/_m2-icon-button.scss +30 -50
  13. package/button/_m3-button.scss +1 -2
  14. package/button/_m3-fab.scss +1 -2
  15. package/button/_m3-icon-button.scss +1 -2
  16. package/button-toggle/_button-toggle-theme.scss +4 -4
  17. package/button-toggle/_m2-button-toggle.scss +58 -75
  18. package/button-toggle/_m3-button-toggle.scss +1 -2
  19. package/card/_card-theme.scss +4 -4
  20. package/card/_m2-card.scss +30 -43
  21. package/checkbox/_checkbox-theme.scss +10 -8
  22. package/checkbox/_m2-checkbox.scss +30 -41
  23. package/checkbox/_m3-checkbox.scss +1 -2
  24. package/chips/_chips-theme.scss +10 -7
  25. package/chips/_m2-chip.scss +40 -54
  26. package/chips/_m3-chip.scss +1 -2
  27. package/core/_core-theme.scss +4 -4
  28. package/core/_m2-app.scss +11 -23
  29. package/core/m2/_theming.scss +8 -4
  30. package/core/option/_m2-optgroup.scss +13 -25
  31. package/core/option/_m2-option.scss +16 -23
  32. package/core/option/_optgroup-theme.scss +4 -4
  33. package/core/option/_option-theme.scss +6 -6
  34. package/core/ripple/_m2-ripple.scss +8 -20
  35. package/core/ripple/_ripple-theme.scss +4 -4
  36. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +14 -21
  37. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +8 -8
  38. package/core/theming/_definition.scss +3 -1
  39. package/core/tokens/_m2-utils.scss +14 -6
  40. package/core/tokens/m3/_theme.scss +1 -1
  41. package/datepicker/_datepicker-theme.scss +6 -6
  42. package/datepicker/_m2-datepicker.scss +26 -33
  43. package/dialog/_dialog-theme.scss +4 -4
  44. package/dialog/_m2-dialog.scss +34 -46
  45. package/divider/_divider-theme.scss +4 -4
  46. package/divider/_m2-divider.scss +10 -21
  47. package/expansion/_expansion-theme.scss +4 -4
  48. package/expansion/_m2-expansion.scss +51 -67
  49. package/expansion/_m3-expansion.scss +1 -2
  50. package/fesm2022/animation-DfMFjxHu.mjs.map +1 -1
  51. package/fesm2022/autocomplete/testing.mjs.map +1 -1
  52. package/fesm2022/autocomplete.mjs.map +1 -1
  53. package/fesm2022/badge/testing.mjs.map +1 -1
  54. package/fesm2022/badge.mjs.map +1 -1
  55. package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
  56. package/fesm2022/bottom-sheet.mjs.map +1 -1
  57. package/fesm2022/button/testing.mjs.map +1 -1
  58. package/fesm2022/button-toggle/testing.mjs.map +1 -1
  59. package/fesm2022/button-toggle.mjs.map +1 -1
  60. package/fesm2022/button.mjs.map +1 -1
  61. package/fesm2022/card/testing.mjs.map +1 -1
  62. package/fesm2022/card.mjs.map +1 -1
  63. package/fesm2022/checkbox/testing.mjs.map +1 -1
  64. package/fesm2022/checkbox.mjs.map +1 -1
  65. package/fesm2022/chips/testing.mjs.map +1 -1
  66. package/fesm2022/chips.mjs.map +1 -1
  67. package/fesm2022/common-module-cKSwHniA.mjs.map +1 -1
  68. package/fesm2022/core/testing.mjs.map +1 -1
  69. package/fesm2022/core.mjs +1 -1
  70. package/fesm2022/core.mjs.map +1 -1
  71. package/fesm2022/date-formats-K6TQue-Y.mjs.map +1 -1
  72. package/fesm2022/date-range-input-harness-DEyfkeOs.mjs.map +1 -1
  73. package/fesm2022/datepicker/testing.mjs.map +1 -1
  74. package/fesm2022/datepicker.mjs.map +1 -1
  75. package/fesm2022/dialog/testing.mjs.map +1 -1
  76. package/fesm2022/dialog.mjs.map +1 -1
  77. package/fesm2022/divider/testing.mjs.map +1 -1
  78. package/fesm2022/divider.mjs.map +1 -1
  79. package/fesm2022/error-options-DCNQlTOA.mjs.map +1 -1
  80. package/fesm2022/error-state-Dtb1IHM-.mjs.map +1 -1
  81. package/fesm2022/expansion/testing.mjs.map +1 -1
  82. package/fesm2022/expansion.mjs.map +1 -1
  83. package/fesm2022/form-field/testing/control.mjs.map +1 -1
  84. package/fesm2022/form-field/testing.mjs.map +1 -1
  85. package/fesm2022/form-field-CFbrnFED.mjs.map +1 -1
  86. package/fesm2022/form-field.mjs.map +1 -1
  87. package/fesm2022/grid-list/testing.mjs.map +1 -1
  88. package/fesm2022/grid-list.mjs.map +1 -1
  89. package/fesm2022/icon/testing.mjs.map +1 -1
  90. package/fesm2022/icon-button-DxiIc1ex.mjs.map +1 -1
  91. package/fesm2022/icon-registry-CwOTJ7YM.mjs.map +1 -1
  92. package/fesm2022/icon.mjs.map +1 -1
  93. package/fesm2022/index-BFRo2fUq.mjs.map +1 -1
  94. package/fesm2022/index-DwiL-HGk.mjs.map +1 -1
  95. package/fesm2022/input/testing.mjs.map +1 -1
  96. package/fesm2022/input-harness-C5Msdc4-.mjs.map +1 -1
  97. package/fesm2022/input-value-accessor-D1GvPuqO.mjs.map +1 -1
  98. package/fesm2022/input.mjs.map +1 -1
  99. package/fesm2022/internal-form-field-D5iFxU6d.mjs.map +1 -1
  100. package/fesm2022/line-Bz5f9Cyx.mjs.map +1 -1
  101. package/fesm2022/list/testing.mjs.map +1 -1
  102. package/fesm2022/list.mjs.map +1 -1
  103. package/fesm2022/material.mjs.map +1 -1
  104. package/fesm2022/menu/testing.mjs.map +1 -1
  105. package/fesm2022/menu.mjs.map +1 -1
  106. package/fesm2022/module-B0CLRw5e.mjs.map +1 -1
  107. package/fesm2022/module-B62K-792.mjs.map +1 -1
  108. package/fesm2022/module-CWxMD37a.mjs.map +1 -1
  109. package/fesm2022/module-Ce6F7TNm.mjs.map +1 -1
  110. package/fesm2022/option-BzhYL_xC.mjs.map +1 -1
  111. package/fesm2022/option-harness-BFcc-M_4.mjs.map +1 -1
  112. package/fesm2022/paginator/testing.mjs.map +1 -1
  113. package/fesm2022/paginator.mjs.map +1 -1
  114. package/fesm2022/progress-bar/testing.mjs.map +1 -1
  115. package/fesm2022/progress-bar.mjs.map +1 -1
  116. package/fesm2022/progress-spinner/testing.mjs.map +1 -1
  117. package/fesm2022/progress-spinner.mjs.map +1 -1
  118. package/fesm2022/pseudo-checkbox-DDmgx3P4.mjs.map +1 -1
  119. package/fesm2022/pseudo-checkbox-module-4F8Up4PL.mjs.map +1 -1
  120. package/fesm2022/public-api-BoO5eSq-.mjs.map +1 -1
  121. package/fesm2022/radio/testing.mjs.map +1 -1
  122. package/fesm2022/radio.mjs.map +1 -1
  123. package/fesm2022/ripple-BYgV4oZC.mjs.map +1 -1
  124. package/fesm2022/ripple-loader-BnMiRtmT.mjs.map +1 -1
  125. package/fesm2022/select/testing.mjs.map +1 -1
  126. package/fesm2022/select.mjs.map +1 -1
  127. package/fesm2022/sidenav/testing.mjs.map +1 -1
  128. package/fesm2022/sidenav.mjs +2 -4
  129. package/fesm2022/sidenav.mjs.map +1 -1
  130. package/fesm2022/slide-toggle/testing.mjs.map +1 -1
  131. package/fesm2022/slide-toggle.mjs.map +1 -1
  132. package/fesm2022/slider/testing.mjs.map +1 -1
  133. package/fesm2022/slider.mjs.map +1 -1
  134. package/fesm2022/snack-bar/testing.mjs.map +1 -1
  135. package/fesm2022/snack-bar.mjs.map +1 -1
  136. package/fesm2022/sort/testing.mjs.map +1 -1
  137. package/fesm2022/sort.mjs.map +1 -1
  138. package/fesm2022/stepper/testing.mjs.map +1 -1
  139. package/fesm2022/stepper.mjs.map +1 -1
  140. package/fesm2022/structural-styles-CObeNzjn.mjs.map +1 -1
  141. package/fesm2022/table/testing.mjs.map +1 -1
  142. package/fesm2022/table.mjs.map +1 -1
  143. package/fesm2022/tabs/testing.mjs.map +1 -1
  144. package/fesm2022/tabs.mjs.map +1 -1
  145. package/fesm2022/timepicker/testing.mjs.map +1 -1
  146. package/fesm2022/timepicker.mjs.map +1 -1
  147. package/fesm2022/toolbar/testing.mjs.map +1 -1
  148. package/fesm2022/toolbar.mjs.map +1 -1
  149. package/fesm2022/tooltip/testing.mjs.map +1 -1
  150. package/fesm2022/tooltip.mjs.map +1 -1
  151. package/fesm2022/tree/testing.mjs.map +1 -1
  152. package/fesm2022/tree.mjs.map +1 -1
  153. package/form-field/_form-field-theme.scss +4 -4
  154. package/form-field/_m2-form-field.scss +125 -138
  155. package/form-field/_m3-form-field.scss +1 -2
  156. package/grid-list/_grid-list-theme.scss +4 -4
  157. package/grid-list/_m2-grid-list.scss +14 -25
  158. package/icon/_icon-theme.scss +4 -4
  159. package/icon/_m2-icon.scss +7 -21
  160. package/list/_list-theme.scss +14 -12
  161. package/list/_m2-list.scss +84 -98
  162. package/list/_m3-list.scss +1 -2
  163. package/menu/_m2-menu.scss +33 -46
  164. package/menu/_menu-theme.scss +4 -4
  165. package/package.json +2 -2
  166. package/paginator/_m2-paginator.scss +38 -57
  167. package/paginator/_m3-paginator.scss +1 -2
  168. package/paginator/_paginator-theme.scss +4 -4
  169. package/prebuilt-themes/deeppurple-amber.css +1 -1
  170. package/prebuilt-themes/indigo-pink.css +1 -1
  171. package/prebuilt-themes/pink-bluegrey.css +1 -1
  172. package/prebuilt-themes/purple-green.css +1 -1
  173. package/progress-bar/_m2-progress-bar.scss +11 -24
  174. package/progress-bar/_progress-bar-theme.scss +6 -6
  175. package/progress-spinner/_m2-progress-spinner.scss +9 -20
  176. package/progress-spinner/_progress-spinner-theme.scss +6 -6
  177. package/radio/_m2-radio.scss +30 -41
  178. package/radio/_m3-radio.scss +1 -2
  179. package/radio/_radio-theme.scss +6 -6
  180. package/schematics/ng-add/index.js +1 -1
  181. package/schematics/ng-generate/theme-color/schema.json +1 -1
  182. package/select/_m2-select.scss +23 -31
  183. package/select/_m3-select.scss +1 -2
  184. package/select/_select-theme.scss +6 -6
  185. package/sidenav/_m2-sidenav.scss +26 -36
  186. package/sidenav/_sidenav-theme.scss +4 -4
  187. package/slide-toggle/_m2-slide-toggle.scss +94 -113
  188. package/slide-toggle/_slide-toggle-theme.scss +6 -6
  189. package/slider/_m2-slider.scss +34 -52
  190. package/slider/_slider-theme.scss +4 -4
  191. package/snack-bar/_m2-snack-bar.scss +16 -36
  192. package/snack-bar/_snack-bar-theme.scss +4 -4
  193. package/sort/_m2-sort.scss +7 -18
  194. package/sort/_sort-theme.scss +4 -4
  195. package/stepper/_m2-stepper.scss +39 -54
  196. package/stepper/_m3-stepper.scss +1 -2
  197. package/stepper/_stepper-theme.scss +4 -4
  198. package/table/_m2-table.scss +54 -65
  199. package/table/_m3-table.scss +1 -2
  200. package/table/_table-theme.scss +4 -4
  201. package/tabs/_m2-tabs.scss +31 -47
  202. package/tabs/_m3-tabs.scss +1 -2
  203. package/tabs/_tabs-theme.scss +9 -9
  204. package/timepicker/_m2-timepicker.scss +10 -22
  205. package/timepicker/_timepicker-theme.scss +4 -4
  206. package/toolbar/_m2-toolbar.scss +26 -45
  207. package/toolbar/_m3-toolbar.scss +1 -2
  208. package/toolbar/_toolbar-theme.scss +4 -4
  209. package/tooltip/_m2-tooltip.scss +16 -33
  210. package/tooltip/_tooltip-theme.scss +4 -4
  211. package/tree/_m2-tree.scss +21 -39
  212. package/tree/_m3-tree.scss +1 -2
  213. package/tree/_tree-theme.scss +4 -4
@@ -14,7 +14,7 @@
14
14
  @use 'sass:map';
15
15
 
16
16
  @mixin base($theme) {
17
- $tokens: m2-app.get-unthemable-tokens();
17
+ $tokens: map.get(m2-app.get-tokens($theme), base);
18
18
  @if inspection.get-theme-version($theme) == 1 {
19
19
  $tokens: map.get(m3-app.get-tokens($theme), base);
20
20
  }
@@ -28,7 +28,7 @@
28
28
  }
29
29
 
30
30
  @mixin color($theme) {
31
- $tokens: m2-app.get-color-tokens($theme);
31
+ $tokens: map.get(m2-app.get-tokens($theme), color);
32
32
  @if inspection.get-theme-version($theme) == 1 {
33
33
  $tokens: map.get(m3-app.get-tokens($theme), color);
34
34
  }
@@ -42,7 +42,7 @@
42
42
  }
43
43
 
44
44
  @mixin typography($theme) {
45
- $tokens: m2-app.get-typography-tokens($theme);
45
+ $tokens: map.get(m2-app.get-tokens($theme), typography);
46
46
  @if inspection.get-theme-version($theme) == 1 {
47
47
  $tokens: map.get(m3-app.get-tokens($theme), typography);
48
48
  }
@@ -56,7 +56,7 @@
56
56
  }
57
57
 
58
58
  @mixin density($theme) {
59
- $tokens: m2-app.get-density-tokens($theme);
59
+ $tokens: map.get(m2-app.get-tokens($theme), density);
60
60
  @if inspection.get-theme-version($theme) == 1 {
61
61
  $tokens: map.get(m3-app.get-tokens($theme), density);
62
62
  }
package/core/_m2-app.scss CHANGED
@@ -2,35 +2,23 @@
2
2
  @use './style/elevation';
3
3
  @use '../core/tokens/m2-utils';
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
- }
10
-
11
- // Tokens that can be configured through Angular Material's color theming API.
12
- @function get-color-tokens($theme) {
5
+ @function get-tokens($theme) {
13
6
  $system: m2-utils.get-system($theme);
14
7
 
15
- $tokens: (
8
+ $color-tokens: (
16
9
  app-background-color: map.get($system, background),
17
- app-text-color: map.get($system, on-surface),
10
+ app-text-color: map.get($system, on-surface)
18
11
  );
19
-
20
12
  @for $zValue from 0 through 24 {
21
- $shadow: elevation.get-box-shadow($zValue, map.get($system, shadow));
22
- $tokens: map.set($tokens, 'app-elevation-shadow-level-#{$zValue}', $shadow);
13
+ $color-tokens: map.set($color-tokens, 'app-elevation-shadow-level-#{$zValue}',
14
+ elevation.get-box-shadow($zValue, map.get($system, shadow)));
23
15
  }
24
16
 
25
- @return $tokens;
26
- }
27
-
28
- // Tokens that can be configured through Angular Material's typography theming API.
29
- @function get-typography-tokens($theme) {
30
- @return ();
17
+ @return (
18
+ base: (),
19
+ color: $color-tokens,
20
+ typography: (),
21
+ density: (),
22
+ );
31
23
  }
32
24
 
33
- // Tokens that can be configured through Angular Material's density theming API.
34
- @function get-density-tokens($theme) {
35
- @return ();
36
- }
@@ -114,7 +114,7 @@
114
114
  @return $theme;
115
115
  }
116
116
 
117
- @function _define-system($primary, $accent, $warn, $is-dark, $typography) {
117
+ @function _define-system($primary, $accent, $warn, $is-dark, $typography, $density-scale) {
118
118
  $palettes: (
119
119
  primary: $primary,
120
120
  accent: $accent,
@@ -128,7 +128,7 @@
128
128
  $sys-state: m2.md-sys-state-values();
129
129
  $sys-typography: m2.md-sys-typescale-values($typography);
130
130
 
131
- $system: ();
131
+ $system: (density-scale: $density-scale);
132
132
  @each $map in ($sys-color, $sys-state, $sys-typography) {
133
133
  $system: map.merge($system, $map);
134
134
  }
@@ -188,7 +188,9 @@
188
188
  $accent: $accent,
189
189
  $warn: $warn,
190
190
  $is-dark: $is-dark,
191
- $typography: ());
191
+ $typography: (),
192
+ $density-scale: 0
193
+ );
192
194
  $theme: map.set($theme, _mat-system, $system);
193
195
  @return $theme;
194
196
  }
@@ -216,7 +218,9 @@
216
218
  $accent: map.get($result, accent) or map.get($result, color, accent) or (),
217
219
  $warn: map.get($result, warn) or map.get($result, color, warn) or (),
218
220
  $is-dark: $is-dark,
219
- $typography: map.get($result, typography) or ());
221
+ $typography: map.get($result, typography) or (),
222
+ $density-scale: map.get($result, density),
223
+ );
220
224
  $theme: map.set($theme, _mat-system, $system);
221
225
  @return $theme;
222
226
  }
@@ -1,33 +1,21 @@
1
1
  @use '../tokens/m2-utils';
2
2
  @use 'sass:map';
3
3
 
4
- // Tokens that can't be configured through Angular Material's current theming API,
5
- // but may be in a future version of the theming API.
6
- @function get-unthemable-tokens() {
7
- @return ();
8
- }
9
-
10
- // Tokens that can be configured through Angular Material's color theming API.
11
- @function get-color-tokens($theme) {
4
+ @function get-tokens($theme) {
12
5
  $system: m2-utils.get-system($theme);
13
- @return (
14
- optgroup-label-text-color: map.get($system, on-surface),
15
- );
16
- }
17
6
 
18
- // Tokens that can be configured through Angular Material's typography theming API.
19
- @function get-typography-tokens($theme) {
20
- $system: m2-utils.get-system($theme);
21
7
  @return (
22
- optgroup-label-text-font: map.get($system, body-large-font),
23
- optgroup-label-text-line-height: map.get($system, body-large-line-height),
24
- optgroup-label-text-size: map.get($system, body-large-size),
25
- optgroup-label-text-tracking: map.get($system, body-large-tracking),
26
- optgroup-label-text-weight: map.get($system, body-large-weight)
8
+ base: (),
9
+ color: (
10
+ optgroup-label-text-color: map.get($system, on-surface),
11
+ ),
12
+ typography: (
13
+ optgroup-label-text-font: map.get($system, body-large-font),
14
+ optgroup-label-text-line-height: map.get($system, body-large-line-height),
15
+ optgroup-label-text-size: map.get($system, body-large-size),
16
+ optgroup-label-text-tracking: map.get($system, body-large-tracking),
17
+ optgroup-label-text-weight: map.get($system, body-large-weight)
18
+ ),
19
+ density: (),
27
20
  );
28
21
  }
29
-
30
- // Tokens that can be configured through Angular Material's density theming API.
31
- @function get-density-tokens($theme) {
32
- @return ();
33
- }
@@ -1,17 +1,26 @@
1
- @use '../theming/inspection';
2
1
  @use 'sass:map';
3
2
  @use '../tokens/m2-utils';
4
3
  @use '../tokens/m3-utils';
5
4
 
6
- // Tokens that can't be configured through Angular Material's current theming API,
7
- // but may be in a future version of the theming API.
8
- @function get-unthemable-tokens() {
9
- @return ();
5
+ @function get-tokens($theme) {
6
+ $system: m2-utils.get-system($theme);
7
+
8
+ @return (
9
+ base: (),
10
+ color: private-get-color-palette-color-tokens($theme, primary),
11
+ typography: (
12
+ option-label-text-font: map.get($system, body-large-font),
13
+ option-label-text-line-height: map.get($system, body-large-line-height),
14
+ option-label-text-size: map.get($system, body-large-size),
15
+ option-label-text-tracking: map.get($system, body-large-tracking),
16
+ option-label-text-weight: map.get($system, body-large-weight)
17
+ ),
18
+ density: (),
19
+ );
10
20
  }
11
21
 
12
22
  // Tokens that can be configured through Angular Material's color theming API.
13
- @function get-color-tokens($theme, $color-variant) {
14
- $is-dark: inspection.get-theme-type($theme) == dark;
23
+ @function private-get-color-palette-color-tokens($theme, $color-variant) {
15
24
  $system: m2-utils.get-system($theme);
16
25
  $system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
17
26
 
@@ -27,19 +36,3 @@
27
36
  );
28
37
  }
29
38
 
30
- // Tokens that can be configured through Angular Material's typography theming API.
31
- @function get-typography-tokens($theme) {
32
- $system: m2-utils.get-system($theme);
33
- @return (
34
- option-label-text-font: map.get($system, body-large-font),
35
- option-label-text-line-height: map.get($system, body-large-line-height),
36
- option-label-text-size: map.get($system, body-large-size),
37
- option-label-text-tracking: map.get($system, body-large-tracking),
38
- option-label-text-weight: map.get($system, body-large-weight)
39
- );
40
- }
41
-
42
- // Tokens that can be configured through Angular Material's density theming API.
43
- @function get-density-tokens($theme) {
44
- @return ();
45
- }
@@ -6,7 +6,7 @@
6
6
  @use '../typography/typography';
7
7
 
8
8
  @mixin base($theme) {
9
- $tokens: m2-optgroup.get-unthemable-tokens();
9
+ $tokens: map.get(m2-optgroup.get-tokens($theme), base);
10
10
  @if inspection.get-theme-version($theme) == 1 {
11
11
  $tokens: map.get(m3-optgroup.get-tokens($theme), base);
12
12
  }
@@ -15,7 +15,7 @@
15
15
  }
16
16
 
17
17
  @mixin color($theme) {
18
- $tokens: m2-optgroup.get-color-tokens($theme);
18
+ $tokens: map.get(m2-optgroup.get-tokens($theme), color);
19
19
  @if inspection.get-theme-version($theme) == 1 {
20
20
  $tokens: map.get(m3-optgroup.get-tokens($theme), color);
21
21
  }
@@ -24,7 +24,7 @@
24
24
  }
25
25
 
26
26
  @mixin typography($theme) {
27
- $tokens: m2-optgroup.get-typography-tokens($theme);
27
+ $tokens: map.get(m2-optgroup.get-tokens($theme), typography);
28
28
  @if inspection.get-theme-version($theme) == 1 {
29
29
  $tokens: map.get(m3-optgroup.get-tokens($theme), typography);
30
30
  }
@@ -33,7 +33,7 @@
33
33
  }
34
34
 
35
35
  @mixin density($theme) {
36
- $tokens: m2-optgroup.get-density-tokens($theme);
36
+ $tokens: map.get(m2-optgroup.get-tokens($theme), density);
37
37
  @if inspection.get-theme-version($theme) == 1 {
38
38
  $tokens: map.get(m3-optgroup.get-tokens($theme), density);
39
39
  }
@@ -9,7 +9,7 @@
9
9
  /// for the mat-option.
10
10
  /// @param {Map} $theme The theme to generate base styles for.
11
11
  @mixin base($theme) {
12
- $tokens: m2-option.get-unthemable-tokens();
12
+ $tokens: map.get(m2-option.get-tokens($theme), base);
13
13
  @if inspection.get-theme-version($theme) == 1 {
14
14
  $tokens: map.get(m3-option.get-tokens($theme), base);
15
15
  }
@@ -21,7 +21,7 @@
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-option.get-color-tokens($theme, primary);
24
+ $tokens: map.get(m2-option.get-tokens($theme), color);
25
25
  @if inspection.get-theme-version($theme) == 1 {
26
26
  $tokens: map.get(m3-option.get-tokens($theme, $color-variant), color);
27
27
  }
@@ -30,12 +30,12 @@
30
30
 
31
31
  @if inspection.get-theme-version($theme) != 1 {
32
32
  .mat-accent {
33
- $tokens: m2-option.get-color-tokens($theme, secondary);
33
+ $tokens: m2-option.private-get-color-palette-color-tokens($theme, secondary);
34
34
  @include token-utils.values($tokens);
35
35
  }
36
36
 
37
37
  .mat-warn {
38
- $tokens: m2-option.get-color-tokens($theme, error);
38
+ $tokens: m2-option.private-get-color-palette-color-tokens($theme, error);
39
39
  @include token-utils.values($tokens);
40
40
  }
41
41
  }
@@ -44,7 +44,7 @@
44
44
  /// Outputs typography theme styles for the mat-option.
45
45
  /// @param {Map} $theme The theme to generate typography styles for.
46
46
  @mixin typography($theme) {
47
- $tokens: m2-option.get-typography-tokens($theme);
47
+ $tokens: map.get(m2-option.get-tokens($theme), typography);
48
48
  @if inspection.get-theme-version($theme) == 1 {
49
49
  $tokens: map.get(m3-option.get-tokens($theme), typography);
50
50
  }
@@ -55,7 +55,7 @@
55
55
  /// Outputs density theme styles for the mat-option.
56
56
  /// @param {Map} $theme The theme to generate density styles for.
57
57
  @mixin density($theme) {
58
- $tokens: m2-option.get-density-tokens($theme);
58
+ $tokens: map.get(m2-option.get-tokens($theme), density);
59
59
  @if inspection.get-theme-version($theme) == 1 {
60
60
  $tokens: map.get(m3-option.get-tokens($theme), density);
61
61
  }
@@ -2,28 +2,16 @@
2
2
  @use '../tokens/m2-utils';
3
3
  @use '../tokens/m3-utils';
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
- }
10
-
11
- // Tokens that can be configured through Angular Material's color theming API.
12
- @function get-color-tokens($theme) {
5
+ @function get-tokens($theme) {
13
6
  $system: m2-utils.get-system($theme);
14
7
 
15
8
  @return (
16
- ripple-color: m3-utils.color-with-opacity(
17
- map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
9
+ base: (),
10
+ color: (
11
+ ripple-color: m3-utils.color-with-opacity(
12
+ map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
13
+ ),
14
+ typography: (),
15
+ density: (),
18
16
  );
19
17
  }
20
-
21
- // Tokens that can be configured through Angular Material's typography theming API.
22
- @function get-typography-tokens($theme) {
23
- @return ();
24
- }
25
-
26
- // Tokens that can be configured through Angular Material's density theming API.
27
- @function get-density-tokens($theme) {
28
- @return ();
29
- }
@@ -5,7 +5,7 @@
5
5
  @use '../theming/inspection';
6
6
 
7
7
  @mixin base($theme) {
8
- $tokens: m2-ripple.get-unthemable-tokens();
8
+ $tokens: map.get(m2-ripple.get-tokens($theme), base);
9
9
  @if inspection.get-theme-version($theme) == 1 {
10
10
  $tokens: map.get(m3-ripple.get-tokens($theme), base);
11
11
  }
@@ -14,7 +14,7 @@
14
14
  }
15
15
 
16
16
  @mixin color($theme) {
17
- $tokens: m2-ripple.get-color-tokens($theme);
17
+ $tokens: map.get(m2-ripple.get-tokens($theme), color);
18
18
  @if inspection.get-theme-version($theme) == 1 {
19
19
  $tokens: map.get(m3-ripple.get-tokens($theme), color);
20
20
  }
@@ -23,7 +23,7 @@
23
23
  }
24
24
 
25
25
  @mixin typography($theme) {
26
- $tokens: m2-ripple.get-typography-tokens($theme);
26
+ $tokens: map.get(m2-ripple.get-tokens($theme), typography);
27
27
  @if inspection.get-theme-version($theme) == 1 {
28
28
  $tokens: map.get(m3-ripple.get-tokens($theme), typography);
29
29
  }
@@ -32,7 +32,7 @@
32
32
  }
33
33
 
34
34
  @mixin density($theme) {
35
- $tokens: m2-ripple.get-density-tokens($theme);
35
+ $tokens: map.get(m2-ripple.get-tokens($theme), density);
36
36
  @if inspection.get-theme-version($theme) == 1 {
37
37
  $tokens: map.get(m3-ripple.get-tokens($theme), density);
38
38
  }
@@ -1,18 +1,18 @@
1
- @use '../../theming/inspection';
2
1
  @use 'sass:map';
3
2
  @use '../../tokens/m2-utils';
4
3
  @use '../../tokens/m3-utils';
5
4
 
6
- // Tokens that can't be configured through Angular Material's current theming API,
7
- // but may be in a future version of the theming API.
8
- @function get-unthemable-tokens() {
9
- @return ();
5
+ @function get-tokens($theme) {
6
+ @return (
7
+ base: (),
8
+ color: private-get-color-palette-color-tokens($theme, secondary),
9
+ typography: (),
10
+ density: (),
11
+ );
10
12
  }
11
13
 
12
14
  // Tokens that can be configured through Angular Material's color theming API.
13
- @function get-color-tokens($theme, $color-variant) {
14
- $is-dark: inspection.get-theme-type($theme) == dark;
15
- $disabled-color: if($is-dark, #686868, #b0b0b0);
15
+ @function private-get-color-palette-color-tokens($theme, $color-variant) {
16
16
  $system: m2-utils.get-system($theme);
17
17
  $system: m3-utils.replace-colors-with-variant($system, secondary, $color-variant);
18
18
 
@@ -21,19 +21,12 @@
21
21
  pseudo-checkbox-full-selected-checkmark-color: map.get($system, background),
22
22
  pseudo-checkbox-full-unselected-icon-color: map.get($system, on-surface-variant),
23
23
  pseudo-checkbox-full-disabled-selected-checkmark-color: map.get($system, background),
24
- pseudo-checkbox-full-disabled-unselected-icon-color: $disabled-color,
25
- pseudo-checkbox-full-disabled-selected-icon-color: $disabled-color,
24
+ pseudo-checkbox-full-disabled-unselected-icon-color:
25
+ m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
26
+ pseudo-checkbox-full-disabled-selected-icon-color:
27
+ m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
26
28
  pseudo-checkbox-minimal-selected-checkmark-color: map.get($system, secondary),
27
- pseudo-checkbox-minimal-disabled-selected-checkmark-color: if($is-dark, #686868, #b0b0b0),
29
+ pseudo-checkbox-minimal-disabled-selected-checkmark-color:
30
+ m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
28
31
  );
29
32
  }
30
-
31
- // Tokens that can be configured through Angular Material's typography theming API.
32
- @function get-typography-tokens($theme) {
33
- @return ();
34
- }
35
-
36
- // Tokens that can be configured through Angular Material's density theming API.
37
- @function get-density-tokens($theme) {
38
- @return ();
39
- }
@@ -5,12 +5,12 @@
5
5
  @use 'sass:map';
6
6
 
7
7
  @mixin _palette-styles($theme, $palette-name) {
8
- $tokens: m2-pseudo-checkbox.get-color-tokens($theme, $palette-name);
8
+ $tokens: map.get(m2-pseudo-checkbox.get-tokens($theme), color);
9
9
  @include token-utils.values($tokens);
10
10
  }
11
11
 
12
12
  @mixin base($theme) {
13
- $tokens: m2-pseudo-checkbox.get-unthemable-tokens();
13
+ $tokens: map.get(m2-pseudo-checkbox.get-tokens($theme), base);
14
14
  @if inspection.get-theme-version($theme) == 1 {
15
15
  $tokens: map.get(m3-pseudo-checkbox.get-tokens($theme), base);
16
16
  }
@@ -28,7 +28,7 @@
28
28
  /// @param {Map} $theme The theme to generate color styles for.
29
29
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
30
30
  @mixin color($theme, $color-variant: null) {
31
- $tokens: m2-pseudo-checkbox.get-color-tokens($theme, secondary);
31
+ $tokens: map.get(m2-pseudo-checkbox.get-tokens($theme), color);
32
32
  @if inspection.get-theme-version($theme) == 1 {
33
33
  $tokens: map.get(m3-pseudo-checkbox.get-tokens($theme, $color-variant), color);
34
34
  }
@@ -42,24 +42,24 @@
42
42
  // in order to allow for the color to be overwritten if the checkbox is inside a parent that
43
43
  // has `mat-accent` and is placed inside another parent that has `mat-primary`.
44
44
  .mat-primary {
45
- $tokens: m2-pseudo-checkbox.get-color-tokens($theme, primary);
45
+ $tokens: m2-pseudo-checkbox.private-get-color-palette-color-tokens($theme, primary);
46
46
  @include token-utils.values($tokens);
47
47
  }
48
48
 
49
49
  .mat-accent {
50
- $tokens: m2-pseudo-checkbox.get-color-tokens($theme, secondary);
50
+ $tokens: m2-pseudo-checkbox.private-get-color-palette-color-tokens($theme, secondary);
51
51
  @include token-utils.values($tokens);
52
52
  }
53
53
 
54
54
  .mat-warn {
55
- $tokens: m2-pseudo-checkbox.get-color-tokens($theme, error);
55
+ $tokens: m2-pseudo-checkbox.private-get-color-palette-color-tokens($theme, error);
56
56
  @include token-utils.values($tokens);
57
57
  }
58
58
  }
59
59
  }
60
60
 
61
61
  @mixin typography($theme) {
62
- $tokens: m2-pseudo-checkbox.get-typography-tokens($theme);
62
+ $tokens: map.get(m2-pseudo-checkbox.get-tokens($theme), typography);
63
63
  @if inspection.get-theme-version($theme) == 1 {
64
64
  $tokens: map.get(m3-pseudo-checkbox.get-tokens($theme), typography);
65
65
  }
@@ -68,7 +68,7 @@
68
68
  }
69
69
 
70
70
  @mixin density($theme) {
71
- $tokens: m2-pseudo-checkbox.get-density-tokens($theme);
71
+ $tokens: map.get(m2-pseudo-checkbox.get-tokens($theme), density);
72
72
  @if inspection.get-theme-version($theme) == 1 {
73
73
  $tokens: map.get(m3-pseudo-checkbox.get-tokens($theme), density);
74
74
  }
@@ -90,7 +90,9 @@ $theme-version: 1;
90
90
  ),
91
91
  m3-tokens.get-sys-typeface($typography, $typography-system-variables-prefix),
92
92
  );
93
- $system: ();
93
+ $system: (
94
+ density-scale: $density-scale,
95
+ );
94
96
  @each $sys-map in $system-maps {
95
97
  $system: map.merge($system, $sys-map);
96
98
  }
@@ -1,16 +1,24 @@
1
1
  @use 'sass:map';
2
+ @use 'sass:meta';
2
3
  @use './m2';
3
4
 
4
5
  // Gets the theme's system values as a flat map.
5
6
  @function get-system($theme) {
6
- $system: map.get($theme, _mat-system);
7
- @if $system {
8
- @return $system;
7
+ @if meta.type-of($theme) == map {
8
+ $system: map.get($theme, _mat-system);
9
+ @if $system {
10
+ @return $system;
11
+ }
12
+
13
+ // If the $theme is a typography-config, convert it to a system map.
14
+ @if map.has-key($theme, body-1) {
15
+ @return m2.md-sys-typescale-values($theme);
16
+ }
9
17
  }
10
18
 
11
- // If the $theme is a typography-config, convert it to a system map.
12
- @if map.has-key($theme, body-1) {
13
- @return m2.md-sys-typescale-values($theme);
19
+ // If the $theme is a density scale, convert it to a system map.
20
+ @if meta.type-of($theme) == 'number' or $theme == minimum or $theme == maximum {
21
+ @return (density-scale: $theme);
14
22
  }
15
23
 
16
24
  @return ();
@@ -28,7 +28,7 @@ $_sys-maps: (
28
28
  ),
29
29
  );
30
30
 
31
- $_system: ();
31
+ $_system: (density-scale: 0);
32
32
  @each $sys-map in $_sys-maps {
33
33
  $_system: map.merge($_system, _create-system-app-vars-map($sys-map));
34
34
  }
@@ -11,7 +11,7 @@
11
11
  /// for the mat-datepicker.
12
12
  /// @param {Map} $theme The theme to generate base styles for.
13
13
  @mixin base($theme) {
14
- $tokens: m2-datepicker.get-unthemable-tokens();
14
+ $tokens: map.get(m2-datepicker.get-tokens($theme), base);
15
15
  @if inspection.get-theme-version($theme) == 1 {
16
16
  $tokens: map.get(m3-datepicker.get-tokens($theme), base);
17
17
  }
@@ -23,7 +23,7 @@
23
23
  /// @param {Map} $theme The theme to generate color styles for.
24
24
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
25
25
  @mixin color($theme, $color-variant: null) {
26
- $tokens: m2-datepicker.get-color-tokens($theme, primary);
26
+ $tokens: map.get(m2-datepicker.get-tokens($theme), color);
27
27
  @if inspection.get-theme-version($theme) == 1 {
28
28
  $tokens: map.get(m3-datepicker.get-tokens($theme, $color-variant), color);
29
29
  }
@@ -33,12 +33,12 @@
33
33
  @if inspection.get-theme-version($theme) != 1 {
34
34
  .mat-datepicker-content, .mat-datepicker-toggle-active {
35
35
  &.mat-accent {
36
- $tokens: m2-datepicker.get-color-tokens($theme, secondary);
36
+ $tokens: m2-datepicker.private-get-color-palette-color-tokens($theme, secondary);
37
37
  @include token-utils.values($tokens);
38
38
  }
39
39
 
40
40
  &.mat-warn {
41
- $tokens: m2-datepicker.get-color-tokens($theme, error);
41
+ $tokens: m2-datepicker.private-get-color-palette-color-tokens($theme, error);
42
42
  @include token-utils.values($tokens);
43
43
  }
44
44
  }
@@ -48,7 +48,7 @@
48
48
  /// Outputs typography theme styles for the mat-datepicker.
49
49
  /// @param {Map} $theme The theme to generate typography styles for.
50
50
  @mixin typography($theme) {
51
- $tokens: m2-datepicker.get-typography-tokens($theme);
51
+ $tokens: map.get(m2-datepicker.get-tokens($theme), typography);
52
52
  @if inspection.get-theme-version($theme) == 1 {
53
53
  $tokens: map.get(m3-datepicker.get-tokens($theme), typography);
54
54
  }
@@ -73,7 +73,7 @@
73
73
  /// Outputs density theme styles for the mat-datepicker.
74
74
  /// @param {Map} $theme The theme to generate density styles for.
75
75
  @mixin density($theme) {
76
- $tokens: m2-datepicker.get-density-tokens($theme);
76
+ $tokens: map.get(m2-datepicker.get-tokens($theme), density);
77
77
  @if inspection.get-theme-version($theme) == 1 {
78
78
  $tokens: map.get(m3-datepicker.get-tokens($theme), density);
79
79
  }