@angular/material 18.0.0-next.4 → 18.0.0-next.6

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 (304) hide show
  1. package/_index.scss +67 -60
  2. package/autocomplete/_autocomplete-theme.scss +7 -0
  3. package/autocomplete/index.d.ts +4 -12
  4. package/badge/_badge-theme.scss +9 -0
  5. package/bottom-sheet/_bottom-sheet-theme.scss +7 -0
  6. package/button/_button-theme.scss +25 -0
  7. package/button/_fab-theme.scss +13 -0
  8. package/button/_icon-button-theme.scss +8 -0
  9. package/button-toggle/_button-toggle-theme.scss +12 -0
  10. package/card/_card-theme.scss +9 -0
  11. package/checkbox/_checkbox-theme.scss +2 -4
  12. package/chips/_chips-theme.scss +10 -0
  13. package/core/_core-theme.scss +17 -0
  14. package/core/m2/_index.scss +52 -0
  15. package/core/m2/_theming.scss +295 -0
  16. package/core/{typography/_property-getters.scss → m2/_typography-utils.scss} +14 -0
  17. package/core/{typography/_definition.scss → m2/_typography.scss} +1 -1
  18. package/core/option/_optgroup-theme.scss +7 -0
  19. package/core/option/_option-theme.scss +9 -0
  20. package/core/ripple/_ripple-theme.scss +7 -0
  21. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +13 -0
  22. package/core/style/_sass-utils.scss +14 -1
  23. package/core/theming/_color-api-backwards-compatibility.scss +128 -0
  24. package/core/theming/_config-validation.scss +173 -0
  25. package/core/theming/_definition.scss +113 -0
  26. package/core/theming/_m2-inspection.scss +23 -22
  27. package/core/theming/_palettes.scss +947 -0
  28. package/core/theming/_theming-deprecated.scss +9 -9
  29. package/core/theming/_theming.scss +73 -339
  30. package/core/tokens/_custom-tokens.scss +1918 -0
  31. package/core/tokens/_density.scss +191 -0
  32. package/core/tokens/_format-tokens.scss +5 -0
  33. package/core/tokens/_m3-tokens.scss +1252 -0
  34. package/core/tokens/_token-utils.scss +39 -49
  35. package/core/tokens/m2/mat/_chip.scss +3 -3
  36. package/core/tokens/m2/mat/_form-field.scss +3 -3
  37. package/core/tokens/m2/mdc/_checkbox.scss +3 -2
  38. package/core/tokens/m2/mdc/_chip.scss +3 -3
  39. package/core/tokens/m2/mdc/_radio.scss +3 -2
  40. package/core/typography/_all-typography.scss +3 -2
  41. package/core/typography/_typography-utils.scss +0 -26
  42. package/core/typography/_typography.scss +0 -2
  43. package/core/typography/_versioning.scss +3 -3
  44. package/datepicker/_datepicker-theme.scss +9 -0
  45. package/datepicker/index.d.ts +6 -4
  46. package/dialog/_dialog-theme.scss +8 -0
  47. package/divider/_divider-theme.scss +7 -0
  48. package/esm2022/autocomplete/autocomplete-origin.mjs +3 -3
  49. package/esm2022/autocomplete/autocomplete-trigger.mjs +13 -7
  50. package/esm2022/autocomplete/autocomplete.mjs +7 -36
  51. package/esm2022/autocomplete/module.mjs +4 -4
  52. package/esm2022/badge/badge-module.mjs +4 -4
  53. package/esm2022/badge/badge.mjs +6 -6
  54. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
  55. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +4 -4
  56. package/esm2022/bottom-sheet/bottom-sheet.mjs +3 -3
  57. package/esm2022/button/button-base.mjs +6 -6
  58. package/esm2022/button/button.mjs +6 -6
  59. package/esm2022/button/fab.mjs +12 -12
  60. package/esm2022/button/icon-button.mjs +6 -6
  61. package/esm2022/button/module.mjs +4 -4
  62. package/esm2022/button-toggle/button-toggle-module.mjs +4 -4
  63. package/esm2022/button-toggle/button-toggle.mjs +6 -6
  64. package/esm2022/card/card.mjs +42 -42
  65. package/esm2022/card/module.mjs +4 -4
  66. package/esm2022/checkbox/checkbox-required-validator.mjs +3 -3
  67. package/esm2022/checkbox/checkbox.mjs +3 -3
  68. package/esm2022/checkbox/module.mjs +8 -8
  69. package/esm2022/chips/chip-action.mjs +3 -3
  70. package/esm2022/chips/chip-edit-input.mjs +3 -3
  71. package/esm2022/chips/chip-grid.mjs +3 -3
  72. package/esm2022/chips/chip-icons.mjs +9 -9
  73. package/esm2022/chips/chip-input.mjs +3 -3
  74. package/esm2022/chips/chip-listbox.mjs +3 -3
  75. package/esm2022/chips/chip-option.mjs +3 -3
  76. package/esm2022/chips/chip-row.mjs +3 -3
  77. package/esm2022/chips/chip-set.mjs +3 -3
  78. package/esm2022/chips/chip.mjs +3 -3
  79. package/esm2022/chips/module.mjs +4 -4
  80. package/esm2022/core/common-behaviors/common-module.mjs +4 -4
  81. package/esm2022/core/datetime/index.mjs +8 -8
  82. package/esm2022/core/datetime/native-date-adapter.mjs +3 -3
  83. package/esm2022/core/error/error-options.mjs +6 -6
  84. package/esm2022/core/internal-form-field/internal-form-field.mjs +3 -3
  85. package/esm2022/core/line/line.mjs +7 -7
  86. package/esm2022/core/option/index.mjs +4 -4
  87. package/esm2022/core/option/optgroup.mjs +3 -3
  88. package/esm2022/core/option/option.mjs +3 -3
  89. package/esm2022/core/private/ripple-loader.mjs +3 -3
  90. package/esm2022/core/ripple/index.mjs +4 -4
  91. package/esm2022/core/ripple/ripple.mjs +3 -3
  92. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +4 -4
  93. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +3 -3
  94. package/esm2022/core/version.mjs +1 -1
  95. package/esm2022/datepicker/calendar-body.mjs +3 -3
  96. package/esm2022/datepicker/calendar.mjs +6 -6
  97. package/esm2022/datepicker/date-range-input-parts.mjs +9 -9
  98. package/esm2022/datepicker/date-range-input.mjs +9 -4
  99. package/esm2022/datepicker/date-range-picker.mjs +3 -3
  100. package/esm2022/datepicker/date-range-selection-strategy.mjs +3 -3
  101. package/esm2022/datepicker/date-selection-model.mjs +9 -9
  102. package/esm2022/datepicker/datepicker-actions.mjs +9 -9
  103. package/esm2022/datepicker/datepicker-base.mjs +10 -13
  104. package/esm2022/datepicker/datepicker-input-base.mjs +3 -3
  105. package/esm2022/datepicker/datepicker-input.mjs +3 -3
  106. package/esm2022/datepicker/datepicker-intl.mjs +3 -3
  107. package/esm2022/datepicker/datepicker-module.mjs +4 -4
  108. package/esm2022/datepicker/datepicker-toggle.mjs +6 -6
  109. package/esm2022/datepicker/datepicker.mjs +3 -3
  110. package/esm2022/datepicker/month-view.mjs +3 -3
  111. package/esm2022/datepicker/multi-year-view.mjs +3 -3
  112. package/esm2022/datepicker/year-view.mjs +3 -3
  113. package/esm2022/dialog/dialog-container.mjs +3 -3
  114. package/esm2022/dialog/dialog-content-directives.mjs +15 -15
  115. package/esm2022/dialog/dialog.mjs +3 -3
  116. package/esm2022/dialog/module.mjs +4 -4
  117. package/esm2022/divider/divider-module.mjs +4 -4
  118. package/esm2022/divider/divider.mjs +3 -3
  119. package/esm2022/expansion/accordion.mjs +3 -3
  120. package/esm2022/expansion/expansion-module.mjs +4 -4
  121. package/esm2022/expansion/expansion-panel-content.mjs +3 -3
  122. package/esm2022/expansion/expansion-panel-header.mjs +9 -9
  123. package/esm2022/expansion/expansion-panel.mjs +6 -6
  124. package/esm2022/form-field/directives/error.mjs +3 -3
  125. package/esm2022/form-field/directives/floating-label.mjs +3 -3
  126. package/esm2022/form-field/directives/hint.mjs +3 -3
  127. package/esm2022/form-field/directives/label.mjs +3 -3
  128. package/esm2022/form-field/directives/line-ripple.mjs +3 -3
  129. package/esm2022/form-field/directives/notched-outline.mjs +3 -3
  130. package/esm2022/form-field/directives/prefix.mjs +3 -3
  131. package/esm2022/form-field/directives/suffix.mjs +3 -3
  132. package/esm2022/form-field/form-field-control.mjs +4 -4
  133. package/esm2022/form-field/form-field.mjs +6 -6
  134. package/esm2022/form-field/module.mjs +4 -4
  135. package/esm2022/grid-list/grid-list-module.mjs +4 -4
  136. package/esm2022/grid-list/grid-list.mjs +3 -3
  137. package/esm2022/grid-list/grid-tile.mjs +15 -15
  138. package/esm2022/icon/icon-module.mjs +4 -4
  139. package/esm2022/icon/icon-registry.mjs +3 -3
  140. package/esm2022/icon/icon.mjs +3 -3
  141. package/esm2022/icon/testing/fake-icon-registry.mjs +7 -7
  142. package/esm2022/input/input.mjs +3 -3
  143. package/esm2022/input/module.mjs +4 -4
  144. package/esm2022/list/action-list.mjs +3 -3
  145. package/esm2022/list/list-base.mjs +6 -6
  146. package/esm2022/list/list-item-sections.mjs +18 -18
  147. package/esm2022/list/list-module.mjs +4 -4
  148. package/esm2022/list/list-option.mjs +3 -3
  149. package/esm2022/list/list.mjs +6 -6
  150. package/esm2022/list/nav-list.mjs +3 -3
  151. package/esm2022/list/selection-list.mjs +3 -3
  152. package/esm2022/list/subheader.mjs +3 -3
  153. package/esm2022/menu/menu-content.mjs +3 -3
  154. package/esm2022/menu/menu-item.mjs +3 -3
  155. package/esm2022/menu/menu-trigger.mjs +3 -3
  156. package/esm2022/menu/menu.mjs +21 -16
  157. package/esm2022/menu/module.mjs +4 -4
  158. package/esm2022/paginator/module.mjs +4 -4
  159. package/esm2022/paginator/paginator-intl.mjs +3 -3
  160. package/esm2022/paginator/paginator.mjs +3 -3
  161. package/esm2022/progress-bar/module.mjs +4 -4
  162. package/esm2022/progress-bar/progress-bar.mjs +5 -5
  163. package/esm2022/progress-spinner/module.mjs +4 -4
  164. package/esm2022/progress-spinner/progress-spinner.mjs +3 -3
  165. package/esm2022/radio/module.mjs +4 -4
  166. package/esm2022/radio/radio.mjs +6 -6
  167. package/esm2022/select/module.mjs +4 -4
  168. package/esm2022/select/select.mjs +12 -7
  169. package/esm2022/sidenav/drawer.mjs +9 -9
  170. package/esm2022/sidenav/sidenav-module.mjs +4 -4
  171. package/esm2022/sidenav/sidenav.mjs +9 -9
  172. package/esm2022/slide-toggle/module.mjs +8 -8
  173. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +3 -3
  174. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  175. package/esm2022/slider/module.mjs +4 -4
  176. package/esm2022/slider/slider-input.mjs +6 -6
  177. package/esm2022/slider/slider-thumb.mjs +3 -3
  178. package/esm2022/slider/slider.mjs +3 -3
  179. package/esm2022/snack-bar/module.mjs +4 -4
  180. package/esm2022/snack-bar/simple-snack-bar.mjs +3 -3
  181. package/esm2022/snack-bar/snack-bar-container.mjs +3 -3
  182. package/esm2022/snack-bar/snack-bar-content.mjs +9 -9
  183. package/esm2022/snack-bar/snack-bar.mjs +3 -3
  184. package/esm2022/sort/sort-header-intl.mjs +3 -3
  185. package/esm2022/sort/sort-header.mjs +3 -3
  186. package/esm2022/sort/sort-module.mjs +4 -4
  187. package/esm2022/sort/sort.mjs +3 -3
  188. package/esm2022/stepper/step-content.mjs +3 -3
  189. package/esm2022/stepper/step-header.mjs +3 -3
  190. package/esm2022/stepper/step-label.mjs +3 -3
  191. package/esm2022/stepper/stepper-button.mjs +6 -6
  192. package/esm2022/stepper/stepper-icon.mjs +3 -3
  193. package/esm2022/stepper/stepper-intl.mjs +3 -3
  194. package/esm2022/stepper/stepper-module.mjs +4 -4
  195. package/esm2022/stepper/stepper.mjs +6 -6
  196. package/esm2022/table/cell.mjs +21 -21
  197. package/esm2022/table/module.mjs +4 -4
  198. package/esm2022/table/row.mjs +21 -21
  199. package/esm2022/table/table.mjs +6 -6
  200. package/esm2022/table/text-column.mjs +3 -3
  201. package/esm2022/tabs/ink-bar.mjs +3 -3
  202. package/esm2022/tabs/module.mjs +4 -4
  203. package/esm2022/tabs/paginated-tab-header.mjs +3 -3
  204. package/esm2022/tabs/tab-body.mjs +6 -6
  205. package/esm2022/tabs/tab-content.mjs +3 -3
  206. package/esm2022/tabs/tab-group.mjs +6 -8
  207. package/esm2022/tabs/tab-header.mjs +3 -3
  208. package/esm2022/tabs/tab-label-wrapper.mjs +3 -3
  209. package/esm2022/tabs/tab-label.mjs +3 -3
  210. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +9 -9
  211. package/esm2022/tabs/tab.mjs +4 -4
  212. package/esm2022/toolbar/toolbar-module.mjs +4 -4
  213. package/esm2022/toolbar/toolbar.mjs +6 -6
  214. package/esm2022/tooltip/module.mjs +4 -4
  215. package/esm2022/tooltip/tooltip.mjs +6 -6
  216. package/esm2022/tree/node.mjs +9 -9
  217. package/esm2022/tree/outlet.mjs +3 -3
  218. package/esm2022/tree/padding.mjs +3 -3
  219. package/esm2022/tree/toggle.mjs +3 -3
  220. package/esm2022/tree/tree-module.mjs +4 -4
  221. package/esm2022/tree/tree.mjs +3 -3
  222. package/expansion/_expansion-theme.scss +7 -0
  223. package/fesm2022/autocomplete.mjs +26 -48
  224. package/fesm2022/autocomplete.mjs.map +1 -1
  225. package/fesm2022/badge.mjs +10 -10
  226. package/fesm2022/bottom-sheet.mjs +10 -10
  227. package/fesm2022/button-toggle.mjs +10 -10
  228. package/fesm2022/button.mjs +34 -34
  229. package/fesm2022/card.mjs +46 -46
  230. package/fesm2022/checkbox.mjs +14 -14
  231. package/fesm2022/chips.mjs +40 -40
  232. package/fesm2022/core.mjs +59 -59
  233. package/fesm2022/core.mjs.map +1 -1
  234. package/fesm2022/datepicker.mjs +89 -87
  235. package/fesm2022/datepicker.mjs.map +1 -1
  236. package/fesm2022/dialog.mjs +25 -25
  237. package/fesm2022/divider.mjs +7 -7
  238. package/fesm2022/expansion.mjs +25 -25
  239. package/fesm2022/form-field.mjs +36 -36
  240. package/fesm2022/form-field.mjs.map +1 -1
  241. package/fesm2022/grid-list.mjs +22 -22
  242. package/fesm2022/icon/testing.mjs +7 -7
  243. package/fesm2022/icon.mjs +10 -10
  244. package/fesm2022/input.mjs +7 -7
  245. package/fesm2022/list.mjs +49 -49
  246. package/fesm2022/menu.mjs +34 -28
  247. package/fesm2022/menu.mjs.map +1 -1
  248. package/fesm2022/paginator.mjs +10 -10
  249. package/fesm2022/progress-bar.mjs +8 -8
  250. package/fesm2022/progress-bar.mjs.map +1 -1
  251. package/fesm2022/progress-spinner.mjs +7 -7
  252. package/fesm2022/radio.mjs +10 -10
  253. package/fesm2022/select.mjs +15 -10
  254. package/fesm2022/select.mjs.map +1 -1
  255. package/fesm2022/sidenav.mjs +22 -22
  256. package/fesm2022/slide-toggle.mjs +14 -14
  257. package/fesm2022/slider.mjs +16 -16
  258. package/fesm2022/snack-bar.mjs +22 -22
  259. package/fesm2022/sort.mjs +13 -13
  260. package/fesm2022/stepper.mjs +31 -31
  261. package/fesm2022/table.mjs +55 -55
  262. package/fesm2022/tabs.mjs +46 -47
  263. package/fesm2022/tabs.mjs.map +1 -1
  264. package/fesm2022/toolbar.mjs +10 -10
  265. package/fesm2022/tooltip.mjs +10 -10
  266. package/fesm2022/tree.mjs +25 -25
  267. package/form-field/_form-field-theme.scss +15 -0
  268. package/form-field/index.d.ts +6 -0
  269. package/grid-list/_grid-list-theme.scss +7 -0
  270. package/icon/_icon-theme.scss +9 -0
  271. package/input/_input-theme.scss +8 -0
  272. package/list/_list-theme.scss +8 -0
  273. package/menu/_menu-theme.scss +7 -0
  274. package/menu/index.d.ts +1 -1
  275. package/package.json +3 -2
  276. package/paginator/_paginator-theme.scss +7 -0
  277. package/progress-bar/_progress-bar-theme.scss +11 -0
  278. package/progress-spinner/_progress-spinner-theme.scss +11 -0
  279. package/radio/_radio-theme.scss +10 -0
  280. package/schematics/collection.json +6 -0
  281. package/schematics/ng-add/index.js +1 -1
  282. package/schematics/ng-add/index.mjs +1 -1
  283. package/schematics/ng-add/theming/create-custom-theme.js +5 -6
  284. package/schematics/ng-add/theming/create-custom-theme.mjs +5 -6
  285. package/schematics/ng-generate/m3-theme/index_bundled.js +2682 -0
  286. package/schematics/ng-generate/m3-theme/index_bundled.js.map +7 -0
  287. package/schematics/ng-generate/m3-theme/schema.json +56 -0
  288. package/schematics/ng-update/index_bundled.js +215 -1
  289. package/schematics/ng-update/index_bundled.js.map +4 -4
  290. package/select/_select-theme.scss +9 -0
  291. package/select/index.d.ts +5 -0
  292. package/sidenav/_sidenav-theme.scss +7 -0
  293. package/slide-toggle/_slide-toggle-theme.scss +11 -0
  294. package/slider/_slider-theme.scss +10 -0
  295. package/snack-bar/_snack-bar-theme.scss +10 -0
  296. package/sort/_sort-theme.scss +7 -0
  297. package/stepper/_stepper-theme.scss +9 -0
  298. package/table/_table-theme.scss +7 -0
  299. package/tabs/_tabs-theme.scss +20 -0
  300. package/tabs/index.d.ts +2 -8
  301. package/toolbar/_toolbar-theme.scss +9 -0
  302. package/tooltip/_tooltip-theme.scss +8 -0
  303. package/tree/_tree-theme.scss +7 -0
  304. /package/core/{theming → m2}/_palette.scss +0 -0
