@angular/material 17.0.0-next.7 → 17.0.0-rc.1

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 (279) hide show
  1. package/_index.scss +1 -1
  2. package/button/_button-theme.scss +49 -51
  3. package/button/_icon-button-theme.scss +12 -31
  4. package/button/index.d.ts +0 -2
  5. package/chips/index.d.ts +2 -3
  6. package/core/index.d.ts +2 -3
  7. package/core/tokens/m2/mat/_sort.scss +60 -0
  8. package/core/tokens/m2/mat/_tree.scss +62 -0
  9. package/core/tokens/m2/mdc/{_button-filled.scss → _filled-button.scss} +1 -1
  10. package/core/tokens/m2/mdc/_icon-button.scss +19 -6
  11. package/core/tokens/m2/mdc/{_button-protected.scss → _protected-button.scss} +1 -1
  12. package/core/tokens/m2/mdc/_text-button.scss +103 -0
  13. package/divider/_divider-theme.scss +4 -1
  14. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  15. package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
  16. package/esm2022/autocomplete/autocomplete.mjs +4 -4
  17. package/esm2022/autocomplete/module.mjs +5 -5
  18. package/esm2022/badge/badge-module.mjs +5 -5
  19. package/esm2022/badge/badge.mjs +4 -4
  20. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
  21. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  22. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  23. package/esm2022/button/button-base.mjs +19 -24
  24. package/esm2022/button/button.mjs +9 -9
  25. package/esm2022/button/fab.mjs +13 -13
  26. package/esm2022/button/icon-button.mjs +9 -9
  27. package/esm2022/button/module.mjs +5 -5
  28. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  29. package/esm2022/button-toggle/button-toggle.mjs +8 -8
  30. package/esm2022/card/card.mjs +43 -43
  31. package/esm2022/card/module.mjs +5 -5
  32. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  33. package/esm2022/checkbox/checkbox.mjs +5 -5
  34. package/esm2022/checkbox/module.mjs +9 -9
  35. package/esm2022/chips/chip-action.mjs +4 -4
  36. package/esm2022/chips/chip-edit-input.mjs +4 -4
  37. package/esm2022/chips/chip-grid.mjs +4 -4
  38. package/esm2022/chips/chip-icons.mjs +10 -10
  39. package/esm2022/chips/chip-input.mjs +4 -4
  40. package/esm2022/chips/chip-listbox.mjs +4 -4
  41. package/esm2022/chips/chip-option.mjs +7 -8
  42. package/esm2022/chips/chip-row.mjs +8 -9
  43. package/esm2022/chips/chip-set.mjs +4 -4
  44. package/esm2022/chips/chip.mjs +6 -7
  45. package/esm2022/chips/module.mjs +8 -9
  46. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  47. package/esm2022/core/datetime/index.mjs +9 -9
  48. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  49. package/esm2022/core/error/error-options.mjs +7 -7
  50. package/esm2022/core/line/line.mjs +8 -8
  51. package/esm2022/core/option/index.mjs +6 -7
  52. package/esm2022/core/option/optgroup.mjs +4 -4
  53. package/esm2022/core/option/option.mjs +8 -9
  54. package/esm2022/core/private/ripple-loader.mjs +4 -4
  55. package/esm2022/core/ripple/index.mjs +5 -5
  56. package/esm2022/core/ripple/ripple.mjs +4 -4
  57. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  58. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  59. package/esm2022/core/version.mjs +1 -1
  60. package/esm2022/datepicker/calendar-body.mjs +5 -5
  61. package/esm2022/datepicker/calendar.mjs +13 -14
  62. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  63. package/esm2022/datepicker/date-range-input.mjs +4 -4
  64. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  65. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  66. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  67. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  68. package/esm2022/datepicker/datepicker-base.mjs +7 -7
  69. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  70. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  71. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  72. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  73. package/esm2022/datepicker/datepicker-toggle.mjs +9 -10
  74. package/esm2022/datepicker/datepicker.mjs +4 -4
  75. package/esm2022/datepicker/month-view.mjs +6 -7
  76. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  77. package/esm2022/datepicker/year-view.mjs +4 -4
  78. package/esm2022/dialog/dialog-container.mjs +4 -4
  79. package/esm2022/dialog/dialog-content-directives.mjs +13 -13
  80. package/esm2022/dialog/dialog.mjs +4 -4
  81. package/esm2022/dialog/module.mjs +5 -5
  82. package/esm2022/divider/divider-module.mjs +5 -5
  83. package/esm2022/divider/divider.mjs +5 -5
  84. package/esm2022/expansion/accordion.mjs +4 -4
  85. package/esm2022/expansion/expansion-module.mjs +7 -8
  86. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  87. package/esm2022/expansion/expansion-panel-header.mjs +11 -12
  88. package/esm2022/expansion/expansion-panel.mjs +9 -9
  89. package/esm2022/form-field/directives/error.mjs +4 -4
  90. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  91. package/esm2022/form-field/directives/hint.mjs +4 -4
  92. package/esm2022/form-field/directives/label.mjs +4 -4
  93. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  94. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  95. package/esm2022/form-field/directives/prefix.mjs +4 -4
  96. package/esm2022/form-field/directives/suffix.mjs +4 -4
  97. package/esm2022/form-field/form-field-control.mjs +4 -4
  98. package/esm2022/form-field/form-field.mjs +6 -6
  99. package/esm2022/form-field/module.mjs +5 -5
  100. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  101. package/esm2022/grid-list/grid-list.mjs +4 -4
  102. package/esm2022/grid-list/grid-tile.mjs +16 -16
  103. package/esm2022/icon/icon-module.mjs +5 -5
  104. package/esm2022/icon/icon-registry.mjs +4 -4
  105. package/esm2022/icon/icon.mjs +4 -4
  106. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  107. package/esm2022/input/input.mjs +4 -4
  108. package/esm2022/input/module.mjs +5 -5
  109. package/esm2022/list/action-list.mjs +4 -4
  110. package/esm2022/list/list-base.mjs +7 -7
  111. package/esm2022/list/list-item-sections.mjs +19 -19
  112. package/esm2022/list/list-module.mjs +5 -5
  113. package/esm2022/list/list-option.mjs +6 -6
  114. package/esm2022/list/list.mjs +7 -7
  115. package/esm2022/list/nav-list.mjs +4 -4
  116. package/esm2022/list/selection-list.mjs +4 -4
  117. package/esm2022/list/subheader.mjs +4 -4
  118. package/esm2022/menu/menu-content.mjs +4 -4
  119. package/esm2022/menu/menu-item.mjs +6 -7
  120. package/esm2022/menu/menu-trigger.mjs +4 -4
  121. package/esm2022/menu/menu.mjs +4 -4
  122. package/esm2022/menu/module.mjs +5 -5
  123. package/esm2022/paginator/module.mjs +6 -7
  124. package/esm2022/paginator/paginator-intl.mjs +4 -4
  125. package/esm2022/paginator/paginator.mjs +10 -11
  126. package/esm2022/progress-bar/module.mjs +5 -5
  127. package/esm2022/progress-bar/progress-bar.mjs +4 -4
  128. package/esm2022/progress-spinner/module.mjs +5 -5
  129. package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
  130. package/esm2022/radio/module.mjs +5 -5
  131. package/esm2022/radio/radio.mjs +8 -8
  132. package/esm2022/select/module.mjs +5 -5
  133. package/esm2022/select/select.mjs +9 -9
  134. package/esm2022/sidenav/drawer.mjs +12 -13
  135. package/esm2022/sidenav/sidenav-module.mjs +7 -8
  136. package/esm2022/sidenav/sidenav.mjs +12 -13
  137. package/esm2022/slide-toggle/module.mjs +10 -11
  138. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  139. package/esm2022/slide-toggle/slide-toggle.mjs +5 -6
  140. package/esm2022/slider/module.mjs +6 -7
  141. package/esm2022/slider/slider-input.mjs +7 -7
  142. package/esm2022/slider/slider-thumb.mjs +6 -7
  143. package/esm2022/slider/slider.mjs +6 -7
  144. package/esm2022/snack-bar/module.mjs +5 -5
  145. package/esm2022/snack-bar/simple-snack-bar.mjs +5 -6
  146. package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
  147. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  148. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  149. package/esm2022/sort/sort-header-intl.mjs +4 -4
  150. package/esm2022/sort/sort-header.mjs +5 -6
  151. package/esm2022/sort/sort-module.mjs +6 -7
  152. package/esm2022/sort/sort.mjs +4 -4
  153. package/esm2022/stepper/step-content.mjs +4 -4
  154. package/esm2022/stepper/step-header.mjs +5 -5
  155. package/esm2022/stepper/step-label.mjs +4 -4
  156. package/esm2022/stepper/stepper-button.mjs +7 -7
  157. package/esm2022/stepper/stepper-icon.mjs +4 -4
  158. package/esm2022/stepper/stepper-intl.mjs +4 -4
  159. package/esm2022/stepper/stepper-module.mjs +5 -5
  160. package/esm2022/stepper/stepper.mjs +8 -8
  161. package/esm2022/table/cell.mjs +22 -22
  162. package/esm2022/table/module.mjs +5 -5
  163. package/esm2022/table/row.mjs +22 -22
  164. package/esm2022/table/table.mjs +7 -7
  165. package/esm2022/table/text-column.mjs +4 -4
  166. package/esm2022/tabs/module.mjs +5 -5
  167. package/esm2022/tabs/paginated-tab-header.mjs +4 -4
  168. package/esm2022/tabs/tab-body.mjs +7 -7
  169. package/esm2022/tabs/tab-content.mjs +4 -4
  170. package/esm2022/tabs/tab-group.mjs +6 -6
  171. package/esm2022/tabs/tab-header.mjs +4 -4
  172. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  173. package/esm2022/tabs/tab-label.mjs +4 -4
  174. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
  175. package/esm2022/tabs/tab.mjs +4 -4
  176. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  177. package/esm2022/toolbar/toolbar.mjs +8 -8
  178. package/esm2022/tooltip/module.mjs +5 -5
  179. package/esm2022/tooltip/tooltip.mjs +7 -7
  180. package/esm2022/tree/node.mjs +10 -10
  181. package/esm2022/tree/outlet.mjs +4 -4
  182. package/esm2022/tree/padding.mjs +4 -4
  183. package/esm2022/tree/toggle.mjs +4 -4
  184. package/esm2022/tree/tree-module.mjs +5 -5
  185. package/esm2022/tree/tree.mjs +5 -5
  186. package/expansion/_expansion-theme.scss +4 -1
  187. package/expansion/index.d.ts +4 -5
  188. package/fesm2022/autocomplete.mjs +13 -13
  189. package/fesm2022/autocomplete.mjs.map +1 -1
  190. package/fesm2022/badge.mjs +7 -7
  191. package/fesm2022/badge.mjs.map +1 -1
  192. package/fesm2022/bottom-sheet.mjs +10 -10
  193. package/fesm2022/bottom-sheet.mjs.map +1 -1
  194. package/fesm2022/button-toggle.mjs +11 -11
  195. package/fesm2022/button-toggle.mjs.map +1 -1
  196. package/fesm2022/button.mjs +50 -55
  197. package/fesm2022/button.mjs.map +1 -1
  198. package/fesm2022/card.mjs +46 -46
  199. package/fesm2022/card.mjs.map +1 -1
  200. package/fesm2022/checkbox.mjs +15 -15
  201. package/fesm2022/checkbox.mjs.map +1 -1
  202. package/fesm2022/chips.mjs +53 -54
  203. package/fesm2022/chips.mjs.map +1 -1
  204. package/fesm2022/core.mjs +59 -60
  205. package/fesm2022/core.mjs.map +1 -1
  206. package/fesm2022/datepicker.mjs +89 -89
  207. package/fesm2022/datepicker.mjs.map +1 -1
  208. package/fesm2022/dialog.mjs +22 -22
  209. package/fesm2022/dialog.mjs.map +1 -1
  210. package/fesm2022/divider.mjs +8 -8
  211. package/fesm2022/divider.mjs.map +1 -1
  212. package/fesm2022/expansion.mjs +31 -32
  213. package/fesm2022/expansion.mjs.map +1 -1
  214. package/fesm2022/form-field.mjs +36 -36
  215. package/fesm2022/form-field.mjs.map +1 -1
  216. package/fesm2022/grid-list.mjs +22 -22
  217. package/fesm2022/grid-list.mjs.map +1 -1
  218. package/fesm2022/icon/testing.mjs +7 -7
  219. package/fesm2022/icon/testing.mjs.map +1 -1
  220. package/fesm2022/icon.mjs +10 -10
  221. package/fesm2022/icon.mjs.map +1 -1
  222. package/fesm2022/input.mjs +7 -7
  223. package/fesm2022/input.mjs.map +1 -1
  224. package/fesm2022/list.mjs +51 -51
  225. package/fesm2022/list.mjs.map +1 -1
  226. package/fesm2022/menu.mjs +23 -23
  227. package/fesm2022/menu.mjs.map +1 -1
  228. package/fesm2022/paginator.mjs +17 -19
  229. package/fesm2022/paginator.mjs.map +1 -1
  230. package/fesm2022/progress-bar.mjs +7 -7
  231. package/fesm2022/progress-bar.mjs.map +1 -1
  232. package/fesm2022/progress-spinner.mjs +7 -7
  233. package/fesm2022/progress-spinner.mjs.map +1 -1
  234. package/fesm2022/radio.mjs +11 -11
  235. package/fesm2022/radio.mjs.map +1 -1
  236. package/fesm2022/select.mjs +12 -12
  237. package/fesm2022/select.mjs.map +1 -1
  238. package/fesm2022/sidenav.mjs +29 -30
  239. package/fesm2022/sidenav.mjs.map +1 -1
  240. package/fesm2022/slide-toggle.mjs +16 -18
  241. package/fesm2022/slide-toggle.mjs.map +1 -1
  242. package/fesm2022/slider.mjs +22 -24
  243. package/fesm2022/slider.mjs.map +1 -1
  244. package/fesm2022/snack-bar.mjs +26 -27
  245. package/fesm2022/snack-bar.mjs.map +1 -1
  246. package/fesm2022/sort.mjs +15 -17
  247. package/fesm2022/sort.mjs.map +1 -1
  248. package/fesm2022/stepper.mjs +33 -33
  249. package/fesm2022/stepper.mjs.map +1 -1
  250. package/fesm2022/table.mjs +55 -55
  251. package/fesm2022/table.mjs.map +1 -1
  252. package/fesm2022/tabs.mjs +42 -42
  253. package/fesm2022/tabs.mjs.map +1 -1
  254. package/fesm2022/toolbar.mjs +11 -11
  255. package/fesm2022/toolbar.mjs.map +1 -1
  256. package/fesm2022/tooltip.mjs +10 -10
  257. package/fesm2022/tooltip.mjs.map +1 -1
  258. package/fesm2022/tree.mjs +26 -26
  259. package/fesm2022/tree.mjs.map +1 -1
  260. package/form-field/_form-field-theme.scss +11 -1
  261. package/package.json +2 -2
  262. package/paginator/index.d.ts +4 -5
  263. package/prebuilt-themes/deeppurple-amber.css +1 -1
  264. package/prebuilt-themes/indigo-pink.css +1 -1
  265. package/prebuilt-themes/pink-bluegrey.css +1 -1
  266. package/prebuilt-themes/purple-green.css +1 -1
  267. package/schematics/ng-add/index.js +1 -1
  268. package/schematics/ng-add/index.mjs +1 -1
  269. package/schematics/ng-generate/mdc-migration/index_bundled.js +1227 -499
  270. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  271. package/schematics/ng-update/index_bundled.js +328 -26
  272. package/schematics/ng-update/index_bundled.js.map +4 -4
  273. package/sidenav/index.d.ts +3 -4
  274. package/slide-toggle/index.d.ts +1 -2
  275. package/slider/index.d.ts +1 -2
  276. package/sort/_sort-theme.scss +21 -23
  277. package/sort/index.d.ts +2 -3
  278. package/tree/_tree-theme.scss +13 -26
  279. package/tree/_tree-variables.scss +0 -14