@@ -0,0 +1,1918 @@
1
+ @use 'sass:map';
2
+ @use '../style/sass-utils';
3
+ @use '@material/elevation/elevation-theme' as mdc-elevation;
4
+
5
+ /// Hardcode the given value, or null if hardcoded values are excluded.
6
+ @function _hardcode($value, $exclude-hardcoded) {
7
+ @return if($exclude-hardcoded, null, $value);
8
+ }
9
+
10
+ /// Sets all of the standard typography tokens for the given token base name to the given typography
11
+ /// level.
12
+ /// @param {Map} $systems The MDC system tokens
13
+ /// @param {String} $base-name The token base name to get the typography tokens for
14
+ /// @param {String} $typography-level The typography level to base the token values on
15
+ /// @return {Map} A map containing the typography tokens for the given base token name
16
+ @function _generate-typography-tokens($systems, $base-name, $typography-level) {
17
+ $result: ();
18
+ @each $prop in (font, line-height, size, tracking, weight) {
19
+ $result: map.set($result, #{$base-name}-#{$prop},
20
+ map.get($systems, md-sys-typescale, #{$typography-level}-#{$prop}));
21
+ }
22
+ @return $result;
23
+ }
24
+
25
+ /// Generates custom tokens for the mat-autocomplete.
26
+ /// @param {Map} $systems The MDC system tokens
27
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
28
+ /// @return {Map} A set of custom tokens for the mat-autocomplete
29
+ @function autocomplete($systems, $exclude-hardcoded) {
30
+ @return (
31
+ background-color: map.get($systems, md-sys-color, surface-container),
32
+ container-shape: map.get($systems, md-sys-shape, corner-extra-small),
33
+ container-elevation-shadow:
34
+ _hardcode(mdc-elevation.elevation-box-shadow(2), $exclude-hardcoded),
35
+ );
36
+ }
37
+
38
+ /// Generates custom tokens for the app.
39
+ /// @param {Map} $systems The MDC system tokens
40
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
41
+ /// @return {Map} A set of custom tokens for the app
42
+ @function app($systems, $exclude-hardcoded) {
43
+ @return (
44
+ background-color: map.get($systems, md-sys-color, background),
45
+ text-color: map.get($systems, md-sys-color, on-background),
46
+ );
47
+ }
48
+
49
+ /// Generates custom tokens for the mat-badge.
50
+ /// @param {Map} $systems The MDC system tokens
51
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
52
+ /// @return {Map} A set of custom tokens for the mat-badge
53
+ @function badge($systems, $exclude-hardcoded) {
54
+ @return ((
55
+ background-color: map.get($systems, md-sys-color, error),
56
+ text-color: map.get($systems, md-sys-color, on-error),
57
+ disabled-state-background-color: sass-utils.safe-color-change(
58
+ map.get($systems, md-sys-color, error),
59
+ $alpha: 0.38,
60
+ ),
61
+ disabled-state-text-color: map.get($systems, md-sys-color, on-error),
62
+ text-font: map.get($systems, md-sys-typescale, label-small-font),
63
+ text-size: map.get($systems, md-sys-typescale, label-small-size),
64
+ text-weight: map.get($systems, md-sys-typescale, label-small-weight),
65
+ small-size-text-size: _hardcode(0, $exclude-hardcoded),
66
+ container-shape: map.get($systems, md-sys-shape, corner-full),
67
+ container-size: _hardcode(16px, $exclude-hardcoded),
68
+ legacy-container-size: _hardcode(unset, $exclude-hardcoded),
69
+ legacy-small-size-container-size: _hardcode(unset, $exclude-hardcoded),
70
+ small-size-container-size: _hardcode(6px, $exclude-hardcoded),
71
+ container-padding: _hardcode(0 4px, $exclude-hardcoded),
72
+ small-size-container-padding: _hardcode(0, $exclude-hardcoded),
73
+ container-offset: _hardcode(-12px 0, $exclude-hardcoded),
74
+ small-size-container-offset: _hardcode(-6px 0, $exclude-hardcoded),
75
+ container-overlap-offset: _hardcode(-12px, $exclude-hardcoded),
76
+ small-size-container-overlap-offset: _hardcode(-6px, $exclude-hardcoded),
77
+
78
+ // This size isn't in the M3 spec so we emit the same values as for `medium`.
79
+ large-size-container-size: _hardcode(16px, $exclude-hardcoded),
80
+ large-size-container-offset: _hardcode(-12px 0, $exclude-hardcoded),
81
+ large-size-container-overlap-offset: _hardcode(-12px, $exclude-hardcoded),
82
+ large-size-text-size: map.get($systems, md-sys-typescale, label-small-size),
83
+ large-size-container-padding: _hardcode(0 4px, $exclude-hardcoded),
84
+ legacy-large-size-container-size: _hardcode(unset, $exclude-hardcoded),
85
+ ), (
86
+ primary: (
87
+ background-color: map.get($systems, md-sys-color, primary),
88
+ text-color: map.get($systems, md-sys-color, on-primary),
89
+ disabled-state-background-color: sass-utils.safe-color-change(
90
+ map.get($systems, md-sys-color, primary),
91
+ $alpha: 0.38,
92
+ ),
93
+ disabled-state-text-color: map.get($systems, md-sys-color, on-primary),
94
+ ),
95
+ secondary: (
96
+ background-color: map.get($systems, md-sys-color, secondary),
97
+ text-color: map.get($systems, md-sys-color, on-secondary),
98
+ disabled-state-background-color: sass-utils.safe-color-change(
99
+ map.get($systems, md-sys-color, secondary),
100
+ $alpha: 0.38,
101
+ ),
102
+ disabled-state-text-color: map.get($systems, md-sys-color, on-secondary),
103
+ ),
104
+ tertiary: (
105
+ background-color: map.get($systems, md-sys-color, tertiary),
106
+ text-color: map.get($systems, md-sys-color, on-tertiary),
107
+ disabled-state-background-color: sass-utils.safe-color-change(
108
+ map.get($systems, md-sys-color, tertiary),
109
+ $alpha: 0.38,
110
+ ),
111
+ disabled-state-text-color: map.get($systems, md-sys-color, on-tertiary),
112
+ ),
113
+ error: () // Default, no overrides needed
114
+ ));
115
+ }
116
+
117
+ /// Generates custom tokens for the mat-bottom-sheet.
118
+ /// @param {Map} $systems The MDC system tokens
119
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
120
+ /// @return {Map} A set of custom tokens for the mat-bottom-sheet
121
+ @function bottom-sheet($systems, $exclude-hardcoded) {
122
+ @return sass-utils.merge-all(
123
+ _generate-typography-tokens($systems, container-text, body-large),
124
+ (
125
+ container-shape: _hardcode(28px, $exclude-hardcoded),
126
+ container-text-color: map.get($systems, md-sys-color, on-surface),
127
+ container-background-color: map.get($systems, md-sys-color, surface-container-low),
128
+ ),
129
+ );
130
+ }
131
+
132
+ /// Generates custom tokens for the mat-button-toggle.
133
+ /// @param {Map} $systems The MDC system tokens
134
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
135
+ /// @return {Map} A set of custom tokens for the mat-button-toggle
136
+ @function button-toggle($systems, $exclude-hardcoded) {
137
+ @return sass-utils.merge-all(
138
+ _generate-typography-tokens($systems, label-text, label-large),
139
+ (
140
+ shape: map.get($systems, md-sys-shape, corner-full),
141
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
142
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
143
+ text-color: map.get($systems, md-sys-color, on-surface),
144
+ background-color: _hardcode(transparent, $exclude-hardcoded),
145
+ state-layer-color: map.get($systems, md-sys-color, on-surface),
146
+ selected-state-background-color: map.get($systems, md-sys-color, secondary-container),
147
+ selected-state-text-color: map.get($systems, md-sys-color, on-secondary-container),
148
+ disabled-state-text-color: sass-utils.safe-color-change(
149
+ map.get($systems, md-sys-color, on-surface),
150
+ $alpha: 0.38,
151
+ ),
152
+ disabled-state-background-color: _hardcode(transparent, $exclude-hardcoded),
153
+ disabled-selected-state-text-color: sass-utils.safe-color-change(
154
+ map.get($systems, md-sys-color, on-surface),
155
+ $alpha: 0.38,
156
+ ),
157
+ disabled-selected-state-background-color: sass-utils.safe-color-change(
158
+ map.get($systems, md-sys-color, on-surface),
159
+ $alpha: 0.12,
160
+ ),
161
+ divider-color: map.get($systems, md-sys-color, outline),
162
+ ), (
163
+ // Color variants:
164
+ primary: (
165
+ selected-state-background-color: map.get($systems, md-sys-color, primary-container),
166
+ selected-state-text-color: map.get($systems, md-sys-color, on-primary-container),
167
+ ),
168
+ secondary: (), // Default, no overrides needed
169
+ tertiary: (
170
+ selected-state-background-color: map.get($systems, md-sys-color, tertiary-container),
171
+ selected-state-text-color: map.get($systems, md-sys-color, on-tertiary-container),
172
+ ),
173
+ error: (
174
+ selected-state-background-color: map.get($systems, md-sys-color, error-container),
175
+ selected-state-text-color: map.get($systems, md-sys-color, on-error-container),
176
+ )
177
+ ));
178
+ }
179
+
180
+ /// Generates custom tokens for the mat-card.
181
+ /// @param {Map} $systems The MDC system tokens
182
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
183
+ /// @return {Map} A set of custom tokens for the mat-card
184
+ @function card($systems, $exclude-hardcoded) {
185
+ @return sass-utils.merge-all(
186
+ _generate-typography-tokens($systems, title-text, title-large),
187
+ _generate-typography-tokens($systems, subtitle-text, title-medium),
188
+ (
189
+ subtitle-text-color: map.get($systems, md-sys-color, on-surface)
190
+ )
191
+ );
192
+ }
193
+
194
+ /// Generates custom tokens for the mat-chip.
195
+ /// @param {Map} $systems The MDC system tokens
196
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
197
+ /// @return {Map} A set of custom tokens for the mat-chip
198
+ @function chip($systems, $exclude-hardcoded) {
199
+ @return ((
200
+ disabled-container-opacity: _hardcode(1, $exclude-hardcoded),
201
+ selected-trailing-icon-color: map.get($systems, md-sys-color, on-secondary-container),
202
+ selected-disabled-trailing-icon-color: map.get($systems, md-sys-color, on-surface),
203
+ trailing-action-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
204
+ selected-trailing-action-state-layer-color:
205
+ map.get($systems, md-sys-color, on-secondary-container),
206
+ trailing-action-hover-state-layer-opacity:
207
+ map.get($systems, md-sys-state, hover-state-layer-opacity),
208
+ trailing-action-focus-state-layer-opacity:
209
+ map.get($systems, md-sys-state, focus-state-layer-opacity),
210
+ trailing-action-opacity: _hardcode(1, $exclude-hardcoded),
211
+ trailing-action-focus-opacity: _hardcode(1, $exclude-hardcoded),
212
+ ), (
213
+ primary: (
214
+ selected-trailing-icon-color: map.get($systems, md-sys-color, on-primary-container),
215
+ selected-trailing-action-state-layer-color:
216
+ map.get($systems, md-sys-color, on-primary-container),
217
+ ),
218
+ secondary: (), // Default, no overrides needed.
219
+ tertiary: (
220
+ selected-trailing-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
221
+ selected-trailing-action-state-layer-color:
222
+ map.get($systems, md-sys-color, on-tertiary-container),
223
+ ),
224
+ error: (
225
+ selected-trailing-icon-color: map.get($systems, md-sys-color, on-error-container),
226
+ selected-trailing-action-state-layer-color:
227
+ map.get($systems, md-sys-color, on-error-container),
228
+ ),
229
+ ));
230
+ }
231
+
232
+ /// Generates custom tokens for the mdc-chip. (MDC has a chip component, but they
233
+ /// seem to have made up the tokens rather than using ones generated from the token database,
234
+ /// therefore we need a custom token function for it).
235
+ /// @param {Map} $systems The MDC system tokens
236
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
237
+ /// @return {Map} A set of custom tokens for the mdc-chip
238
+ @function mdc-chip($systems, $exclude-hardcoded) {
239
+ @return (sass-utils.merge-all(
240
+ _generate-typography-tokens($systems, label-text, label-large),
241
+ (
242
+ container-shape: _hardcode((
243
+ family: rounded,
244
+ radius: 8px,
245
+ ), $exclude-hardcoded),
246
+ with-avatar-avatar-size: _hardcode(24px, $exclude-hardcoded),
247
+ label-text-color: map.get($systems, md-sys-color, on-surface-variant),
248
+ disabled-label-text-color: sass-utils.safe-color-change(
249
+ map.get($systems, md-sys-color, on-surface),
250
+ $alpha: 0.38,
251
+ ),
252
+ with-icon-icon-size: _hardcode(18px, $exclude-hardcoded),
253
+ with-icon-icon-color: map.get($systems, md-sys-color, on-surface-variant),
254
+ with-icon-disabled-icon-color: map.get($systems, md-sys-color, on-surface),
255
+ with-icon-selected-icon-color: map.get($systems, md-sys-color, on-secondary-container),
256
+ with-trailing-icon-trailing-icon-color: map.get($systems, md-sys-color, on-surface-variant),
257
+ with-trailing-icon-disabled-trailing-icon-color: map.get($systems, md-sys-color, on-surface),
258
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
259
+ focus-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
260
+ outline-width: _hardcode(1px, $exclude-hardcoded),
261
+ outline-color: map.get($systems, md-sys-color, outline),
262
+ disabled-outline-color: sass-utils.safe-color-change(
263
+ map.get($systems, md-sys-color, on-surface),
264
+ $alpha: 0.12,
265
+ ),
266
+ focus-outline-color: map.get($systems, md-sys-color, on-surface-variant),
267
+ hover-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
268
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
269
+ with-avatar-disabled-avatar-opacity: _hardcode(0.38, $exclude-hardcoded),
270
+ elevated-selected-container-color: map.get($systems, md-sys-color, secondary-container),
271
+ flat-selected-outline-width: _hardcode(0, $exclude-hardcoded),
272
+ selected-label-text-color: map.get($systems, md-sys-color, on-secondary-container),
273
+ flat-disabled-selected-container-color: sass-utils.safe-color-change(
274
+ map.get($systems, md-sys-color, on-surface),
275
+ $alpha: 0.12,
276
+ ),
277
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, on-secondary-container),
278
+ selected-hover-state-layer-opacity:
279
+ map.get($systems, md-sys-state, hover-state-layer-opacity),
280
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, on-secondary-container),
281
+ selected-focus-state-layer-opacity:
282
+ map.get($systems, md-sys-state, focus-state-layer-opacity),
283
+ with-icon-disabled-icon-opacity: _hardcode(0.38, $exclude-hardcoded),
284
+ with-trailing-icon-disabled-trailing-icon-opacity: _hardcode(0.38, $exclude-hardcoded),
285
+ ),
286
+ ), (
287
+ // Color variants:
288
+ primary: (
289
+ with-icon-selected-icon-color: map.get($systems, md-sys-color, on-primary-container),
290
+ elevated-selected-container-color: map.get($systems, md-sys-color, primary-container),
291
+ selected-label-text-color: map.get($systems, md-sys-color, on-primary-container),
292
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, on-primary-container),
293
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, on-primary-container),
294
+ ),
295
+ secondary: (), // Default, no overrides needed.
296
+ tertiary: (
297
+ with-icon-selected-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
298
+ elevated-selected-container-color: map.get($systems, md-sys-color, tertiary-container),
299
+ selected-label-text-color: map.get($systems, md-sys-color, on-tertiary-container),
300
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, on-tertiary-container),
301
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, on-tertiary-container),
302
+ ),
303
+ error: (
304
+ with-icon-selected-icon-color: map.get($systems, md-sys-color, on-error-container),
305
+ elevated-selected-container-color: map.get($systems, md-sys-color, error-container),
306
+ selected-label-text-color: map.get($systems, md-sys-color, on-error-container),
307
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, on-error-container),
308
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, on-error-container),
309
+ )
310
+ ));
311
+ }
312
+
313
+ /// Generates custom tokens for the mat-datepicker.
314
+ /// @param {Map} $systems The MDC system tokens
315
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
316
+ /// @return {Map} A set of custom tokens for the mat-datepicker
317
+ @function datepicker($systems, $exclude-hardcoded) {
318
+ @return ((
319
+ calendar-date-in-range-state-background-color:
320
+ map.get($systems, md-sys-color, primary-container),
321
+ calendar-date-in-comparison-range-state-background-color:
322
+ map.get($systems, md-sys-color, tertiary-container),
323
+ calendar-date-in-overlap-range-state-background-color:
324
+ map.get($systems, md-sys-color, secondary-container),
325
+ calendar-date-in-overlap-range-selected-state-background-color:
326
+ map.get($systems, md-sys-color, secondary),
327
+ calendar-date-selected-state-text-color: map.get($systems, md-sys-color, on-primary),
328
+ calendar-date-selected-state-background-color: map.get($systems, md-sys-color, primary),
329
+ calendar-date-selected-disabled-state-background-color: sass-utils.safe-color-change(
330
+ map.get($systems, md-sys-color, on-surface),
331
+ $alpha: 0.38
332
+ ),
333
+ calendar-date-today-selected-state-outline-color: map.get($systems, md-sys-color, primary),
334
+ calendar-date-focus-state-background-color: sass-utils.safe-color-change(
335
+ map.get($systems, md-sys-color, on-surface),
336
+ $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
337
+ ),
338
+ calendar-date-hover-state-background-color: sass-utils.safe-color-change(
339
+ map.get($systems, md-sys-color, on-surface),
340
+ $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
341
+ ),
342
+ toggle-active-state-icon-color: map.get($systems, md-sys-color, on-surface-variant),
343
+ toggle-icon-color: map.get($systems, md-sys-color, on-surface-variant),
344
+ calendar-body-label-text-color: map.get($systems, md-sys-color, on-surface),
345
+ calendar-period-button-text-color: map.get($systems, md-sys-color, on-surface-variant),
346
+ calendar-period-button-icon-color: map.get($systems, md-sys-color, on-surface-variant),
347
+ calendar-navigation-button-icon-color: map.get($systems, md-sys-color, on-surface-variant),
348
+ calendar-header-divider-color: _hardcode(transparent, $exclude-hardcoded),
349
+ calendar-header-text-color: map.get($systems, md-sys-color, on-surface-variant),
350
+ calendar-date-today-outline-color: map.get($systems, md-sys-color, primary),
351
+ calendar-date-today-disabled-state-outline-color: sass-utils.safe-color-change(
352
+ map.get($systems, md-sys-color, on-surface),
353
+ $alpha: 0.38
354
+ ),
355
+ calendar-date-text-color: map.get($systems, md-sys-color, on-surface),
356
+ calendar-date-outline-color: _hardcode(transparent, $exclude-hardcoded),
357
+ calendar-date-disabled-state-text-color: sass-utils.safe-color-change(
358
+ map.get($systems, md-sys-color, on-surface),
359
+ $alpha: 0.38
360
+ ),
361
+ calendar-date-preview-state-outline-color: map.get($systems, md-sys-color, primary),
362
+ range-input-separator-color: map.get($systems, md-sys-color, on-surface),
363
+ range-input-disabled-state-separator-color: sass-utils.safe-color-change(
364
+ map.get($systems, md-sys-color, on-surface),
365
+ $alpha: 0.38
366
+ ),
367
+ range-input-disabled-state-text-color: sass-utils.safe-color-change(
368
+ map.get($systems, md-sys-color, on-surface),
369
+ $alpha: 0.38
370
+ ),
371
+ calendar-container-background-color: map.get($systems, md-sys-color, surface-container-high),
372
+ calendar-container-text-color: map.get($systems, md-sys-color, on-surface),
373
+ calendar-container-elevation-shadow: _hardcode(mdc-elevation.elevation-box-shadow(0),
374
+ $exclude-hardcoded),
375
+ calendar-container-touch-elevation-shadow: _hardcode(mdc-elevation.elevation-box-shadow(0),
376
+ $exclude-hardcoded),
377
+ calendar-container-shape: map.get($systems, md-sys-shape, corner-large),
378
+ calendar-container-touch-shape: map.get($systems, md-sys-shape, corner-extra-large),
379
+ calendar-text-font: map.get($systems, md-sys-typescale, body-large-font),
380
+ calendar-text-size: map.get($systems, md-sys-typescale, body-large-size),
381
+ calendar-body-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
382
+ calendar-body-label-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
383
+ calendar-period-button-text-size: map.get($systems, md-sys-typescale, title-small-size),
384
+ calendar-period-button-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
385
+ calendar-header-text-size: map.get($systems, md-sys-typescale, title-small-size),
386
+ calendar-header-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
387
+ ), (
388
+ // Color variants:
389
+ primary: (), // Default, no overrides needed.
390
+ secondary: (
391
+ calendar-date-in-range-state-background-color:
392
+ map.get($systems, md-sys-color, secondary-container),
393
+ calendar-date-selected-state-text-color: map.get($systems, md-sys-color, on-secondary),
394
+ calendar-date-selected-state-background-color: map.get($systems, md-sys-color, secondary),
395
+ calendar-date-today-selected-state-outline-color: map.get($systems, md-sys-color, secondary),
396
+ calendar-date-today-outline-color: map.get($systems, md-sys-color, secondary),
397
+ calendar-date-preview-state-outline-color: map.get($systems, md-sys-color, secondary),
398
+ calendar-date-in-overlap-range-state-background-color:
399
+ map.get($systems, md-sys-color, primary-container),
400
+ calendar-date-in-overlap-range-selected-state-background-color:
401
+ map.get($systems, md-sys-color, primary),
402
+ ),
403
+ tertiary: (
404
+ calendar-date-in-range-state-background-color:
405
+ map.get($systems, md-sys-color, tertiary-container),
406
+ calendar-date-selected-state-text-color: map.get($systems, md-sys-color, on-tertiary),
407
+ calendar-date-selected-state-background-color: map.get($systems, md-sys-color, tertiary),
408
+ calendar-date-today-selected-state-outline-color: map.get($systems, md-sys-color, tertiary),
409
+ calendar-date-today-outline-color: map.get($systems, md-sys-color, tertiary),
410
+ calendar-date-preview-state-outline-color: map.get($systems, md-sys-color, tertiary),
411
+ calendar-date-in-comparison-range-state-background-color:
412
+ map.get($systems, md-sys-color, primary-container),
413
+ ),
414
+ error: (
415
+ calendar-date-in-range-state-background-color:
416
+ map.get($systems, md-sys-color, error-container),
417
+ calendar-date-selected-state-text-color: map.get($systems, md-sys-color, on-error),
418
+ calendar-date-selected-state-background-color: map.get($systems, md-sys-color, error),
419
+ calendar-date-today-selected-state-outline-color: map.get($systems, md-sys-color, error),
420
+ calendar-date-today-outline-color: map.get($systems, md-sys-color, error),
421
+ calendar-date-preview-state-outline-color: map.get($systems, md-sys-color, error),
422
+ )
423
+ ));
424
+ }
425
+
426
+ /// Generates custom tokens for the dialog.
427
+ /// @param {Map} $systems The MDC system tokens
428
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
429
+ /// @return {Map} A set of custom tokens for the dialog
430
+ @function dialog($systems, $exclude-hardcoded) {
431
+ @return (
432
+ container-max-width: _hardcode(560px, $exclude-hardcoded),
433
+ container-small-max-width: _hardcode(calc(100vw - 32px), $exclude-hardcoded),
434
+ container-min-width: _hardcode(280px, $exclude-hardcoded),
435
+ actions-alignment: _hardcode(flex-end, $exclude-hardcoded),
436
+ content-padding: _hardcode(20px 24px, $exclude-hardcoded),
437
+ with-actions-content-padding: _hardcode(20px 24px 0, $exclude-hardcoded),
438
+ actions-padding: _hardcode(16px 24px, $exclude-hardcoded),
439
+
440
+ // The vertical padding values are a bit weird, because MDC uses a `::before` pseudo
441
+ // element to size the title which in turn means that we can't set a specific padding
442
+ // and get the exact same space out of it. These values were determined through
443
+ // trial and error so that the first line of text is 24px from the top and the bottom
444
+ // of the text is 16px from the content under it.
445
+ headline-padding: _hardcode(6px 24px 13px, $exclude-hardcoded),
446
+ );
447
+ }
448
+
449
+ /// Generates custom tokens for the mat-divider.
450
+ /// @param {Map} $systems The MDC system tokens
451
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
452
+ /// @return {Map} A set of custom tokens for the mat-divider
453
+ @function divider($systems, $exclude-hardcoded) {
454
+ @return (
455
+ width: _hardcode(1px, $exclude-hardcoded),
456
+ color: map.get($systems, md-sys-color, outline-variant),
457
+ );
458
+ }
459
+
460
+ /// Generates custom tokens for the mat-expansion.
461
+ /// @param {Map} $systems The MDC system tokens
462
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
463
+ /// @return {Map} A set of custom tokens for the mat-expansion
464
+ @function expansion($systems, $exclude-hardcoded) {
465
+ @return sass-utils.merge-all(
466
+ _generate-typography-tokens($systems, header-text, title-medium),
467
+ _generate-typography-tokens($systems, container-text, body-large),
468
+ (
469
+ container-shape: _hardcode(12px, $exclude-hardcoded),
470
+ legacy-header-indicator-display: _hardcode(none, $exclude-hardcoded),
471
+ header-indicator-display: _hardcode(inline-block, $exclude-hardcoded),
472
+ container-background-color: map.get($systems, md-sys-color, surface),
473
+ container-text-color: map.get($systems, md-sys-color, on-surface),
474
+ actions-divider-color: map.get($systems, md-sys-color, outline-variant),
475
+ header-hover-state-layer-color: sass-utils.safe-color-change(
476
+ map.get($systems, md-sys-color, on-surface),
477
+ $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
478
+ ),
479
+ header-focus-state-layer-color: sass-utils.safe-color-change(
480
+ map.get($systems, md-sys-color, on-surface),
481
+ $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
482
+ ),
483
+ header-disabled-state-text-color: sass-utils.safe-color-change(
484
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
485
+ header-text-color: map.get($systems, md-sys-color, on-surface),
486
+ header-description-color: map.get($systems, md-sys-color, on-surface-variant),
487
+ header-indicator-color: map.get($systems, md-sys-color, on-surface-variant),
488
+ )
489
+ );
490
+ }
491
+
492
+ /// Generates custom tokens for the mat-fab.
493
+ /// @param {Map} $systems The MDC system tokens
494
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
495
+ /// @return {Map} A set of custom tokens for the mat-fab
496
+ @function fab($systems, $exclude-hardcoded) {
497
+ @return ((
498
+ foreground-color: map.get($systems, md-sys-color, on-primary-container),
499
+ state-layer-color: map.get($systems, md-sys-color, on-primary-container),
500
+ ripple-color: sass-utils.safe-color-change(
501
+ map.get($systems, md-sys-color, on-primary-container),
502
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
503
+ ),
504
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
505
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
506
+ pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
507
+ disabled-state-container-color: sass-utils.safe-color-change(
508
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.12),
509
+ disabled-state-foreground-color: sass-utils.safe-color-change(
510
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
511
+ ), (
512
+ // Color variants
513
+ primary: (), // Default, no overrides needed.
514
+ secondary: (
515
+ foreground-color: map.get($systems, md-sys-color, on-secondary-container),
516
+ state-layer-color: map.get($systems, md-sys-color, on-secondary-container),
517
+ ripple-color: sass-utils.safe-color-change(
518
+ map.get($systems, md-sys-color, on-secondary-container),
519
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
520
+ ),
521
+ ),
522
+ tertiary: (
523
+ foreground-color: map.get($systems, md-sys-color, on-tertiary-container),
524
+ state-layer-color: map.get($systems, md-sys-color, on-tertiary-container),
525
+ ripple-color: sass-utils.safe-color-change(
526
+ map.get($systems, md-sys-color, on-tertiary-container),
527
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
528
+ ),
529
+ )
530
+ ));
531
+ }
532
+
533
+ /// Generates custom tokens for the mat-mini-fab.
534
+ /// @param {Map} $systems The MDC system tokens
535
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
536
+ /// @return {Map} A set of custom tokens for the mat-mini-fab
537
+ @function fab-small($systems, $exclude-hardcoded) {
538
+ @return ((
539
+ foreground-color: map.get($systems, md-sys-color, on-primary-container),
540
+ state-layer-color: map.get($systems, md-sys-color, on-primary-container),
541
+ ripple-color: sass-utils.safe-color-change(
542
+ map.get($systems, md-sys-color, on-primary-container),
543
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
544
+ ),
545
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
546
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
547
+ pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
548
+ disabled-state-container-color: sass-utils.safe-color-change(
549
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.12),
550
+ disabled-state-foreground-color: sass-utils.safe-color-change(
551
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
552
+ ), (
553
+ // Color variants
554
+ primary: (), // Default, no overrides needed.
555
+ secondary: (
556
+ foreground-color: map.get($systems, md-sys-color, on-secondary-container),
557
+ state-layer-color: map.get($systems, md-sys-color, on-secondary-container),
558
+ ripple-color: sass-utils.safe-color-change(
559
+ map.get($systems, md-sys-color, on-secondary-container),
560
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
561
+ ),
562
+ ),
563
+ tertiary: (
564
+ foreground-color: map.get($systems, md-sys-color, on-tertiary-container),
565
+ state-layer-color: map.get($systems, md-sys-color, on-tertiary-container),
566
+ ripple-color: sass-utils.safe-color-change(
567
+ map.get($systems, md-sys-color, on-tertiary-container),
568
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
569
+ ),
570
+ )
571
+ ));
572
+ }
573
+
574
+ /// Generates custom tokens for the mat-form-field.
575
+ /// @param {Map} $systems The MDC system tokens
576
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
577
+ /// @return {Map} A set of custom tokens for the mat-form-field
578
+ @function form-field($systems, $exclude-hardcoded) {
579
+ @return (sass-utils.merge-all(
580
+ _generate-typography-tokens($systems, container-text, body-large),
581
+ _generate-typography-tokens($systems, subscript-text, body-small),
582
+ (
583
+ disabled-input-text-placeholder-color: sass-utils.safe-color-change(
584
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
585
+ state-layer-color: map.get($systems, md-sys-color, on-surface),
586
+ error-text-color: map.get($systems, md-sys-color, error),
587
+ select-option-text-color: map.get($systems, md-ref-palette, neutral10),
588
+ select-disabled-option-text-color: sass-utils.safe-color-change(
589
+ map.get($systems, md-ref-palette, neutral10), $alpha: 0.38),
590
+ enabled-select-arrow-color: map.get($systems, md-sys-color, on-surface-variant),
591
+ disabled-select-arrow-color: sass-utils.safe-color-change(
592
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
593
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
594
+ focus-state-layer-opacity: _hardcode(0, $exclude-hardcoded),
595
+ focus-select-arrow-color: map.get($systems, md-sys-color, primary),
596
+ outlined-label-text-populated-size: map.get($systems, md-sys-typeface, body-large-size),
597
+
598
+ leading-icon-color: map.get($systems, md-sys-color, on-surface-variant),
599
+ disabled-leading-icon-color: sass-utils.safe-color-change(
600
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
601
+
602
+ trailing-icon-color: map.get($systems, md-sys-color, on-surface-variant),
603
+ disabled-trailing-icon-color: sass-utils.safe-color-change(
604
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
605
+ error-focus-trailing-icon-color: map.get($systems, md-sys-color, error),
606
+ error-hover-trailing-icon-color: map.get($systems, md-sys-color, on-error-container),
607
+ error-trailing-icon-color: map.get($systems, md-sys-color, error),
608
+ )
609
+ ), (
610
+ // Color variants:
611
+ primary: (), // Default, no overrides needed.
612
+ secondary: (
613
+ focus-select-arrow-color: map.get($systems, md-sys-color, secondary),
614
+ ),
615
+ tertiary: (
616
+ focus-select-arrow-color: map.get($systems, md-sys-color, tertiary),
617
+ ),
618
+ error: (
619
+ focus-select-arrow-color: map.get($systems, md-sys-color, error),
620
+ )
621
+ ));
622
+ }
623
+
624
+ /// Generates custom tokens for the mat-grid-list.
625
+ /// @param {Map} $systems The MDC system tokens
626
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
627
+ /// @return {Map} A set of custom tokens for the mat-grid-list
628
+ @function grid-list($systems, $exclude-hardcoded) {
629
+ @return (
630
+ tile-header-primary-text-size: map.get($systems, md-sys-typescale, body-large),
631
+ tile-header-secondary-text-size: map.get($systems, md-sys-typescale, body-medium),
632
+ tile-footer-primary-text-size: map.get($systems, md-sys-typescale, body-large),
633
+ tile-footer-secondary-text-size: map.get($systems, md-sys-typescale, body-medium),
634
+ );
635
+ }
636
+
637
+ /// Generates custom tokens for the mat-icon.
638
+ /// @param {Map} $systems The MDC system tokens
639
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
640
+ /// @return {Map} A set of custom tokens for the mat-icon
641
+ @function icon($systems, $exclude-hardcoded) {
642
+ @return ((
643
+ color: _hardcode(inherit, $exclude-hardcoded),
644
+ ), (
645
+ // Color variants:
646
+ surface: (), // Default, no overrides needed.
647
+ primary: (
648
+ color: map.get($systems, md-sys-color, primary),
649
+ ),
650
+ secondary: (
651
+ color: map.get($systems, md-sys-color, secondary),
652
+ ),
653
+ tertiary: (
654
+ color: map.get($systems, md-sys-color, tertiary),
655
+ ),
656
+ error: (
657
+ color: map.get($systems, md-sys-color, error),
658
+ )
659
+ ));
660
+ }
661
+
662
+ /// Generates custom tokens for the mat-list.
663
+ /// @param {Map} $systems The MDC system tokens
664
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
665
+ /// @return {Map} A set of custom tokens for the mat-list
666
+ @function list($systems, $exclude-hardcoded) {
667
+ @return (
668
+ active-indicator-color: map.get($systems, md-sys-color, secondary-container),
669
+ active-indicator-shape: map.get($systems, md-sys-shape, corner-full),
670
+ );
671
+ }
672
+
673
+ /// Generates custom tokens for the mat-button.
674
+ /// @param {Map} $systems The MDC system tokens
675
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
676
+ /// @return {Map} A set of custom tokens for the mat-button
677
+ @function text-button($systems, $exclude-hardcoded) {
678
+ @return ((
679
+ horizontal-padding: _hardcode(12px, $exclude-hardcoded),
680
+ with-icon-horizontal-padding: _hardcode(16px, $exclude-hardcoded),
681
+ icon-spacing: _hardcode(8px, $exclude-hardcoded),
682
+ icon-offset: _hardcode(-4px, $exclude-hardcoded),
683
+ state-layer-color: map.get($systems, md-sys-color, primary),
684
+ disabled-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
685
+ ripple-color: sass-utils.safe-color-change(
686
+ map.get($systems, md-sys-color, primary),
687
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
688
+ ),
689
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
690
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
691
+ pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
692
+ ), (
693
+ // Color variants:
694
+ primary: (), // Default, no overrides needed.
695
+ secondary: (
696
+ state-layer-color: map.get($systems, md-sys-color, secondary),
697
+ ripple-color: sass-utils.safe-color-change(
698
+ map.get($systems, md-sys-color, secondary),
699
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
700
+ )
701
+ ),
702
+ tertiary: (
703
+ state-layer-color: map.get($systems, md-sys-color, tertiary),
704
+ ripple-color: sass-utils.safe-color-change(
705
+ map.get($systems, md-sys-color, tertiary),
706
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
707
+ )
708
+ ),
709
+ error: (
710
+ state-layer-color: map.get($systems, md-sys-color, error),
711
+ ripple-color: sass-utils.safe-color-change(
712
+ map.get($systems, md-sys-color, error),
713
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
714
+ )
715
+ )
716
+ ));
717
+ }
718
+
719
+ /// Generates custom tokens for the mat-flat-button.
720
+ /// @param {Map} $systems The MDC system tokens
721
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
722
+ /// @return {Map} A set of custom tokens for the mat-flat-button
723
+ @function filled-button($systems, $exclude-hardcoded) {
724
+ @return ((
725
+ horizontal-padding: _hardcode(24px, $exclude-hardcoded),
726
+ icon-spacing: _hardcode(8px, $exclude-hardcoded),
727
+ icon-offset: _hardcode(-8px, $exclude-hardcoded),
728
+ state-layer-color: map.get($systems, md-sys-color, on-primary),
729
+ disabled-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
730
+ ripple-color: sass-utils.safe-color-change(
731
+ map.get($systems, md-sys-color, on-primary),
732
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
733
+ ),
734
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
735
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
736
+ pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
737
+ ), (
738
+ // Color variants:
739
+ primary: (), // Default, no overrides needed.
740
+ secondary: (
741
+ state-layer-color: map.get($systems, md-sys-color, on-secondary),
742
+ ripple-color: sass-utils.safe-color-change(
743
+ map.get($systems, md-sys-color, on-secondary),
744
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
745
+ ),
746
+ ),
747
+ tertiary: (
748
+ state-layer-color: map.get($systems, md-sys-color, on-tertiary),
749
+ ripple-color: sass-utils.safe-color-change(
750
+ map.get($systems, md-sys-color, on-tertiary),
751
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
752
+ ),
753
+ ),
754
+ error: (
755
+ state-layer-color: map.get($systems, md-sys-color, on-error),
756
+ ripple-color: sass-utils.safe-color-change(
757
+ map.get($systems, md-sys-color, on-error),
758
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
759
+ ),
760
+ )
761
+ ));
762
+ }
763
+
764
+ /// Generates custom tokens for the mat-raised-button.
765
+ /// @param {Map} $systems The MDC system tokens
766
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
767
+ /// @return {Map} A set of custom tokens for the mat-raised-button
768
+ @function elevated-button($systems, $exclude-hardcoded) {
769
+ @return ((
770
+ horizontal-padding: _hardcode(24px, $exclude-hardcoded),
771
+ icon-spacing: _hardcode(8px, $exclude-hardcoded),
772
+ icon-offset: _hardcode(-8px, $exclude-hardcoded),
773
+ state-layer-color: map.get($systems, md-sys-color, primary),
774
+ disabled-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
775
+ ripple-color: sass-utils.safe-color-change(
776
+ map.get($systems, md-sys-color, primary),
777
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
778
+ ),
779
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
780
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
781
+ pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
782
+ ), (
783
+ // Color variants:
784
+ primary: (), // Default, no overrides needed.
785
+ secondary: (
786
+ state-layer-color: map.get($systems, md-sys-color, secondary),
787
+ ripple-color: sass-utils.safe-color-change(
788
+ map.get($systems, md-sys-color, secondary),
789
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
790
+ ),
791
+ ),
792
+ tertiary: (
793
+ state-layer-color: map.get($systems, md-sys-color, tertiary),
794
+ ripple-color: sass-utils.safe-color-change(
795
+ map.get($systems, md-sys-color, tertiary),
796
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
797
+ ),
798
+ ),
799
+ error: (
800
+ state-layer-color: map.get($systems, md-sys-color, error),
801
+ ripple-color: sass-utils.safe-color-change(
802
+ map.get($systems, md-sys-color, error),
803
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
804
+ ),
805
+ )
806
+ ));
807
+ }
808
+
809
+ /// Generates custom tokens for the mat-outlined-button.
810
+ /// @param {Map} $systems The MDC system tokens
811
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
812
+ /// @return {Map} A set of custom tokens for the mat-outlined-button
813
+ @function outlined-button($systems, $exclude-hardcoded) {
814
+ @return ((
815
+ horizontal-padding: _hardcode(24px, $exclude-hardcoded),
816
+ icon-spacing: _hardcode(8px, $exclude-hardcoded),
817
+ icon-offset: _hardcode(-8px, $exclude-hardcoded),
818
+ state-layer-color: map.get($systems, md-sys-color, primary),
819
+ disabled-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
820
+ ripple-color: sass-utils.safe-color-change(
821
+ map.get($systems, md-sys-color, primary),
822
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
823
+ ),
824
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
825
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
826
+ pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
827
+ ), (
828
+ // Color variants:
829
+ primary: (), // Default, no overrides needed.
830
+ secondary: (
831
+ state-layer-color: map.get($systems, md-sys-color, secondary),
832
+ ripple-color: sass-utils.safe-color-change(
833
+ map.get($systems, md-sys-color, secondary),
834
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
835
+ ),
836
+ ),
837
+ tertiary: (
838
+ state-layer-color: map.get($systems, md-sys-color, tertiary),
839
+ ripple-color: sass-utils.safe-color-change(
840
+ map.get($systems, md-sys-color, tertiary),
841
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
842
+ ),
843
+ ),
844
+ error: (
845
+ state-layer-color: map.get($systems, md-sys-color, error),
846
+ ripple-color: sass-utils.safe-color-change(
847
+ map.get($systems, md-sys-color, error),
848
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
849
+ ),
850
+ )
851
+ ));
852
+ }
853
+
854
+ /// Generates custom tokens for the mat-icon-button.
855
+ /// @param {Map} $systems The MDC system tokens
856
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
857
+ /// @return {Map} A set of custom tokens for the mat-icon-button
858
+ @function icon-button($systems, $exclude-hardcoded) {
859
+ @return (
860
+ state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
861
+ disabled-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
862
+ ripple-color: sass-utils.safe-color-change(
863
+ map.get($systems, md-sys-color, on-surface-variant),
864
+ $alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
865
+ ),
866
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
867
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
868
+ pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
869
+ );
870
+ }
871
+
872
+ /// Generates custom tokens for the mat-menu.
873
+ /// @param {Map} $systems The MDC system tokens
874
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
875
+ /// @return {Map} A set of custom tokens for the mat-menu
876
+ @function menu($systems, $exclude-hardcoded) {
877
+ @return sass-utils.merge-all(
878
+ _generate-typography-tokens($systems, item-label-text, label-large),
879
+ (
880
+ container-shape: map.get($systems, md-sys-shape, corner-extra-small),
881
+ divider-color: map.get($systems, md-sys-color, surface-variant),
882
+ divider-bottom-spacing: _hardcode(8px, $exclude-hardcoded),
883
+ divider-top-spacing: _hardcode(8px, $exclude-hardcoded),
884
+ item-label-text-color: map.get($systems, md-sys-color, on-surface),
885
+ item-icon-color: map.get($systems, md-sys-color, on-surface-variant),
886
+ item-icon-size: _hardcode(24px, $exclude-hardcoded),
887
+ item-hover-state-layer-color: sass-utils.safe-color-change(
888
+ map.get($systems, md-sys-color, on-surface),
889
+ $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
890
+ ),
891
+ item-focus-state-layer-color: sass-utils.safe-color-change(
892
+ map.get($systems, md-sys-color, on-surface),
893
+ $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
894
+ ),
895
+ item-spacing: _hardcode(12px, $exclude-hardcoded),
896
+ item-leading-spacing: _hardcode(12px, $exclude-hardcoded),
897
+ item-trailing-spacing: _hardcode(12px, $exclude-hardcoded),
898
+ item-with-icon-leading-spacing: _hardcode(12px, $exclude-hardcoded),
899
+ item-with-icon-trailing-spacing: _hardcode(12px, $exclude-hardcoded),
900
+ container-color: map.get($systems, md-sys-color, surface-container),
901
+ )
902
+ );
903
+ }
904
+
905
+ /// Generates custom tokens for the mat-optgroup.
906
+ /// @param {Map} $systems The MDC system tokens
907
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
908
+ /// @return {Map} A set of custom tokens for the mat-optgroup
909
+ @function optgroup($systems, $exclude-hardcoded) {
910
+ @return sass-utils.merge-all(
911
+ _generate-typography-tokens($systems, label-text, title-small),
912
+ (
913
+ label-text-color: map.get($systems, md-sys-color, on-surface-variant),
914
+ )
915
+ );
916
+ }
917
+
918
+ /// Generates custom tokens for the mat-option.
919
+ /// @param {Map} $systems The MDC system tokens
920
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
921
+ /// @return {Map} A set of custom tokens for the mat-option
922
+ @function option($systems, $exclude-hardcoded) {
923
+ @return ((
924
+ selected-state-label-text-color: map.get($systems, md-sys-color, on-secondary-container),
925
+ label-text-color: map.get($systems, md-sys-color, on-surface),
926
+ hover-state-layer-color: sass-utils.safe-color-change(
927
+ map.get($systems, md-sys-color, on-surface),
928
+ $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
929
+ ),
930
+ focus-state-layer-color: sass-utils.safe-color-change(
931
+ map.get($systems, md-sys-color, on-surface),
932
+ $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
933
+ ),
934
+ selected-state-layer-color: map.get($systems, md-sys-color, secondary-container),
935
+
936
+ // According to the spec the options have to be `label-large` in all typography
937
+ // dimensions, however this is inconsistent with the designs and with MDC's
938
+ // own implementation. This appears to be a bug in the spec, because MDC overrides
939
+ // the font size and weight to be `body-large` (see b/261838263). We make the same
940
+ // override here so the label looks correct.
941
+ label-text-size: map.get($systems, md-sys-typescale, body-large-size),
942
+ label-text-weight: map.get($systems, md-sys-typescale, body-large-weight),
943
+ label-text-font: map.get($systems, md-sys-typescale, label-large-font),
944
+ label-text-line-height: map.get($systems, md-sys-typescale, label-large-line-height),
945
+ label-text-tracking: map.get($systems, md-sys-typescale, label-large-tracking),
946
+ ), (
947
+ // Color variants:
948
+ primary: (
949
+ selected-state-label-text-color: map.get($systems, md-sys-color, on-primary-container),
950
+ selected-state-layer-color: map.get($systems, md-sys-color, primary-container),
951
+ ),
952
+ secondary: (), // Default, no overrides needed
953
+ tertiary: (
954
+ selected-state-label-text-color: map.get($systems, md-sys-color, on-tertiary-container),
955
+ selected-state-layer-color: map.get($systems, md-sys-color, tertiary-container),
956
+ ),
957
+ error: (
958
+ selected-state-label-text-color: map.get($systems, md-sys-color, on-error-container),
959
+ selected-state-layer-color: map.get($systems, md-sys-color, error-container),
960
+ )
961
+ ));
962
+ }
963
+
964
+ /// Generates custom tokens for the mat-paginator.
965
+ /// @param {Map} $systems The MDC system tokens
966
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
967
+ /// @return {Map} A set of custom tokens for the mat-paginator
968
+ @function paginator($systems, $exclude-hardcoded) {
969
+ @return sass-utils.merge-all(
970
+ _generate-typography-tokens($systems, container-text, body-small),
971
+ (
972
+ container-text-color: map.get($systems, md-sys-color, on-surface),
973
+ container-background-color: map.get($systems, md-sys-color, surface),
974
+ enabled-icon-color: map.get($systems, md-sys-color, on-surface-variant),
975
+ disabled-icon-color: sass-utils.safe-color-change(
976
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
977
+ select-trigger-text-size: map.get($systems, md-sys-typescale, body-small-size),
978
+ )
979
+ );
980
+ }
981
+
982
+ /// Generates custom tokens for the full variant of mat-pseudo-checkbox.
983
+ /// @param {Map} $systems The MDC system tokens
984
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
985
+ /// @return {Map} A set of custom tokens for the full variant of mat-pseudo-checkbox
986
+ @function full-pseudo-checkbox($systems, $exclude-hardcoded) {
987
+ $disabled-color: sass-utils.safe-color-change(
988
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38);
989
+
990
+ @return ((
991
+ selected-icon-color: map.get($systems, md-sys-color, primary),
992
+ selected-checkmark-color: map.get($systems, md-sys-color, on-primary),
993
+ unselected-icon-color: map.get($systems, md-sys-color, on-surface-variant),
994
+ disabled-selected-checkmark-color: map.get($systems, md-sys-color, surface),
995
+ disabled-unselected-icon-color: $disabled-color,
996
+ disabled-selected-icon-color: $disabled-color,
997
+ ), (
998
+ // Color variants:
999
+ primary: (), // Default, no overrides needed.
1000
+ secondary: (
1001
+ selected-icon-color: map.get($systems, md-sys-color, secondary),
1002
+ selected-checkmark-color: map.get($systems, md-sys-color, on-secondary),
1003
+ ),
1004
+ tertiary: (
1005
+ selected-icon-color: map.get($systems, md-sys-color, tertiary),
1006
+ selected-checkmark-color: map.get($systems, md-sys-color, on-tertiary),
1007
+ ),
1008
+ error: (
1009
+ selected-icon-color: map.get($systems, md-sys-color, error),
1010
+ selected-checkmark-color: map.get($systems, md-sys-color, on-error),
1011
+ )
1012
+ ));
1013
+ }
1014
+
1015
+ /// Generates custom tokens for the minimal variant of mat-pseudo-checkbox.
1016
+ /// @param {Map} $systems The MDC system tokens
1017
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1018
+ /// @return {Map} A set of custom tokens for the minimal variant of mat-pseudo-checkbox
1019
+ @function minimal-pseudo-checkbox($systems, $exclude-hardcoded) {
1020
+ @return ((
1021
+ selected-checkmark-color: map.get($systems, md-sys-color, primary),
1022
+ disabled-selected-checkmark-color: sass-utils.safe-color-change(
1023
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
1024
+ ), (
1025
+ // Color variants:
1026
+ primary: (), // Default, no overrides needed.
1027
+ secondary: (
1028
+ selected-checkmark-color: map.get($systems, md-sys-color, secondary),
1029
+ ),
1030
+ tertiary: (
1031
+ selected-checkmark-color: map.get($systems, md-sys-color, tertiary),
1032
+ ),
1033
+ error: (
1034
+ selected-checkmark-color: map.get($systems, md-sys-color, error),
1035
+ )
1036
+ ));
1037
+ }
1038
+
1039
+ /// Generates custom tokens for mat-checkbox.
1040
+ /// @param {Map} $systems The MDC system tokens
1041
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1042
+ /// @return {Map} A set of custom tokens for mat-checkbox
1043
+ @function checkbox($systems, $exclude-hardcoded) {
1044
+ @return (
1045
+ disabled-label-color: sass-utils.safe-color-change(
1046
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
1047
+ );
1048
+ }
1049
+
1050
+
1051
+ /// Generates custom tokens for the mat-radio.
1052
+ /// @param {Map} $systems The MDC system tokens
1053
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1054
+ /// @return {Map} A set of custom tokens for the mat-radio
1055
+ @function radio($systems, $exclude-hardcoded) {
1056
+ @return ((
1057
+ ripple-color: map.get($systems, md-sys-color, on-surface),
1058
+ checked-ripple-color: map.get($systems, md-sys-color, primary),
1059
+ disabled-label-color: sass-utils.safe-color-change(
1060
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
1061
+ ), (
1062
+ // Color variants:
1063
+ primary: (), // Default, no overrides needed
1064
+ secondary: (
1065
+ checked-ripple-color: map.get($systems, md-sys-color, secondary),
1066
+ ),
1067
+ tertiary: (
1068
+ checked-ripple-color: map.get($systems, md-sys-color, tertiary),
1069
+ ),
1070
+ error: (
1071
+ checked-ripple-color: map.get($systems, md-sys-color, error),
1072
+ ),
1073
+ ));
1074
+ }
1075
+
1076
+ /// Generates custom tokens for the mat-ripple.
1077
+ /// @param {Map} $systems The MDC system tokens
1078
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1079
+ /// @return {Map} A set of custom tokens for the mat-ripple
1080
+ @function ripple($systems, $exclude-hardcoded) {
1081
+ @return (
1082
+ color: sass-utils.safe-color-change(map.get($systems, md-sys-color, on-surface), $alpha: 0.1),
1083
+ );
1084
+ }
1085
+
1086
+ /// Generates custom tokens for the mat-select.
1087
+ /// @param {Map} $systems The MDC system tokens
1088
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1089
+ /// @return {Map} A set of custom tokens for the mat-select
1090
+ @function select($systems, $exclude-hardcoded) {
1091
+ @return (sass-utils.merge-all(
1092
+ _generate-typography-tokens($systems, trigger-text, body-large),
1093
+ (
1094
+ panel-background-color: map.get($systems, md-sys-color, surface-container),
1095
+ enabled-trigger-text-color: map.get($systems, md-sys-color, on-surface),
1096
+ disabled-trigger-text-color: sass-utils.safe-color-change(
1097
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
1098
+ placeholder-text-color: map.get($systems, md-sys-color, on-surface-variant),
1099
+ enabled-arrow-color: map.get($systems, md-sys-color, on-surface-variant),
1100
+ disabled-arrow-color: sass-utils.safe-color-change(
1101
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
1102
+ focused-arrow-color: map.get($systems, md-sys-color, primary),
1103
+ invalid-arrow-color: map.get($systems, md-sys-color, error),
1104
+ container-elevation-shadow:
1105
+ _hardcode(mdc-elevation.elevation-box-shadow(2), $exclude-hardcoded),
1106
+ )
1107
+ ), (
1108
+ // Color variants:
1109
+ primary: (), // Default, no overrides needed
1110
+ secondary: (
1111
+ focused-arrow-color: map.get($systems, md-sys-color, secondary),
1112
+ ),
1113
+ tertiary: (
1114
+ focused-arrow-color: map.get($systems, md-sys-color, tertiary),
1115
+ ),
1116
+ error: (
1117
+ focused-arrow-color: map.get($systems, md-sys-color, error),
1118
+ )
1119
+ ));
1120
+ }
1121
+
1122
+ /// Generates custom tokens for the mat-sidenav.
1123
+ /// @param {Map} $systems The MDC system tokens
1124
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1125
+ /// @return {Map} A set of custom tokens for the mat-sidenav
1126
+ @function sidenav($systems, $exclude-hardcoded) {
1127
+ @return (
1128
+ container-elevation-shadow: _hardcode(none, $exclude-hardcoded),
1129
+ container-divider-color: _hardcode(transparent, $exclude-hardcoded),
1130
+ container-width: _hardcode(360px, $exclude-hardcoded),
1131
+ container-shape: map.get($systems, md-sys-shape, corner-large),
1132
+ container-background-color: map.get($systems, md-sys-color, surface),
1133
+ container-text-color: map.get($systems, md-sys-color, on-surface-variant),
1134
+ content-background-color: map.get($systems, md-sys-color, background),
1135
+ content-text-color: map.get($systems, md-sys-color, on-background),
1136
+ scrim-color: sass-utils.safe-color-change(
1137
+ map.get($systems, md-ref-palette, neutral-variant20), $alpha: 0.4),
1138
+ );
1139
+ }
1140
+
1141
+ /// Generates custom tokens for the mat-slider.
1142
+ /// @param {Map} $systems The MDC system tokens
1143
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1144
+ /// @return {Map} A set of custom tokens for the mat-slider
1145
+ @function slider($systems, $exclude-hardcoded) {
1146
+ @return ((
1147
+ ripple-color: map.get($systems, md-sys-color, primary),
1148
+ hover-state-layer-color: sass-utils.safe-color-change(
1149
+ map.get($systems, md-sys-color, primary), $alpha: 0.05),
1150
+ focus-state-layer-color: sass-utils.safe-color-change(
1151
+ map.get($systems, md-sys-color, primary), $alpha: 0.2),
1152
+ value-indicator-opacity: _hardcode(1, $exclude-hardcoded),
1153
+ value-indicator-padding: _hardcode(0, $exclude-hardcoded),
1154
+ value-indicator-width: _hardcode(28px, $exclude-hardcoded),
1155
+ value-indicator-height: _hardcode(28px, $exclude-hardcoded),
1156
+ value-indicator-caret-display: _hardcode(none, $exclude-hardcoded),
1157
+ value-indicator-border-radius: _hardcode(50% 50% 50% 0, $exclude-hardcoded),
1158
+ value-indicator-text-transform: _hardcode(rotate(45deg), $exclude-hardcoded),
1159
+ value-indicator-container-transform:
1160
+ _hardcode(translateX(-50%) rotate(-45deg), $exclude-hardcoded)
1161
+ ), (
1162
+ // Color variants
1163
+ primary: (), // Default, no overrides needed
1164
+ secondary: (
1165
+ ripple-color: map.get($systems, md-sys-color, secondary),
1166
+ hover-state-layer-color: sass-utils.safe-color-change(
1167
+ map.get($systems, md-sys-color, secondary), $alpha: 0.05),
1168
+ focus-state-layer-color: sass-utils.safe-color-change(
1169
+ map.get($systems, md-sys-color, secondary), $alpha: 0.2),
1170
+ ),
1171
+ tertiary: (
1172
+ ripple-color: map.get($systems, md-sys-color, tertiary),
1173
+ hover-state-layer-color: sass-utils.safe-color-change(
1174
+ map.get($systems, md-sys-color, tertiary), $alpha: 0.05),
1175
+ focus-state-layer-color: sass-utils.safe-color-change(
1176
+ map.get($systems, md-sys-color, tertiary), $alpha: 0.2),
1177
+ ),
1178
+ error: (
1179
+ ripple-color: map.get($systems, md-sys-color, error),
1180
+ hover-state-layer-color: sass-utils.safe-color-change(
1181
+ map.get($systems, md-sys-color, error), $alpha: 0.05),
1182
+ focus-state-layer-color: sass-utils.safe-color-change(
1183
+ map.get($systems, md-sys-color, error), $alpha: 0.2),
1184
+ ),
1185
+ ));
1186
+ }
1187
+
1188
+ /// Generates custom tokens for the mat-slide-toggle.
1189
+ /// @param {Map} $systems The MDC system tokens
1190
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1191
+ /// @return {Map} A set of custom tokens for the mat-slide-toggle
1192
+ @function switch($systems, $exclude-hardcoded) {
1193
+ @return (
1194
+ disabled-selected-handle-opacity: _hardcode(1, $exclude-hardcoded),
1195
+ disabled-unselected-handle-opacity: _hardcode(0.38, $exclude-hardcoded),
1196
+ unselected-handle-size: _hardcode(16px, $exclude-hardcoded),
1197
+ selected-handle-size: _hardcode(24px, $exclude-hardcoded),
1198
+ with-icon-handle-size: _hardcode(24px, $exclude-hardcoded),
1199
+ pressed-handle-size: _hardcode(28px, $exclude-hardcoded),
1200
+ selected-handle-horizontal-margin: _hardcode(0 24px, $exclude-hardcoded),
1201
+ selected-with-icon-handle-horizontal-margin: _hardcode(0 24px, $exclude-hardcoded),
1202
+ selected-pressed-handle-horizontal-margin: _hardcode(0 22px, $exclude-hardcoded),
1203
+ unselected-handle-horizontal-margin: _hardcode(0 8px, $exclude-hardcoded),
1204
+ unselected-with-icon-handle-horizontal-margin: _hardcode(0 4px, $exclude-hardcoded),
1205
+ unselected-pressed-handle-horizontal-margin: _hardcode(0 2px, $exclude-hardcoded),
1206
+ // The hidden and visible track represent whichever track is visible or
1207
+ // hidden in the ui. This could be the .mdc-switch__track :before or
1208
+ // :after depending on whether the switch is selected or unselected.
1209
+ //
1210
+ // The m2 slide-toggle uses transforms to hide & show the tracks while
1211
+ // the m3 slide-toggle uses opacity.
1212
+ visible-track-opacity: _hardcode(1, $exclude-hardcoded),
1213
+ hidden-track-opacity: _hardcode(0, $exclude-hardcoded),
1214
+ visible-track-transition: _hardcode(opacity 75ms, $exclude-hardcoded),
1215
+ hidden-track-transition: _hardcode(opacity 75ms, $exclude-hardcoded),
1216
+ track-outline-width: _hardcode(2px, $exclude-hardcoded),
1217
+ track-outline-color: map.get($systems, md-sys-color, outline),
1218
+ selected-track-outline-width: _hardcode(0, $exclude-hardcoded),
1219
+ disabled-unselected-track-outline-width: _hardcode(2px, $exclude-hardcoded),
1220
+ disabled-unselected-track-outline-color: map.get($systems, md-sys-color, on-surface),
1221
+ ), ();
1222
+ }
1223
+
1224
+ /// Generates custom tokens for the mat-snack-bar.
1225
+ /// @param {Map} $systems The MDC system tokens
1226
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1227
+ /// @return {Map} A set of custom tokens for the mat-snack-bar
1228
+ @function snack-bar($systems, $exclude-hardcoded) {
1229
+ @return (
1230
+ button-color: map.get($systems, md-sys-color, inverse-primary),
1231
+ );
1232
+ }
1233
+
1234
+ /// Generates custom tokens for the mat-sort.
1235
+ /// @param {Map} $systems The MDC system tokens
1236
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1237
+ /// @return {Map} A set of custom tokens for the mat-sort
1238
+ @function sort($systems, $exclude-hardcoded) {
1239
+ @return (
1240
+ arrow-color: map.get($systems, md-sys-color, on-surface),
1241
+ );
1242
+ }
1243
+
1244
+ /// Generates custom tokens for the mat-stepper.
1245
+ /// @param {Map} $systems The MDC system tokens
1246
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1247
+ /// @return {Map} A set of custom tokens for the mat-stepper
1248
+ @function stepper($systems, $exclude-hardcoded) {
1249
+ @return (
1250
+ (
1251
+ container-color: map.get($systems, md-sys-color, surface),
1252
+ line-color: map.get($systems, md-sys-color, outline-variant),
1253
+ header-hover-state-layer-color: sass-utils.safe-color-change(
1254
+ map.get($systems, md-sys-color, inverse-surface),
1255
+ $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
1256
+ ),
1257
+ header-focus-state-layer-color: sass-utils.safe-color-change(
1258
+ map.get($systems, md-sys-color, inverse-surface),
1259
+ $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
1260
+ ),
1261
+ header-label-text-color: map.get($systems, md-sys-color, on-surface-variant),
1262
+ header-optional-label-text-color: map.get($systems, md-sys-color, on-surface-variant),
1263
+ header-selected-state-label-text-color: map.get($systems, md-sys-color, on-surface-variant),
1264
+ header-icon-background-color: map.get($systems, md-sys-color, on-surface-variant),
1265
+ header-icon-foreground-color: map.get($systems, md-sys-color, surface),
1266
+ header-edit-state-icon-background-color: map.get($systems, md-sys-color, primary),
1267
+ header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-primary),
1268
+ header-error-state-label-text-color: map.get($systems, md-sys-color, error),
1269
+ header-error-state-icon-foreground-color: map.get($systems, md-sys-color, error),
1270
+ header-error-state-icon-background-color: _hardcode(transparent, $exclude-hardcoded),
1271
+ container-text-font: map.get($systems, md-sys-typescale, body-medium-font),
1272
+ header-label-text-font: map.get($systems, md-sys-typescale, title-small-font),
1273
+ header-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
1274
+ header-label-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
1275
+ header-error-state-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
1276
+ header-focus-state-layer-shape: map.get($systems, md-sys-shape, corner-medium),
1277
+ header-hover-state-layer-shape: map.get($systems, md-sys-shape, corner-medium),
1278
+ header-selected-state-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
1279
+ header-selected-state-label-text-weight: map.get(
1280
+ $systems, md-sys-typescale, title-small-weight),
1281
+ header-selected-state-icon-background-color: map.get($systems, md-sys-color, primary),
1282
+ header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-primary),
1283
+ ), (
1284
+ // Color variants
1285
+ primary: (
1286
+ header-edit-state-icon-background-color: map.get($systems, md-sys-color, primary),
1287
+ header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-primary),
1288
+ header-selected-state-icon-background-color: map.get($systems, md-sys-color, primary),
1289
+ header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-primary),
1290
+ ),
1291
+ secondary: (
1292
+ header-edit-state-icon-background-color: map.get($systems, md-sys-color, secondary),
1293
+ header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-secondary),
1294
+ header-selected-state-icon-background-color: map.get($systems, md-sys-color, secondary),
1295
+ header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-secondary),
1296
+ ),
1297
+ tertiary: (
1298
+ header-edit-state-icon-background-color: map.get($systems, md-sys-color, tertiary),
1299
+ header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-tertiary),
1300
+ header-selected-state-icon-background-color: map.get($systems, md-sys-color, tertiary),
1301
+ header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-tertiary),
1302
+ ),
1303
+ error: (
1304
+ header-edit-state-icon-background-color: map.get($systems, md-sys-color, error),
1305
+ header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-error),
1306
+ header-selected-state-icon-background-color: map.get($systems, md-sys-color, error),
1307
+ header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-error),
1308
+ )
1309
+ )
1310
+ );
1311
+ }
1312
+
1313
+ /// Generates custom tokens for the mat-tab-header.
1314
+ /// @param {Map} $systems The MDC system tokens
1315
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1316
+ /// @return {Map} A set of custom tokens for the mat-tab-header
1317
+ @function tab-header($systems, $exclude-hardcoded) {
1318
+ @return (sass-utils.merge-all(
1319
+ _generate-typography-tokens($systems, label-text, title-small),
1320
+ (
1321
+ divider-color: map.get($systems, md-sys-color, surface-variant),
1322
+ divider-height: _hardcode(1px, $exclude-hardcoded),
1323
+ disabled-ripple-color: null, // TODO(mmalerba): Figure out correct value.
1324
+ pagination-icon-color: map.get($systems, md-sys-color, on-surface),
1325
+ inactive-label-text-color: map.get($systems, md-sys-color, on-surface),
1326
+ active-label-text-color: map.get($systems, md-sys-color, on-surface),
1327
+ active-ripple-color: map.get($systems, md-sys-color, on-surface),
1328
+ inactive-ripple-color: map.get($systems, md-sys-color, on-surface),
1329
+ inactive-focus-label-text-color: map.get($systems, md-sys-color, on-surface),
1330
+ inactive-hover-label-text-color: map.get($systems, md-sys-color, on-surface),
1331
+ active-focus-label-text-color: map.get($systems, md-sys-color, on-surface),
1332
+ active-hover-label-text-color: map.get($systems, md-sys-color, on-surface),
1333
+ active-focus-indicator-color: map.get($systems, md-sys-color, primary),
1334
+ active-hover-indicator-color: map.get($systems, md-sys-color, primary),
1335
+ ),
1336
+ ), (
1337
+ // Color variants
1338
+ primary: (), // Default, no overrides needed
1339
+ secondary: (
1340
+ active-focus-indicator-color: map.get($systems, md-sys-color, secondary),
1341
+ active-hover-indicator-color: map.get($systems, md-sys-color, secondary),
1342
+ ),
1343
+ tertiary: (
1344
+ active-focus-indicator-color: map.get($systems, md-sys-color, tertiary),
1345
+ active-hover-indicator-color: map.get($systems, md-sys-color, tertiary),
1346
+ ),
1347
+ error: (
1348
+ active-focus-indicator-color: map.get($systems, md-sys-color, error),
1349
+ active-hover-indicator-color: map.get($systems, md-sys-color, error),
1350
+ )
1351
+ ));
1352
+ }
1353
+
1354
+ /// Generates custom tokens for the mdc-tab-indicator. (MDC has a tab-indicator component, but they
1355
+ /// seem to have made up the tokens rather than using ones generated from the token database,
1356
+ /// therefore we need a custom token function for it).
1357
+ /// @param {Map} $systems The MDC system tokens
1358
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1359
+ /// @return {Map} A set of custom tokens for the mdc-tab-indicator
1360
+ @function tab-indicator($systems, $exclude-hardcoded) {
1361
+ @return ((
1362
+ active-indicator-height: _hardcode(2px, $exclude-hardcoded),
1363
+ active-indicator-shape: _hardcode(0, $exclude-hardcoded),
1364
+ active-indicator-color: map.get($systems, md-sys-color, primary),
1365
+ ), (
1366
+ // Color variants
1367
+ primary: (), // Default, no overrides needed
1368
+ secondary: (
1369
+ active-indicator-color: map.get($systems, md-sys-color, secondary),
1370
+ ),
1371
+ tertiary: (
1372
+ active-indicator-color: map.get($systems, md-sys-color, tertiary),
1373
+ ),
1374
+ error: (
1375
+ active-indicator-color: map.get($systems, md-sys-color, error),
1376
+ )
1377
+ ));
1378
+ }
1379
+
1380
+ /// Generates custom tokens for the mat-table.
1381
+ /// @param {Map} $systems The MDC system tokens
1382
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1383
+ /// @return {Map} A set of custom tokens for the mat-table
1384
+ @function table($systems, $exclude-hardcoded) {
1385
+ @return sass-utils.merge-all(
1386
+ _generate-typography-tokens($systems, header-headline, title-small),
1387
+ _generate-typography-tokens($systems, row-item-label-text, body-medium),
1388
+ _generate-typography-tokens($systems, footer-supporting-text, body-medium),
1389
+ (
1390
+ row-item-outline-width: _hardcode(1px, $exclude-hardcoded),
1391
+ background-color: map.get($systems, md-sys-color, surface),
1392
+ header-headline-color: map.get($systems, md-sys-color, on-surface),
1393
+ row-item-label-text-color: map.get($systems, md-sys-color, on-surface),
1394
+ row-item-outline-color: map.get($systems, md-sys-color, outline-variant),
1395
+ ),
1396
+ );
1397
+ }
1398
+
1399
+ /// Generates custom tokens for the mat-toolbar.
1400
+ /// @param {Map} $systems The MDC system tokens
1401
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1402
+ /// @return {Map} A set of custom tokens for the mat-toolbar
1403
+ @function toolbar($systems, $exclude-hardcoded) {
1404
+ @return sass-utils.merge-all(
1405
+ _generate-typography-tokens($systems, title-text, title-large),
1406
+ (
1407
+ container-background-color: map.get($systems, md-sys-color, surface),
1408
+ container-text-color: map.get($systems, md-sys-color, on-surface),
1409
+ )
1410
+ );
1411
+ }
1412
+
1413
+ /// Generates custom tokens for the mat-tree.
1414
+ /// @param {Map} $systems The MDC system tokens
1415
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1416
+ /// @return {Map} A set of custom tokens for the mat-tree
1417
+ @function tree($systems, $exclude-hardcoded) {
1418
+ @return (
1419
+ container-background-color: map.get($systems, md-sys-color, surface),
1420
+ node-text-color: map.get($systems, md-sys-color, on-surface),
1421
+ node-text-font: map.get($systems, md-sys-typescale, body-large-font),
1422
+ node-text-size: map.get($systems, md-sys-typescale, body-large-size),
1423
+ node-text-weight: map.get($systems, md-sys-typescale, body-large-weight),
1424
+ );
1425
+ }
1426
+
1427
+ /// Generates custom token overrides for the mdc-checkbox color variants.
1428
+ /// @param {Map} $systems The MDC system tokens
1429
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1430
+ /// @return {Map} A set of color variant token overrides for the mdc-checkbox
1431
+ @function mdc-checkbox-color-variants($systems, $exclude-hardcoded) {
1432
+ @return (
1433
+ primary: (), // Default, no overrides needed
1434
+ secondary: (
1435
+ selected-container-color: map.get($systems, md-sys-color, secondary),
1436
+ selected-focus-container-color: map.get($systems, md-sys-color, secondary),
1437
+ selected-focus-icon-color: map.get($systems, md-sys-color, on-secondary),
1438
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, secondary),
1439
+ selected-hover-container-color: map.get($systems, md-sys-color, secondary),
1440
+ selected-hover-icon-color: map.get($systems, md-sys-color, on-secondary),
1441
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, secondary),
1442
+ selected-icon-color: map.get($systems, md-sys-color, on-secondary),
1443
+ selected-pressed-container-color: map.get($systems, md-sys-color, secondary),
1444
+ selected-pressed-icon-color: map.get($systems, md-sys-color, on-secondary),
1445
+ unselected-pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
1446
+ ),
1447
+ tertiary: (
1448
+ selected-container-color: map.get($systems, md-sys-color, tertiary),
1449
+ selected-focus-container-color: map.get($systems, md-sys-color, tertiary),
1450
+ selected-focus-icon-color: map.get($systems, md-sys-color, on-tertiary),
1451
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
1452
+ selected-hover-container-color: map.get($systems, md-sys-color, tertiary),
1453
+ selected-hover-icon-color: map.get($systems, md-sys-color, on-tertiary),
1454
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
1455
+ selected-icon-color: map.get($systems, md-sys-color, on-tertiary),
1456
+ selected-pressed-container-color: map.get($systems, md-sys-color, tertiary),
1457
+ selected-pressed-icon-color: map.get($systems, md-sys-color, on-tertiary),
1458
+ unselected-pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
1459
+ ),
1460
+ error: (
1461
+ selected-container-color: map.get($systems, md-sys-color, error),
1462
+ selected-focus-container-color: map.get($systems, md-sys-color, error),
1463
+ selected-focus-icon-color: map.get($systems, md-sys-color, on-error),
1464
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, error),
1465
+ selected-hover-container-color: map.get($systems, md-sys-color, error),
1466
+ selected-hover-icon-color: map.get($systems, md-sys-color, on-error),
1467
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, error),
1468
+ selected-icon-color: map.get($systems, md-sys-color, on-error),
1469
+ selected-pressed-container-color: map.get($systems, md-sys-color, error),
1470
+ selected-pressed-icon-color: map.get($systems, md-sys-color, on-error),
1471
+ unselected-pressed-state-layer-color: map.get($systems, md-sys-color, error),
1472
+ )
1473
+ );
1474
+ }
1475
+
1476
+ /// Generates custom token overrides for the mdc-slider color variants.
1477
+ /// @param {Map} $systems The MDC system tokens
1478
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1479
+ /// @return {Map} A set of color variant token overrides for the mdc-slider
1480
+ @function mdc-slider-color-variants($systems, $exclude-hardcoded) {
1481
+ @return (
1482
+ primary: (), // Default, no overrides needed
1483
+ secondary: (
1484
+ active-track-color: map.get($systems, md-sys-color, secondary),
1485
+ focus-handle-color: map.get($systems, md-sys-color, secondary),
1486
+ focus-state-layer-color: map.get($systems, md-sys-color, secondary),
1487
+ handle-color: map.get($systems, md-sys-color, secondary),
1488
+ hover-handle-color: map.get($systems, md-sys-color, secondary),
1489
+ hover-state-layer-color: map.get($systems, md-sys-color, secondary),
1490
+ label-container-color: map.get($systems, md-sys-color, secondary),
1491
+ label-label-text-color: map.get($systems, md-sys-color, on-secondary),
1492
+ pressed-handle-color: map.get($systems, md-sys-color, secondary),
1493
+ pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
1494
+ with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-secondary),
1495
+ with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-secondary),
1496
+ ),
1497
+ tertiary: (
1498
+ active-track-color: map.get($systems, md-sys-color, tertiary),
1499
+ focus-handle-color: map.get($systems, md-sys-color, tertiary),
1500
+ focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
1501
+ handle-color: map.get($systems, md-sys-color, tertiary),
1502
+ hover-handle-color: map.get($systems, md-sys-color, tertiary),
1503
+ hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
1504
+ label-container-color: map.get($systems, md-sys-color, tertiary),
1505
+ label-label-text-color: map.get($systems, md-sys-color, on-tertiary),
1506
+ pressed-handle-color: map.get($systems, md-sys-color, tertiary),
1507
+ pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
1508
+ with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-tertiary),
1509
+ with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-tertiary),
1510
+ ),
1511
+ error: (
1512
+ active-track-color: map.get($systems, md-sys-color, error),
1513
+ focus-handle-color: map.get($systems, md-sys-color, error),
1514
+ focus-state-layer-color: map.get($systems, md-sys-color, error),
1515
+ handle-color: map.get($systems, md-sys-color, error),
1516
+ hover-handle-color: map.get($systems, md-sys-color, error),
1517
+ hover-state-layer-color: map.get($systems, md-sys-color, error),
1518
+ label-container-color: map.get($systems, md-sys-color, error),
1519
+ label-label-text-color: map.get($systems, md-sys-color, on-error),
1520
+ pressed-handle-color: map.get($systems, md-sys-color, error),
1521
+ pressed-state-layer-color: map.get($systems, md-sys-color, error),
1522
+ with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-error),
1523
+ with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-error),
1524
+ ),
1525
+ );
1526
+ }
1527
+
1528
+ /// Generates custom token overrides for the mdc-switch color variants.
1529
+ /// @param {Map} $systems The MDC system tokens
1530
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1531
+ /// @return {Map} A set of color variant token overrides for the mdc-switch
1532
+ @function mdc-switch-color-variants($systems, $exclude-hardcoded) {
1533
+ @return (
1534
+ primary: (), // Default, no overrides needed
1535
+ secondary: (
1536
+ selected-focus-handle-color: map.get($systems, md-sys-color, secondary-container),
1537
+ selected-focus-icon-color: map.get($systems, md-sys-color, on-secondary-container),
1538
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, secondary),
1539
+ selected-focus-track-color: map.get($systems, md-sys-color, secondary),
1540
+ selected-handle-color: map.get($systems, md-sys-color, on-secondary),
1541
+ selected-hover-handle-color: map.get($systems, md-sys-color, secondary-container),
1542
+ selected-hover-icon-color: map.get($systems, md-sys-color, on-secondary-container),
1543
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, secondary),
1544
+ selected-hover-track-color: map.get($systems, md-sys-color, secondary),
1545
+ selected-icon-color: map.get($systems, md-sys-color, on-secondary-container),
1546
+ selected-pressed-handle-color: map.get($systems, md-sys-color, secondary-container),
1547
+ selected-pressed-icon-color: map.get($systems, md-sys-color, on-secondary-container),
1548
+ selected-pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
1549
+ selected-pressed-track-color: map.get($systems, md-sys-color, secondary),
1550
+ selected-track-color: map.get($systems, md-sys-color, secondary),
1551
+ ),
1552
+ tertiary: (
1553
+ selected-focus-handle-color: map.get($systems, md-sys-color, tertiary-container),
1554
+ selected-focus-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
1555
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
1556
+ selected-focus-track-color: map.get($systems, md-sys-color, tertiary),
1557
+ selected-handle-color: map.get($systems, md-sys-color, on-tertiary),
1558
+ selected-hover-handle-color: map.get($systems, md-sys-color, tertiary-container),
1559
+ selected-hover-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
1560
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
1561
+ selected-hover-track-color: map.get($systems, md-sys-color, tertiary),
1562
+ selected-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
1563
+ selected-pressed-handle-color: map.get($systems, md-sys-color, tertiary-container),
1564
+ selected-pressed-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
1565
+ selected-pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
1566
+ selected-pressed-track-color: map.get($systems, md-sys-color, tertiary),
1567
+ selected-track-color: map.get($systems, md-sys-color, tertiary),
1568
+ ),
1569
+ error: (
1570
+ selected-focus-handle-color: map.get($systems, md-sys-color, error-container),
1571
+ selected-focus-icon-color: map.get($systems, md-sys-color, on-error-container),
1572
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, error),
1573
+ selected-focus-track-color: map.get($systems, md-sys-color, error),
1574
+ selected-handle-color: map.get($systems, md-sys-color, on-error),
1575
+ selected-hover-handle-color: map.get($systems, md-sys-color, error-container),
1576
+ selected-hover-icon-color: map.get($systems, md-sys-color, on-error-container),
1577
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, error),
1578
+ selected-hover-track-color: map.get($systems, md-sys-color, error),
1579
+ selected-icon-color: map.get($systems, md-sys-color, on-error-container),
1580
+ selected-pressed-handle-color: map.get($systems, md-sys-color, error-container),
1581
+ selected-pressed-icon-color: map.get($systems, md-sys-color, on-error-container),
1582
+ selected-pressed-state-layer-color: map.get($systems, md-sys-color, error),
1583
+ selected-pressed-track-color: map.get($systems, md-sys-color, error),
1584
+ selected-track-color: map.get($systems, md-sys-color, error),
1585
+ ),
1586
+ );
1587
+ }
1588
+
1589
+ /// Generates custom token overrides for the mdc-radio color variants.
1590
+ /// @param {Map} $systems The MDC system tokens
1591
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1592
+ /// @return {Map} A set of color variant token overrides for the mdc-radio
1593
+ @function mdc-radio-color-variants($systems, $exclude-hardcoded) {
1594
+ @return (
1595
+ primary: (), // Default, no overrides needed
1596
+ secondary: (
1597
+ selected-focus-icon-color: map.get($systems, md-sys-color, secondary),
1598
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, secondary),
1599
+ selected-hover-icon-color: map.get($systems, md-sys-color, secondary),
1600
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, secondary),
1601
+ selected-icon-color: map.get($systems, md-sys-color, secondary),
1602
+ selected-pressed-icon-color: map.get($systems, md-sys-color, secondary),
1603
+ unselected-pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
1604
+ ),
1605
+ tertiary: (
1606
+ selected-focus-icon-color: map.get($systems, md-sys-color, tertiary),
1607
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
1608
+ selected-hover-icon-color: map.get($systems, md-sys-color, tertiary),
1609
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
1610
+ selected-icon-color: map.get($systems, md-sys-color, tertiary),
1611
+ selected-pressed-icon-color: map.get($systems, md-sys-color, tertiary),
1612
+ unselected-pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
1613
+ ),
1614
+ error: (
1615
+ selected-focus-icon-color: map.get($systems, md-sys-color, error),
1616
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, error),
1617
+ selected-hover-icon-color: map.get($systems, md-sys-color, error),
1618
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, error),
1619
+ selected-icon-color: map.get($systems, md-sys-color, error),
1620
+ selected-pressed-icon-color: map.get($systems, md-sys-color, error),
1621
+ unselected-pressed-state-layer-color: map.get($systems, md-sys-color, error),
1622
+ ),
1623
+ );
1624
+ }
1625
+
1626
+ /// Generates custom token overrides for the mdc-circular-progress color variants.
1627
+ /// @param {Map} $systems The MDC system tokens
1628
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1629
+ /// @return {Map} A set of color variant token overrides for the mdc-circular-progress
1630
+ @function mdc-circular-progress-color-variants($systems, $exclude-hardcoded) {
1631
+ @return (
1632
+ primary: (), // Default, no overrides needed
1633
+ secondary: (
1634
+ active-indicator-color: map.get($systems, md-sys-color, secondary),
1635
+ ),
1636
+ tertiary: (
1637
+ active-indicator-color: map.get($systems, md-sys-color, tertiary),
1638
+ ),
1639
+ error: (
1640
+ active-indicator-color: map.get($systems, md-sys-color, error),
1641
+ )
1642
+ );
1643
+ }
1644
+
1645
+ /// Generates custom token overrides for the mdc-linear-progress color variants.
1646
+ /// @param {Map} $systems The MDC system tokens
1647
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1648
+ /// @return {Map} A set of color variant token overrides for the mdc-linear-progress
1649
+ @function mdc-linear-progress-color-variants($systems, $exclude-hardcoded) {
1650
+ @return (
1651
+ primary: (), // Default, no overrides needed
1652
+ secondary: (
1653
+ active-indicator-color: map.get($systems, md-sys-color, secondary),
1654
+ track-color: map.get($systems, md-sys-color, secondary-container),
1655
+ ),
1656
+ tertiary: (
1657
+ active-indicator-color: map.get($systems, md-sys-color, tertiary),
1658
+ track-color: map.get($systems, md-sys-color, tertiary-container),
1659
+ ),
1660
+ error: (
1661
+ active-indicator-color: map.get($systems, md-sys-color, error),
1662
+ track-color: map.get($systems, md-sys-color, error-container),
1663
+ ),
1664
+ );
1665
+ }
1666
+
1667
+ /// Generates custom token overrides for the mdc-filled-form-field color variants.
1668
+ /// @param {Map} $systems The MDC system tokens
1669
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1670
+ /// @return {Map} A set of color variant token overrides for the mdc-filled-form-field
1671
+ @function mdc-filled-text-field-color-variants($systems, $exclude-hardcoded) {
1672
+ @return (
1673
+ primary: (), // Default, no overrides needed
1674
+ secondary: (
1675
+ caret-color: map.get($systems, md-sys-color, secondary),
1676
+ focus-active-indicator-color: map.get($systems, md-sys-color, secondary),
1677
+ focus-label-text-color: map.get($systems, md-sys-color, secondary),
1678
+ ),
1679
+ tertiary: (
1680
+ caret-color: map.get($systems, md-sys-color, tertiary),
1681
+ focus-active-indicator-color: map.get($systems, md-sys-color, tertiary),
1682
+ focus-label-text-color: map.get($systems, md-sys-color, tertiary),
1683
+ ),
1684
+ error: (
1685
+ caret-color: map.get($systems, md-sys-color, error),
1686
+ focus-active-indicator-color: map.get($systems, md-sys-color, error),
1687
+ focus-label-text-color: map.get($systems, md-sys-color, error),
1688
+ ),
1689
+ );
1690
+ }
1691
+
1692
+ /// Generates custom token overrides for the mdc-outlined-form-field color variants.
1693
+ /// @param {Map} $systems The MDC system tokens
1694
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1695
+ /// @return {Map} A set of color variant token overrides for the mdc-outlined-form-field
1696
+ @function mdc-outlined-text-field-color-variants($systems, $exclude-hardcoded) {
1697
+ @return (
1698
+ primary: (), // Default, no overrides needed
1699
+ secondary: (
1700
+ caret-color: map.get($systems, md-sys-color, secondary),
1701
+ focus-label-text-color: map.get($systems, md-sys-color, secondary),
1702
+ focus-outline-color: map.get($systems, md-sys-color, secondary),
1703
+ ),
1704
+ tertiary: (
1705
+ caret-color: map.get($systems, md-sys-color, tertiary),
1706
+ focus-label-text-color: map.get($systems, md-sys-color, tertiary),
1707
+ focus-outline-color: map.get($systems, md-sys-color, tertiary),
1708
+ ),
1709
+ error: (
1710
+ caret-color: map.get($systems, md-sys-color, error),
1711
+ focus-label-text-color: map.get($systems, md-sys-color, error),
1712
+ focus-outline-color: map.get($systems, md-sys-color, error),
1713
+ ),
1714
+ );
1715
+ }
1716
+
1717
+ /// Generates custom token overrides for the mdc-text-button color variants.
1718
+ /// @param {Map} $systems The MDC system tokens
1719
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1720
+ /// @return {Map} A set of color variant token overrides for the mdc-text-button
1721
+ @function mdc-text-button-color-variants($systems, $exclude-hardcoded) {
1722
+ @return (
1723
+ primary: (), // Default, no overrides needed.
1724
+ secondary: (
1725
+ focus-label-text-color: map.get($systems, md-sys-color, secondary),
1726
+ focus-state-layer-color: map.get($systems, md-sys-color, secondary),
1727
+ hover-label-text-color: map.get($systems, md-sys-color, secondary),
1728
+ hover-state-layer-color: map.get($systems, md-sys-color, secondary),
1729
+ label-text-color: map.get($systems, md-sys-color, secondary),
1730
+ pressed-label-text-color: map.get($systems, md-sys-color, secondary),
1731
+ pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
1732
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
1733
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
1734
+ with-icon-icon-color: map.get($systems, md-sys-color, secondary),
1735
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
1736
+ ),
1737
+ tertiary: (
1738
+ focus-label-text-color: map.get($systems, md-sys-color, tertiary),
1739
+ focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
1740
+ hover-label-text-color: map.get($systems, md-sys-color, tertiary),
1741
+ hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
1742
+ label-text-color: map.get($systems, md-sys-color, tertiary),
1743
+ pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
1744
+ pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
1745
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
1746
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
1747
+ with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
1748
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
1749
+ ),
1750
+ error: (
1751
+ focus-label-text-color: map.get($systems, md-sys-color, error),
1752
+ focus-state-layer-color: map.get($systems, md-sys-color, error),
1753
+ hover-label-text-color: map.get($systems, md-sys-color, error),
1754
+ hover-state-layer-color: map.get($systems, md-sys-color, error),
1755
+ label-text-color: map.get($systems, md-sys-color, error),
1756
+ pressed-label-text-color: map.get($systems, md-sys-color, error),
1757
+ pressed-state-layer-color: map.get($systems, md-sys-color, error),
1758
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
1759
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
1760
+ with-icon-icon-color: map.get($systems, md-sys-color, error),
1761
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
1762
+ )
1763
+ );
1764
+ }
1765
+
1766
+ /// Generates custom token overrides for the mdc-elevated-button color variants.
1767
+ /// @param {Map} $systems The MDC system tokens
1768
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1769
+ /// @return {Map} A set of color variant token overrides for the mdc-elevated-button
1770
+ @function mdc-elevated-button-color-variants($systems, $exclude-hardcoded) {
1771
+ @return (
1772
+ primary: (), // Default, no overrides needed.
1773
+ secondary: (
1774
+ focus-label-text-color: map.get($systems, md-sys-color, secondary),
1775
+ focus-state-layer-color: map.get($systems, md-sys-color, secondary),
1776
+ hover-label-text-color: map.get($systems, md-sys-color, secondary),
1777
+ hover-state-layer-color: map.get($systems, md-sys-color, secondary),
1778
+ label-text-color: map.get($systems, md-sys-color, secondary),
1779
+ pressed-label-text-color: map.get($systems, md-sys-color, secondary),
1780
+ pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
1781
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
1782
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
1783
+ with-icon-icon-color: map.get($systems, md-sys-color, secondary),
1784
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
1785
+ ),
1786
+ tertiary: (
1787
+ focus-label-text-color: map.get($systems, md-sys-color, tertiary),
1788
+ focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
1789
+ hover-label-text-color: map.get($systems, md-sys-color, tertiary),
1790
+ hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
1791
+ label-text-color: map.get($systems, md-sys-color, tertiary),
1792
+ pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
1793
+ pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
1794
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
1795
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
1796
+ with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
1797
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
1798
+ ),
1799
+ error: (
1800
+ focus-label-text-color: map.get($systems, md-sys-color, error),
1801
+ focus-state-layer-color: map.get($systems, md-sys-color, error),
1802
+ hover-label-text-color: map.get($systems, md-sys-color, error),
1803
+ hover-state-layer-color: map.get($systems, md-sys-color, error),
1804
+ label-text-color: map.get($systems, md-sys-color, error),
1805
+ pressed-label-text-color: map.get($systems, md-sys-color, error),
1806
+ pressed-state-layer-color: map.get($systems, md-sys-color, error),
1807
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
1808
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
1809
+ with-icon-icon-color: map.get($systems, md-sys-color, error),
1810
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
1811
+ )
1812
+ );
1813
+ }
1814
+
1815
+ /// Generates custom token overrides for the mdc-filled-button color variants.
1816
+ /// @param {Map} $systems The MDC system tokens
1817
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1818
+ /// @return {Map} A set of color variant token overrides for the mdc-filled-button
1819
+ @function mdc-filled-button-color-variants($systems, $exclude-hardcoded) {
1820
+ @return (
1821
+ primary: (), // Default, no overrides needed.
1822
+ secondary: (
1823
+ container-color: map.get($systems, md-sys-color, secondary),
1824
+ focus-label-text-color: map.get($systems, md-sys-color, on-secondary),
1825
+ focus-state-layer-color: map.get($systems, md-sys-color, on-secondary),
1826
+ hover-label-text-color: map.get($systems, md-sys-color, on-secondary),
1827
+ hover-state-layer-color: map.get($systems, md-sys-color, on-secondary),
1828
+ label-text-color: map.get($systems, md-sys-color, on-secondary),
1829
+ pressed-label-text-color: map.get($systems, md-sys-color, on-secondary),
1830
+ pressed-state-layer-color: map.get($systems, md-sys-color, on-secondary),
1831
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, on-secondary),
1832
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, on-secondary),
1833
+ with-icon-icon-color: map.get($systems, md-sys-color, on-secondary),
1834
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, on-secondary)
1835
+ ),
1836
+ tertiary: (
1837
+ container-color: map.get($systems, md-sys-color, tertiary),
1838
+ focus-label-text-color: map.get($systems, md-sys-color, on-tertiary),
1839
+ focus-state-layer-color: map.get($systems, md-sys-color, on-tertiary),
1840
+ hover-label-text-color: map.get($systems, md-sys-color, on-tertiary),
1841
+ hover-state-layer-color: map.get($systems, md-sys-color, on-tertiary),
1842
+ label-text-color: map.get($systems, md-sys-color, on-tertiary),
1843
+ pressed-label-text-color: map.get($systems, md-sys-color, on-tertiary),
1844
+ pressed-state-layer-color: map.get($systems, md-sys-color, on-tertiary),
1845
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, on-tertiary),
1846
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, on-tertiary),
1847
+ with-icon-icon-color: map.get($systems, md-sys-color, on-tertiary),
1848
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, on-tertiary)
1849
+ ),
1850
+ error: (
1851
+ container-color: map.get($systems, md-sys-color, error),
1852
+ focus-label-text-color: map.get($systems, md-sys-color, on-error),
1853
+ focus-state-layer-color: map.get($systems, md-sys-color, on-error),
1854
+ hover-label-text-color: map.get($systems, md-sys-color, on-error),
1855
+ hover-state-layer-color: map.get($systems, md-sys-color, on-error),
1856
+ label-text-color: map.get($systems, md-sys-color, on-error),
1857
+ pressed-label-text-color: map.get($systems, md-sys-color, on-error),
1858
+ pressed-state-layer-color: map.get($systems, md-sys-color, on-error),
1859
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, on-error),
1860
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, on-error),
1861
+ with-icon-icon-color: map.get($systems, md-sys-color, on-error),
1862
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, on-error)
1863
+ )
1864
+ );
1865
+ }
1866
+
1867
+ /// Generates custom token overrides for the mdc-outlined-button color variants.
1868
+ /// @param {Map} $systems The MDC system tokens
1869
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
1870
+ /// @return {Map} A set of color variant token overrides for the mdc-outlined-button
1871
+ @function mdc-outlined-button-color-variants($systems, $exclude-hardcoded) {
1872
+ @return (
1873
+ primary: (), // Default, no overrides needed.
1874
+ secondary: (
1875
+ focus-label-text-color: map.get($systems, md-sys-color, secondary),
1876
+ focus-outline-color: map.get($systems, md-sys-color, secondary),
1877
+ focus-state-layer-color: map.get($systems, md-sys-color, secondary),
1878
+ hover-label-text-color: map.get($systems, md-sys-color, secondary),
1879
+ hover-state-layer-color: map.get($systems, md-sys-color, secondary),
1880
+ label-text-color: map.get($systems, md-sys-color, secondary),
1881
+ pressed-label-text-color: map.get($systems, md-sys-color, secondary),
1882
+ pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
1883
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
1884
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
1885
+ with-icon-icon-color: map.get($systems, md-sys-color, secondary),
1886
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
1887
+ ),
1888
+ tertiary: (
1889
+ focus-label-text-color: map.get($systems, md-sys-color, tertiary),
1890
+ focus-outline-color: map.get($systems, md-sys-color, tertiary),
1891
+ focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
1892
+ hover-label-text-color: map.get($systems, md-sys-color, tertiary),
1893
+ hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
1894
+ label-text-color: map.get($systems, md-sys-color, tertiary),
1895
+ pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
1896
+ pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
1897
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
1898
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
1899
+ with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
1900
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
1901
+ ),
1902
+ error: (
1903
+ focus-label-text-color: map.get($systems, md-sys-color, error),
1904
+ focus-outline-color: map.get($systems, md-sys-color, error),
1905
+ focus-state-layer-color: map.get($systems, md-sys-color, error),
1906
+ hover-label-text-color: map.get($systems, md-sys-color, error),
1907
+ hover-state-layer-color: map.get($systems, md-sys-color, error),
1908
+ label-text-color: map.get($systems, md-sys-color, error),
1909
+ pressed-label-text-color: map.get($systems, md-sys-color, error),
1910
+ pressed-state-layer-color: map.get($systems, md-sys-color, error),
1911
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
1912
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
1913
+ with-icon-icon-color: map.get($systems, md-sys-color, error),
1914
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
1915
+ )
1916
+ );
1917
+ }
1918
+