package/_index.scss CHANGED
@@ -47,7 +47,7 @@
47
47
  @forward './core/style/elevation' show elevation, overridable-elevation, elevation-transition;
48
48
 
49
49
  // Theme bundles
50
- @forward './core/theming/all-theme' show all-component-themes;
50
+ @forward './core/theming/all-theme' show all-component-themes, all-component-bases;
51
51
  @forward './core/color/all-color' show all-component-colors;
52
52
  @forward './core/typography/all-typography' show all-component-typographies;
53
53
 
@@ -12,20 +12,15 @@
12
12
  @use '../core/theming/theming';
13
13
  @use '../core/theming/inspection';
14
14
  @use '../core/typography/typography';
15
- @use '../core/tokens/m2/mdc/button-filled' as tokens-mdc-button-filled;
16
- @use '../core/tokens/m2/mdc/button-protected' as tokens-mdc-button-protected;
15
+ @use '../core/tokens/m2/mdc/filled-button' as tokens-mdc-filled-button;
16
+ @use '../core/tokens/m2/mdc/protected-button' as tokens-mdc-protected-button;
17
+ @use '../core/tokens/m2/mdc/text-button' as tokens-mdc-text-button;
17
18
 
18
19
  @function _on-color($theme, $palette) {
19
20
  $is-dark: inspection.get-theme-type($theme) == dark;
20
21
  @return if(mdc-helpers.variable-safe-contrast-tone($palette, $is-dark) == 'dark', #000, #fff);
21
22
  }
22
23
 
23
- @mixin _button-variant($color) {
24
- @include mdc-button-text-theme.theme((
25
- label-text-color: $color,
26
- ));
27
- }
28
-
29
24
  @mixin _outlined-button-variant($color) {
30
25
  @include mdc-button-outlined-theme.theme((
31
26
  label-text-color: $color,
@@ -40,42 +35,10 @@
40
35
  @include mdc-helpers.using-mdc-theme($theme) {
41
36
  $is-dark: inspection.get-theme-type($theme) == dark;
42
37
  $on-surface: mdc-theme-color.prop-value(on-surface);
43
- $surface: mdc-theme-color.prop-value(surface);
44
38
  $disabled-ink-color: rgba($on-surface, if($is-dark, 0.5, 0.38));
45
- $disabled-container-color: rgba($on-surface, 0.12);
46
39
  $primary: mdc-theme-color.prop-value(primary);
47
- $on-primary: mdc-theme-color.prop-value(on-primary);
48
40
  $secondary: mdc-theme-color.prop-value(secondary);
49
- $on-secondary: mdc-theme-color.prop-value(on-secondary);
50
41
  $error: mdc-theme-color.prop-value(error);
51
- $on-error: mdc-theme-color.prop-value(on-error);
52
-
53
- .mat-mdc-button {
54
- &.mat-unthemed {
55
- @include _button-variant($on-surface);
56
- }
57
-
58
- &.mat-primary {
59
- @include _button-variant($primary);
60
- }
61
-
62
- &.mat-accent {
63
- @include _button-variant($secondary);
64
- }
65
-
66
- &.mat-warn {
67
- @include _button-variant($error);
68
- }
69
-
70
- @include button-theme-private.apply-disabled-style() {
71
- @include mdc-button-text-theme.theme((
72
- // We need to pass both the disabled and enabled values, because the enabled
73
- // ones apply to anchors while the disabled ones are for buttons.
74
- disabled-label-text-color: $disabled-ink-color,
75
- label-text-color: $disabled-ink-color
76
- ));
77
- }
78
- }
79
42
 
80
43
  .mat-mdc-outlined-button {
81
44
  @include mdc-button-outlined-theme.theme((
@@ -130,11 +93,30 @@
130
93
  $on-accent: _on-color($theme, $accent);
131
94
  $on-error: _on-color($theme, $error);
132
95
 
96
+ .mat-mdc-button {
97
+ @include mdc-button-text-theme.theme(tokens-mdc-text-button.get-color-tokens($theme));
98
+
99
+ &.mat-primary {
100
+ @include mdc-button-text-theme.theme(
101
+ tokens-mdc-text-button.private-get-color-palette-color-tokens($theme, primary));
102
+ }
103
+
104
+ &.mat-accent {
105
+ @include mdc-button-text-theme.theme(
106
+ tokens-mdc-text-button.private-get-color-palette-color-tokens($theme, accent));
107
+ }
108
+
109
+ &.mat-warn {
110
+ @include mdc-button-text-theme.theme(
111
+ tokens-mdc-text-button.private-get-color-palette-color-tokens($theme, warn));
112
+ }
113
+ }
114
+
133
115
  .mat-mdc-unelevated-button {
134
- $default-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $surface, $on-surface);
135
- $primary-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $primary, $on-primary);
136
- $accent-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $accent, $on-accent);
137
- $warn-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $error, $on-error);
116
+ $default-color-tokens: tokens-mdc-filled-button.get-color-tokens($theme, $surface, $on-surface);
117
+ $primary-color-tokens: tokens-mdc-filled-button.get-color-tokens($theme, $primary, $on-primary);
118
+ $accent-color-tokens: tokens-mdc-filled-button.get-color-tokens($theme, $accent, $on-accent);
119
+ $warn-color-tokens: tokens-mdc-filled-button.get-color-tokens($theme, $error, $on-error);
138
120
 
139
121
  &.mat-unthemed {
140
122
  @include mdc-button-filled-theme.theme($default-color-tokens);
@@ -154,18 +136,18 @@
154
136
  }
155
137
 
156
138
  .mat-mdc-raised-button {
157
- $default-color-tokens: tokens-mdc-button-protected.get-color-tokens(
139
+ $default-color-tokens: tokens-mdc-protected-button.get-color-tokens(
158
140
  $theme,
159
141
  $surface,
160
142
  $on-surface
161
143
  );
162
- $primary-color-tokens: tokens-mdc-button-protected.get-color-tokens(
144
+ $primary-color-tokens: tokens-mdc-protected-button.get-color-tokens(
163
145
  $theme,
164
146
  $primary,
165
147
  $on-primary
166
148
  );
167
- $accent-color-tokens: tokens-mdc-button-protected.get-color-tokens($theme, $accent, $on-accent);
168
- $warn-color-tokens: tokens-mdc-button-protected.get-color-tokens($theme, $error, $on-error);
149
+ $accent-color-tokens: tokens-mdc-protected-button.get-color-tokens($theme, $accent, $on-accent);
150
+ $warn-color-tokens: tokens-mdc-protected-button.get-color-tokens($theme, $error, $on-error);
169
151
 
170
152
  &.mat-unthemed {
171
153
  @include mdc-button-protected-theme.theme($default-color-tokens);
@@ -201,6 +183,17 @@
201
183
  $disabled-ink-color: rgba($on-surface, if($is-dark, 0.5, 0.38));
202
184
  $disabled-container-color: rgba($on-surface, 0.12);
203
185
 
186
+ // TODO: these disabled styles are a bit too specific currently.
187
+ // Once the buttons are fully tokenized, we should rework how they're applied.
188
+ .mat-mdc-button {
189
+ @include button-theme-private.apply-disabled-style() {
190
+ @include mdc-button-text-theme.theme((
191
+ disabled-label-text-color: $disabled-ink-color,
192
+ label-text-color: $disabled-ink-color,
193
+ ));
194
+ }
195
+ }
196
+
204
197
  .mat-mdc-raised-button {
205
198
  @include button-theme-private.apply-disabled-style() {
206
199
  @include mdc-elevation-theme.elevation(0);
@@ -234,19 +227,24 @@
234
227
  @mixin density($theme) {
235
228
  $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
236
229
 
230
+ .mat-mdc-button {
231
+ $density-tokens: tokens-mdc-text-button.get-density-tokens($theme);
232
+ @include mdc-button-text-theme.theme($density-tokens);
233
+ @include button-theme-private.touch-target-density($density-scale);
234
+ }
235
+
237
236
  .mat-mdc-raised-button {
238
- $density-tokens: tokens-mdc-button-protected.get-density-tokens($theme);
237
+ $density-tokens: tokens-mdc-protected-button.get-density-tokens($theme);
239
238
  @include mdc-button-protected-theme.theme($density-tokens);
240
239
  @include button-theme-private.touch-target-density($density-scale);
241
240
  }
242
241
 
243
242
  .mat-mdc-unelevated-button {
244
- $density-tokens: tokens-mdc-button-filled.get-density-tokens($theme);
243
+ $density-tokens: tokens-mdc-filled-button.get-density-tokens($theme);
245
244
  @include mdc-button-filled-theme.theme($density-tokens);
246
245
  @include button-theme-private.touch-target-density($density-scale);
247
246
  }
248
247
 
249
- .mat-mdc-button,
250
248
  .mat-mdc-outlined-button {
251
249
  // Use `mat-mdc-button-base` to increase the specificity over the button's structural styles.
252
250
  &.mat-mdc-button-base {
@@ -1,7 +1,6 @@
1
1
  @use 'sass:math';
2
2
  @use '@material/density/functions' as mdc-density-functions;
3
3
  @use '@material/icon-button/icon-button-theme' as mdc-icon-button-theme;
4
- @use '@material/theme/theme-color' as mdc-theme-color;
5
4
  @use '../core/tokens/m2/mdc/icon-button' as tokens-mdc-icon-button;
6
5
 
7
6
  @use './button-theme-private';
@@ -10,64 +9,46 @@
10
9
 
11
10
  $_icon-size: 24px;
12
11
 
12
+ // TODO(crisbeto): move these into tokens
13
13
  @mixin _ripple-color($color) {
14
14
  --mat-mdc-button-persistent-ripple-color: #{$color};
15
15
  --mat-mdc-button-ripple-color: #{rgba($color, 0.1)};
16
16
  }
17
17
 
18
- @function _variable-safe-contrast-tone($value, $is-dark) {
19
- @if ($value == 'dark' or $value == 'light' or type-of($value) == 'color') {
20
- @return mdc-theme-color.contrast-tone($value);
21
- }
22
-
23
- @return if($is-dark, 'light', 'dark');
24
- }
25
-
26
18
  @mixin base($theme) {
27
19
  // TODO(mmalerba): Move icon button base tokens here
28
20
  }
29
21
 
30
22
  @mixin color($theme) {
31
23
  $color-tokens: tokens-mdc-icon-button.get-color-tokens($theme);
32
- $surface: inspection.get-theme-color($theme, background, card);
33
24
  $is-dark: inspection.get-theme-type($theme) == dark;
34
- $on-surface: if(_variable-safe-contrast-tone($surface, $is-dark) == 'dark', #000, #fff);
35
25
 
36
26
  .mat-mdc-icon-button {
37
27
  @include button-theme-private.ripple-theme-styles($theme, false);
38
28
  @include mdc-icon-button-theme.theme($color-tokens);
39
- @include _ripple-color($on-surface);
29
+ @include _ripple-color(if($is-dark, #fff, #000));
40
30
 
41
31
  &.mat-primary {
42
- $color: inspection.get-theme-color($theme, primary);
43
- @include mdc-icon-button-theme.theme((icon-color: $color));
44
- @include _ripple-color($color);
32
+ @include _ripple-color(inspection.get-theme-color($theme, primary));
33
+ @include mdc-icon-button-theme.theme(
34
+ tokens-mdc-icon-button.private-get-color-palette-color-tokens($theme, primary));
45
35
  }
46
36
 
47
37
  &.mat-accent {
48
- $color: inspection.get-theme-color($theme, accent);
49
- @include mdc-icon-button-theme.theme((icon-color: $color));
50
- @include _ripple-color($color);
38
+ @include _ripple-color(inspection.get-theme-color($theme, accent));
39
+ @include mdc-icon-button-theme.theme(
40
+ tokens-mdc-icon-button.private-get-color-palette-color-tokens($theme, accent));
51
41
  }
52
42
 
53
43
  &.mat-warn {
54
- $color: inspection.get-theme-color($theme, warn);
55
- @include mdc-icon-button-theme.theme((icon-color: $color));
56
- @include _ripple-color($color);
57
- }
58
-
59
- @include button-theme-private.apply-disabled-style() {
60
- $disabled-color: rgba($on-surface, if($is-dark, 0.5, 0.38));
61
- @include mdc-icon-button-theme.theme((
62
- icon-color: $disabled-color,
63
- disabled-icon-color: $disabled-color,
64
- ));
44
+ @include _ripple-color(inspection.get-theme-color($theme, warn));
45
+ @include mdc-icon-button-theme.theme(
46
+ tokens-mdc-icon-button.private-get-color-palette-color-tokens($theme, warn));
65
47
  }
66
48
  }
67
49
  }
68
50
 
69
- @mixin typography($theme) {
70
- }
51
+ @mixin typography($theme) {}
71
52
 
72
53
  @mixin density($theme) {
73
54
  $density-scale: inspection.get-theme-density($theme);
package/button/index.d.ts CHANGED
@@ -124,8 +124,6 @@ declare class MatButtonBase implements AfterViewInit, OnDestroy {
124
124
  ngOnDestroy(): void;
125
125
  /** Focuses the button. */
126
126
  focus(_origin?: FocusOrigin, options?: FocusOptions): void;
127
- /** Gets whether the button has one of the given attributes. */
128
- private _hasHostAttributes;
129
127
  private _updateRippleDisabled;
130
128
  static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonBase, never>;
131
129
  static ɵdir: i0.ɵɵDirectiveDeclaration<MatButtonBase, never, never, { "color": { "alias": "color"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, false, never>;
package/chips/index.d.ts CHANGED
@@ -20,7 +20,6 @@ import { FormGroupDirective } from '@angular/forms';
20
20
  import { HasTabIndex } from '@angular/material/core';
21
21
  import * as i0 from '@angular/core';
22
22
  import * as i11 from '@angular/material/core';
23
- import * as i12 from '@angular/common';
24
23
  import { InjectionToken } from '@angular/core';
25
24
  import { MatFormField } from '@angular/material/form-field';
26
25
  import { MatFormFieldControl } from '@angular/material/form-field';
@@ -881,7 +880,7 @@ export declare class MatChipRow extends MatChip implements AfterViewInit {
881
880
  */
882
881
  private _getEditInput;
883
882
  static ɵfac: i0.ɵɵFactoryDeclaration<MatChipRow, [null, null, null, null, null, { optional: true; }, { optional: true; }, { attribute: "tabindex"; }]>;
884
- static ɵcmp: i0.ɵɵComponentDeclaration<MatChipRow, "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", never, { "color": { "alias": "color"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; }, { "edited": "edited"; }, ["contentEditInput"], ["mat-chip-avatar, [matChipAvatar]", "*", "[matChipEditInput]", "mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"], false, never>;
883
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatChipRow, "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", never, { "color": { "alias": "color"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; }, { "edited": "edited"; }, ["contentEditInput"], ["mat-chip-avatar, [matChipAvatar]", "[matChipEditInput]", "*", "mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"], false, never>;
885
884
  }
886
885
 
887
886
  /** Default options, for the chips module, that can be overridden. */
@@ -1010,7 +1009,7 @@ declare const _MatChipSetMixinBase: _Constructor<HasTabIndex> & _AbstractConstru
1010
1009
 
1011
1010
  export declare class MatChipsModule {
1012
1011
  static ɵfac: i0.ɵɵFactoryDeclaration<MatChipsModule, never>;
1013
- static ɵmod: i0.ɵɵNgModuleDeclaration<MatChipsModule, [typeof i1.MatChipAction, typeof i2.MatChip, typeof i3.MatChipAvatar, typeof i4.MatChipEditInput, typeof i5.MatChipGrid, typeof i6.MatChipInput, typeof i7.MatChipListbox, typeof i8.MatChipOption, typeof i3.MatChipRemove, typeof i9.MatChipRow, typeof i10.MatChipSet, typeof i3.MatChipTrailingIcon], [typeof i11.MatCommonModule, typeof i12.CommonModule, typeof i11.MatRippleModule], [typeof i11.MatCommonModule, typeof i2.MatChip, typeof i3.MatChipAvatar, typeof i4.MatChipEditInput, typeof i5.MatChipGrid, typeof i6.MatChipInput, typeof i7.MatChipListbox, typeof i8.MatChipOption, typeof i3.MatChipRemove, typeof i9.MatChipRow, typeof i10.MatChipSet, typeof i3.MatChipTrailingIcon]>;
1012
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MatChipsModule, [typeof i1.MatChipAction, typeof i2.MatChip, typeof i3.MatChipAvatar, typeof i4.MatChipEditInput, typeof i5.MatChipGrid, typeof i6.MatChipInput, typeof i7.MatChipListbox, typeof i8.MatChipOption, typeof i3.MatChipRemove, typeof i9.MatChipRow, typeof i10.MatChipSet, typeof i3.MatChipTrailingIcon], [typeof i11.MatCommonModule, typeof i11.MatRippleModule], [typeof i11.MatCommonModule, typeof i2.MatChip, typeof i3.MatChipAvatar, typeof i4.MatChipEditInput, typeof i5.MatChipGrid, typeof i6.MatChipInput, typeof i7.MatChipListbox, typeof i8.MatChipOption, typeof i3.MatChipRemove, typeof i9.MatChipRow, typeof i10.MatChipSet, typeof i3.MatChipTrailingIcon]>;
1014
1013
  static ɵinj: i0.ɵɵInjectorDeclaration<MatChipsModule>;
1015
1014
  }
1016
1015
 
package/core/index.d.ts CHANGED
@@ -9,7 +9,6 @@ import { FormGroupDirective } from '@angular/forms';
9
9
  import { HighContrastModeDetector } from '@angular/cdk/a11y';
10
10
  import * as i0 from '@angular/core';
11
11
  import * as i1 from '@angular/cdk/bidi';
12
- import * as i4 from '@angular/common';
13
12
  import { InjectionToken } from '@angular/core';
14
13
  import { NgControl } from '@angular/forms';
15
14
  import { NgForm } from '@angular/forms';
@@ -432,7 +431,7 @@ declare namespace i3 {
432
431
  }
433
432
  }
434
433
 
435
- declare namespace i6 {
434
+ declare namespace i5 {
436
435
  export {
437
436
  MatPseudoCheckboxModule
438
437
  }
@@ -629,7 +628,7 @@ export declare class MatOption<T = any> implements FocusableOption, AfterViewChe
629
628
 
630
629
  export declare class MatOptionModule {
631
630
  static ɵfac: i0.ɵɵFactoryDeclaration<MatOptionModule, never>;
632
- static ɵmod: i0.ɵɵNgModuleDeclaration<MatOptionModule, [typeof i1_3.MatOption, typeof i2.MatOptgroup], [typeof i3.MatRippleModule, typeof i4.CommonModule, typeof i1_2.MatCommonModule, typeof i6.MatPseudoCheckboxModule], [typeof i1_3.MatOption, typeof i2.MatOptgroup]>;
631
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MatOptionModule, [typeof i1_3.MatOption, typeof i2.MatOptgroup], [typeof i3.MatRippleModule, typeof i1_2.MatCommonModule, typeof i5.MatPseudoCheckboxModule], [typeof i1_3.MatOption, typeof i2.MatOptgroup]>;
633
632
  static ɵinj: i0.ɵɵInjectorDeclaration<MatOptionModule>;
634
633
  }
635
634
 
@@ -0,0 +1,60 @@
1
+ @use 'sass:color';
2
+ @use 'sass:meta';
3
+ @use '../../token-utils';
4
+ @use '../../../theming/inspection';
5
+ @use '../../../style/sass-utils';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mat, sort);
9
+
10
+ // Tokens that can't be configured through Angular Material's current theming API,
11
+ // but may be in a future version of the theming API.
12
+ @function get-unthemable-tokens() {
13
+ @return ();
14
+ }
15
+
16
+ // Tokens that can be configured through Angular Material's color theming API.
17
+ @function get-color-tokens($theme) {
18
+ $table-background: inspection.get-theme-color($theme, background, card);
19
+ $text-color: inspection.get-theme-color($theme, foreground, secondary-text);
20
+ $arrow-color: null;
21
+
22
+ // Because the arrow is made up of multiple elements that are stacked on top of each other,
23
+ // we can't use the semi-transparent color from the theme directly. If the value is a color
24
+ // *type*, we convert it into a solid color by taking the opacity from the rgba value and
25
+ // using the value to determine the percentage of the background to put into foreground
26
+ // when mixing the colors together. Otherwise, if it resolves to something different
27
+ // (e.g. it resolves to a CSS variable), we use the color directly.
28
+ @if (meta.type-of($table-background) == color and meta.type-of($text-color) == color) {
29
+ $text-opacity: opacity($text-color);
30
+ $arrow-color: color.mix($table-background, rgba($text-color, 1), (1 - $text-opacity) * 100%);
31
+ }
32
+ @else {
33
+ $arrow-color: $text-color;
34
+ }
35
+
36
+ @return (
37
+ arrow-color: $arrow-color,
38
+ );
39
+ }
40
+
41
+ // Tokens that can be configured through Angular Material's typography theming API.
42
+ @function get-typography-tokens($theme) {
43
+ @return ();
44
+ }
45
+
46
+ // Tokens that can be configured through Angular Material's density theming API.
47
+ @function get-density-tokens($theme) {
48
+ @return ();
49
+ }
50
+
51
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
52
+ // This is used to create token slots.
53
+ @function get-token-slots() {
54
+ @return sass-utils.deep-merge-all(
55
+ get-unthemable-tokens(),
56
+ get-color-tokens(token-utils.$placeholder-color-config),
57
+ get-typography-tokens(token-utils.$placeholder-typography-config),
58
+ get-density-tokens(token-utils.$placeholder-density-config)
59
+ );
60
+ }
@@ -0,0 +1,62 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+ @use '../../../theming/theming';
4
+ @use '../../../theming/inspection';
5
+ @use '../../../style/sass-utils';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mat, tree);
9
+
10
+ // Tokens that can't be configured through Angular Material's current theming API,
11
+ // but may be in a future version of the theming API.
12
+ @function get-unthemable-tokens() {
13
+ @return ();
14
+ }
15
+
16
+ // Tokens that can be configured through Angular Material's color theming API.
17
+ @function get-color-tokens($theme) {
18
+ $foreground-base: inspection.get-theme-color($theme, foreground, base);
19
+
20
+ @return (
21
+ container-background-color: inspection.get-theme-color($theme, background, card),
22
+ node-text-color: inspection.get-theme-color($theme, foreground, text),
23
+ );
24
+ }
25
+
26
+ // Tokens that can be configured through Angular Material's typography theming API.
27
+ @function get-typography-tokens($theme) {
28
+ @return (
29
+ node-text-font: inspection.get-theme-typography($theme, body-2, font-family),
30
+ node-text-size: inspection.get-theme-typography($theme, body-2, font-size),
31
+ node-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
32
+
33
+ // TODO(crisbeto): provide tokens for line height and letter spacing to match other components.
34
+ );
35
+ }
36
+
37
+ // Tokens that can be configured through Angular Material's density theming API.
38
+ @function get-density-tokens($theme) {
39
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -4);
40
+ $min-height-scale: (
41
+ 0: 48px,
42
+ -1: 44px,
43
+ -2: 40px,
44
+ -3: 36px,
45
+ -4: 28px,
46
+ );
47
+
48
+ @return (
49
+ node-min-height: map.get($min-height-scale, $density-scale)
50
+ );
51
+ }
52
+
53
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
54
+ // This is used to create token slots.
55
+ @function get-token-slots() {
56
+ @return sass-utils.deep-merge-all(
57
+ get-unthemable-tokens(),
58
+ get-color-tokens(token-utils.$placeholder-color-config),
59
+ get-typography-tokens(token-utils.$placeholder-typography-config),
60
+ get-density-tokens(token-utils.$placeholder-density-config)
61
+ );
62
+ }
@@ -6,7 +6,7 @@
6
6
  @use '../../../theming/theming';
7
7
 
8
8
  // The prefix used to generate the fully qualified name for tokens in this file.
9
- $prefix: (mdc, button-filled);
9
+ $prefix: (mdc, filled-button);
10
10
 
11
11
  // Tokens that can't be configured through Angular Material's current theming API,
12
12
  // but may be in a future version of the theming API.
@@ -1,4 +1,6 @@
1
+ @use 'sass:map';
1
2
  @use '../../../style/sass-utils';
3
+ @use '../../../theming/inspection';
2
4
  @use '../../token-utils';
3
5
 
4
6
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -20,12 +22,7 @@ $prefix: (mdc, icon-button);
20
22
  state-layer-size: 48px,
21
23
  // MDC's icon size applied to svg and img elements inside the component
22
24
  icon-size: 24px,
23
- // Only applies to :disabled icons, but Angular Components uses [disabled] since :disabled
24
- // wouldn't work on <a> tags.
25
- disabled-icon-color: black,
26
- // Angular version applies an opacity 1 with a color change, and this only applies with
27
- // :disabled anyways.
28
- disabled-icon-opacity: 0.38,
25
+
29
26
  // =============================================================================================
30
27
  // = TOKENS NOT USED IN ANGULAR MATERIAL =
31
28
  // =============================================================================================
@@ -41,13 +38,29 @@ $prefix: (mdc, icon-button);
41
38
  pressed-state-layer-opacity: null,
42
39
  focus-ring-color: null,
43
40
  focus-ring-offset: null,
41
+
42
+ // We use a color with an opacity to show the disabled state,
43
+ // instead of applying it to the entire button.
44
+ disabled-icon-opacity: null,
44
45
  );
45
46
  }
46
47
 
47
48
  // Tokens that can be configured through Angular Material's color theming API.
48
49
  @function get-color-tokens($theme) {
50
+ $is-dark: inspection.get-theme-type($theme) == dark;
51
+
49
52
  @return (
50
53
  icon-color: inherit,
54
+ disabled-icon-color: if($is-dark, rgba(#fff, 0.5), rgba(#000, 0.38)),
55
+ );
56
+ }
57
+
58
+ // Generates the mapping for the properties that change based on the button palette color.
59
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
60
+ $palette: map.get($theme, $palette-name);
61
+
62
+ @return (
63
+ icon-color: inspection.get-theme-color($theme, $palette-name)
51
64
  );
52
65
  }
53
66
 
@@ -6,7 +6,7 @@
6
6
  @use '../../../theming/theming';
7
7
 
8
8
  // The prefix used to generate the fully qualified name for tokens in this file.
9
- $prefix: (mdc, button-protected);
9
+ $prefix: (mdc, protected-button);
10
10
 
11
11
  // Tokens that can't be configured through Angular Material's current theming API,
12
12
  // but may be in a future version of the theming API.
@@ -0,0 +1,103 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+ @use '../../../style/sass-utils';
4
+ @use '../../../theming/inspection';
5
+ @use '../../../theming/theming';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mdc, text-button);
9
+
10
+ // Tokens that can't be configured through Angular Material's current theming API,
11
+ // but may be in a future version of the theming API.
12
+ //
13
+ // Tokens that are available in MDC, but not used in Angular Material should be mapped to `null`.
14
+ // `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
15
+ // our CSS.
16
+ @function get-unthemable-tokens() {
17
+ @return (
18
+ container-shape: 4px,
19
+
20
+ // TODO: `container-height` is also included so it has a default value to
21
+ // prevent the buttons from collapsing if a density mixin isn't included.
22
+ container-height: 36px,
23
+
24
+ // TODO: handle these through the typography styles eventually.
25
+ label-text-font: null,
26
+ label-text-size: null,
27
+ label-text-tracking: null,
28
+ label-text-transform: null,
29
+ label-text-weight: null,
30
+
31
+ // =============================================================================================
32
+ // = TOKENS NOT USED IN ANGULAR MATERIAL =
33
+ // =============================================================================================
34
+ hover-label-text-color: null,
35
+ focus-label-text-color: null,
36
+ pressed-label-text-color: null,
37
+ focus-state-layer-color: null,
38
+ focus-state-layer-opacity: null,
39
+ hover-state-layer-color: null,
40
+ hover-state-layer-opacity: null,
41
+ pressed-state-layer-color: null,
42
+ pressed-state-layer-opacity: null,
43
+ with-icon-disabled-icon-color: null,
44
+ with-icon-focus-icon-color: null,
45
+ with-icon-hover-icon-color: null,
46
+ with-icon-icon-color: null,
47
+ with-icon-icon-size: null,
48
+ with-icon-pressed-icon-color: null,
49
+ focus-ring-color: null,
50
+ focus-ring-offset: null,
51
+ keep-touch-target: false,
52
+ );
53
+ }
54
+
55
+ // Tokens that can be configured through Angular Material's color theming API.
56
+ @function get-color-tokens($theme) {
57
+ $is-dark: inspection.get-theme-type($theme) == dark;
58
+ $on-surface: if($is-dark, #fff, #000);
59
+
60
+ @return (
61
+ label-text-color: $on-surface,
62
+ disabled-label-text-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
63
+ );
64
+ }
65
+
66
+ // Generates the mapping for the properties that change based on the button palette color.
67
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
68
+ $palette: map.get($theme, $palette-name);
69
+
70
+ @return (
71
+ label-text-color: inspection.get-theme-color($theme, $palette-name)
72
+ );
73
+ }
74
+
75
+ // Tokens that can be configured through Angular Material's typography theming API.
76
+ @function get-typography-tokens($theme) {
77
+ @return ();
78
+ }
79
+
80
+ // Tokens that can be configured through Angular Material's density theming API.
81
+ @function get-density-tokens($theme) {
82
+ $scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
83
+
84
+ @return (
85
+ container-height: map.get((
86
+ 0: 36px,
87
+ -1: 32px,
88
+ -2: 28px,
89
+ -3: 24px,
90
+ ), $scale),
91
+ );
92
+ }
93
+
94
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
95
+ // This is used to create token slots.
96
+ @function get-token-slots() {
97
+ @return sass-utils.deep-merge-all(
98
+ get-unthemable-tokens(),
99
+ get-color-tokens(token-utils.$placeholder-color-config),
100
+ get-typography-tokens(token-utils.$placeholder-typography-config),
101
+ get-density-tokens(token-utils.$placeholder-density-config)
102
+ );
103
+ }
@@ -5,7 +5,10 @@
5
5
  @use '../core/tokens/m2/mat/divider' as tokens-mat-divider;
6
6
 
7
7
  @mixin base($theme) {
8
- // TODO(mmalerba): Move divider base tokens here
8
+ @include sass-utils.current-selector-or-root() {
9
+ @include token-utils.create-token-values(
10
+ tokens-mat-divider.$prefix, tokens-mat-divider.get-unthemable-tokens());
11
+ }
9
12
  }
10
13
 
11
14
  @mixin color($theme) {