@angular/material 18.0.0-next.6 → 18.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/_index.scss +1 -1
  2. package/button/index.d.ts +1 -1
  3. package/core/tokens/_m3-tokens.scss +28 -885
  4. package/core/tokens/_token-utils.scss +151 -0
  5. package/core/tokens/m2/mat/_switch.scss +1 -0
  6. package/core/tokens/m3/_index.scss +161 -0
  7. package/core/tokens/m3/mat/_app.scss +19 -0
  8. package/core/tokens/m3/mat/_autocomplete.scss +22 -0
  9. package/core/tokens/m3/mat/_badge.scss +77 -0
  10. package/core/tokens/m3/mat/_bottom-sheet.scss +24 -0
  11. package/core/tokens/m3/mat/_card.scss +24 -0
  12. package/core/tokens/m3/mat/_checkbox.scss +21 -0
  13. package/core/tokens/m3/mat/_chip.scss +46 -0
  14. package/core/tokens/m3/mat/_datepicker.scss +123 -0
  15. package/core/tokens/m3/mat/_dialog.scss +30 -0
  16. package/core/tokens/m3/mat/_divider.scss +19 -0
  17. package/core/tokens/m3/mat/_expansion.scss +41 -0
  18. package/core/tokens/m3/mat/_fab-small.scss +50 -0
  19. package/core/tokens/m3/mat/_fab.scss +50 -0
  20. package/core/tokens/m3/mat/_filled-button.scss +54 -0
  21. package/core/tokens/m3/mat/_form-field.scss +59 -0
  22. package/core/tokens/m3/mat/_full-pseudo-checkbox.scss +42 -0
  23. package/core/tokens/m3/mat/_grid-list.scss +21 -0
  24. package/core/tokens/m3/mat/_icon-button.scss +27 -0
  25. package/core/tokens/m3/mat/_icon.scss +33 -0
  26. package/core/tokens/m3/mat/_list.scss +19 -0
  27. package/core/tokens/m3/mat/_menu.scss +42 -0
  28. package/core/tokens/m3/mat/_minimal-pseudo-checkbox.scss +33 -0
  29. package/core/tokens/m3/mat/_optgroup.scss +22 -0
  30. package/core/tokens/m3/mat/_option.scss +55 -0
  31. package/core/tokens/m3/mat/_outlined-button.scss +54 -0
  32. package/core/tokens/m3/mat/_paginator.scss +27 -0
  33. package/core/tokens/m3/mat/_protected-button.scss +55 -0
  34. package/core/tokens/m3/mat/_radio.scss +34 -0
  35. package/core/tokens/m3/mat/_ripple.scss +19 -0
  36. package/core/tokens/m3/mat/_select.scss +46 -0
  37. package/core/tokens/m3/mat/_sidenav.scss +28 -0
  38. package/core/tokens/m3/mat/_slider.scss +56 -0
  39. package/core/tokens/m3/mat/_snack-bar.scss +18 -0
  40. package/core/tokens/m3/mat/_sort.scss +18 -0
  41. package/core/tokens/m3/mat/_standard-button-toggle.scss +57 -0
  42. package/core/tokens/m3/mat/_stepper.scss +79 -0
  43. package/core/tokens/m3/mat/_switch.scss +45 -0
  44. package/core/tokens/m3/mat/_tab-header.scss +51 -0
  45. package/core/tokens/m3/mat/_table.scss +28 -0
  46. package/core/tokens/m3/mat/_text-button.scss +55 -0
  47. package/core/tokens/m3/mat/_toolbar.scss +23 -0
  48. package/core/tokens/m3/mat/_tree.scss +22 -0
  49. package/core/tokens/m3/mdc/_checkbox.scss +110 -0
  50. package/core/tokens/m3/mdc/_chip.scss +91 -0
  51. package/core/tokens/m3/mdc/_circular-progress.scss +29 -0
  52. package/core/tokens/m3/mdc/_dialog.scss +39 -0
  53. package/core/tokens/m3/mdc/_elevated-card.scss +15 -0
  54. package/core/tokens/m3/mdc/_extended-fab.scss +21 -0
  55. package/core/tokens/m3/mdc/_fab-small.scss +21 -0
  56. package/core/tokens/m3/mdc/_fab.scss +21 -0
  57. package/core/tokens/m3/mdc/_filled-button.scss +86 -0
  58. package/core/tokens/m3/mdc/_filled-text-field.scss +92 -0
  59. package/core/tokens/m3/mdc/_form-field.scss +25 -0
  60. package/core/tokens/m3/mdc/_icon-button.scss +39 -0
  61. package/core/tokens/m3/mdc/_linear-progress.scss +32 -0
  62. package/core/tokens/m3/mdc/_list.scss +37 -0
  63. package/core/tokens/m3/mdc/_outlined-button.scss +83 -0
  64. package/core/tokens/m3/mdc/_outlined-card.scss +15 -0
  65. package/core/tokens/m3/mdc/_outlined-text-field.scss +85 -0
  66. package/core/tokens/m3/mdc/_plain-tooltip.scss +15 -0
  67. package/core/tokens/m3/mdc/_protected-button.scss +84 -0
  68. package/core/tokens/m3/mdc/_radio.scss +46 -0
  69. package/core/tokens/m3/mdc/_slider.scss +61 -0
  70. package/core/tokens/m3/mdc/_snack-bar.scss +15 -0
  71. package/core/tokens/m3/mdc/_switch.scss +70 -0
  72. package/core/tokens/m3/mdc/_tab-indicator.scss +33 -0
  73. package/core/tokens/m3/mdc/_tab.scss +15 -0
  74. package/core/tokens/m3/mdc/_text-button.scss +79 -0
  75. package/dialog/index.d.ts +4 -3
  76. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  77. package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
  78. package/esm2022/autocomplete/autocomplete.mjs +4 -4
  79. package/esm2022/autocomplete/module.mjs +5 -5
  80. package/esm2022/badge/badge-module.mjs +5 -5
  81. package/esm2022/badge/badge.mjs +7 -7
  82. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
  83. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  84. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  85. package/esm2022/button/button-base.mjs +7 -7
  86. package/esm2022/button/button.mjs +7 -7
  87. package/esm2022/button/fab.mjs +13 -13
  88. package/esm2022/button/icon-button.mjs +8 -8
  89. package/esm2022/button/module.mjs +5 -5
  90. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  91. package/esm2022/button-toggle/button-toggle.mjs +7 -7
  92. package/esm2022/card/card.mjs +43 -43
  93. package/esm2022/card/module.mjs +5 -5
  94. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  95. package/esm2022/checkbox/checkbox.mjs +4 -4
  96. package/esm2022/checkbox/module.mjs +9 -9
  97. package/esm2022/chips/chip-action.mjs +4 -4
  98. package/esm2022/chips/chip-edit-input.mjs +4 -4
  99. package/esm2022/chips/chip-grid.mjs +4 -4
  100. package/esm2022/chips/chip-icons.mjs +10 -10
  101. package/esm2022/chips/chip-input.mjs +4 -4
  102. package/esm2022/chips/chip-listbox.mjs +4 -4
  103. package/esm2022/chips/chip-option.mjs +6 -6
  104. package/esm2022/chips/chip-row.mjs +6 -6
  105. package/esm2022/chips/chip-set.mjs +4 -4
  106. package/esm2022/chips/chip.mjs +5 -5
  107. package/esm2022/chips/module.mjs +5 -5
  108. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  109. package/esm2022/core/datetime/index.mjs +9 -9
  110. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  111. package/esm2022/core/error/error-options.mjs +7 -7
  112. package/esm2022/core/internal-form-field/internal-form-field.mjs +4 -4
  113. package/esm2022/core/line/line.mjs +8 -8
  114. package/esm2022/core/option/index.mjs +5 -5
  115. package/esm2022/core/option/optgroup.mjs +4 -4
  116. package/esm2022/core/option/option.mjs +4 -4
  117. package/esm2022/core/private/ripple-loader.mjs +4 -4
  118. package/esm2022/core/ripple/index.mjs +5 -5
  119. package/esm2022/core/ripple/ripple.mjs +4 -4
  120. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  121. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  122. package/esm2022/core/version.mjs +1 -1
  123. package/esm2022/datepicker/calendar-body.mjs +4 -4
  124. package/esm2022/datepicker/calendar.mjs +7 -7
  125. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  126. package/esm2022/datepicker/date-range-input.mjs +4 -4
  127. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  128. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  129. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  130. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  131. package/esm2022/datepicker/datepicker-base.mjs +7 -7
  132. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  133. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  134. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  135. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  136. package/esm2022/datepicker/datepicker-toggle.mjs +7 -7
  137. package/esm2022/datepicker/datepicker.mjs +4 -4
  138. package/esm2022/datepicker/month-view.mjs +4 -4
  139. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  140. package/esm2022/datepicker/year-view.mjs +4 -4
  141. package/esm2022/dialog/dialog-container.mjs +4 -4
  142. package/esm2022/dialog/dialog-content-directives.mjs +19 -16
  143. package/esm2022/dialog/dialog.mjs +4 -4
  144. package/esm2022/dialog/module.mjs +5 -5
  145. package/esm2022/divider/divider-module.mjs +5 -5
  146. package/esm2022/divider/divider.mjs +4 -4
  147. package/esm2022/expansion/accordion.mjs +4 -4
  148. package/esm2022/expansion/expansion-module.mjs +5 -5
  149. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  150. package/esm2022/expansion/expansion-panel-header.mjs +10 -10
  151. package/esm2022/expansion/expansion-panel.mjs +7 -7
  152. package/esm2022/form-field/directives/error.mjs +4 -4
  153. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  154. package/esm2022/form-field/directives/hint.mjs +4 -4
  155. package/esm2022/form-field/directives/label.mjs +4 -4
  156. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  157. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  158. package/esm2022/form-field/directives/prefix.mjs +4 -4
  159. package/esm2022/form-field/directives/suffix.mjs +4 -4
  160. package/esm2022/form-field/form-field-control.mjs +4 -4
  161. package/esm2022/form-field/form-field.mjs +4 -4
  162. package/esm2022/form-field/module.mjs +5 -5
  163. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  164. package/esm2022/grid-list/grid-list.mjs +4 -4
  165. package/esm2022/grid-list/grid-tile.mjs +16 -16
  166. package/esm2022/icon/icon-module.mjs +5 -5
  167. package/esm2022/icon/icon-registry.mjs +4 -4
  168. package/esm2022/icon/icon.mjs +4 -4
  169. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  170. package/esm2022/input/input.mjs +4 -4
  171. package/esm2022/input/module.mjs +5 -5
  172. package/esm2022/list/action-list.mjs +4 -4
  173. package/esm2022/list/list-base.mjs +7 -7
  174. package/esm2022/list/list-item-sections.mjs +19 -19
  175. package/esm2022/list/list-module.mjs +5 -5
  176. package/esm2022/list/list-option.mjs +4 -4
  177. package/esm2022/list/list.mjs +7 -7
  178. package/esm2022/list/nav-list.mjs +4 -4
  179. package/esm2022/list/selection-list.mjs +4 -4
  180. package/esm2022/list/subheader.mjs +4 -4
  181. package/esm2022/menu/menu-content.mjs +4 -4
  182. package/esm2022/menu/menu-item.mjs +4 -4
  183. package/esm2022/menu/menu-trigger.mjs +4 -4
  184. package/esm2022/menu/menu.mjs +4 -4
  185. package/esm2022/menu/module.mjs +5 -5
  186. package/esm2022/paginator/module.mjs +5 -5
  187. package/esm2022/paginator/paginator-intl.mjs +4 -4
  188. package/esm2022/paginator/paginator.mjs +4 -4
  189. package/esm2022/progress-bar/module.mjs +5 -5
  190. package/esm2022/progress-bar/progress-bar.mjs +4 -4
  191. package/esm2022/progress-spinner/module.mjs +5 -5
  192. package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
  193. package/esm2022/radio/module.mjs +5 -5
  194. package/esm2022/radio/radio.mjs +7 -7
  195. package/esm2022/select/module.mjs +5 -5
  196. package/esm2022/select/select.mjs +7 -7
  197. package/esm2022/sidenav/drawer.mjs +10 -10
  198. package/esm2022/sidenav/sidenav-module.mjs +5 -5
  199. package/esm2022/sidenav/sidenav.mjs +10 -10
  200. package/esm2022/slide-toggle/module.mjs +9 -9
  201. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  202. package/esm2022/slide-toggle/slide-toggle.mjs +6 -6
  203. package/esm2022/slider/module.mjs +5 -5
  204. package/esm2022/slider/slider-input.mjs +7 -7
  205. package/esm2022/slider/slider-thumb.mjs +4 -4
  206. package/esm2022/slider/slider.mjs +4 -4
  207. package/esm2022/snack-bar/module.mjs +5 -5
  208. package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
  209. package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
  210. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  211. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  212. package/esm2022/sort/sort-header-intl.mjs +4 -4
  213. package/esm2022/sort/sort-header.mjs +4 -4
  214. package/esm2022/sort/sort-module.mjs +5 -5
  215. package/esm2022/sort/sort.mjs +4 -4
  216. package/esm2022/stepper/step-content.mjs +4 -4
  217. package/esm2022/stepper/step-header.mjs +4 -4
  218. package/esm2022/stepper/step-label.mjs +4 -4
  219. package/esm2022/stepper/stepper-button.mjs +7 -7
  220. package/esm2022/stepper/stepper-icon.mjs +4 -4
  221. package/esm2022/stepper/stepper-intl.mjs +4 -4
  222. package/esm2022/stepper/stepper-module.mjs +5 -5
  223. package/esm2022/stepper/stepper.mjs +7 -7
  224. package/esm2022/table/cell.mjs +22 -22
  225. package/esm2022/table/module.mjs +5 -5
  226. package/esm2022/table/row.mjs +22 -22
  227. package/esm2022/table/table.mjs +7 -7
  228. package/esm2022/table/text-column.mjs +4 -4
  229. package/esm2022/tabs/ink-bar.mjs +4 -4
  230. package/esm2022/tabs/module.mjs +5 -5
  231. package/esm2022/tabs/paginated-tab-header.mjs +4 -4
  232. package/esm2022/tabs/tab-body.mjs +7 -7
  233. package/esm2022/tabs/tab-content.mjs +4 -4
  234. package/esm2022/tabs/tab-group.mjs +4 -4
  235. package/esm2022/tabs/tab-header.mjs +4 -4
  236. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  237. package/esm2022/tabs/tab-label.mjs +4 -4
  238. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
  239. package/esm2022/tabs/tab.mjs +4 -4
  240. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  241. package/esm2022/toolbar/toolbar.mjs +7 -7
  242. package/esm2022/tooltip/module.mjs +5 -5
  243. package/esm2022/tooltip/tooltip.mjs +11 -8
  244. package/esm2022/tree/node.mjs +10 -10
  245. package/esm2022/tree/outlet.mjs +4 -4
  246. package/esm2022/tree/padding.mjs +4 -4
  247. package/esm2022/tree/toggle.mjs +4 -4
  248. package/esm2022/tree/tree-module.mjs +5 -5
  249. package/esm2022/tree/tree.mjs +4 -4
  250. package/fesm2022/autocomplete.mjs +13 -13
  251. package/fesm2022/autocomplete.mjs.map +1 -1
  252. package/fesm2022/badge.mjs +10 -10
  253. package/fesm2022/badge.mjs.map +1 -1
  254. package/fesm2022/bottom-sheet.mjs +10 -10
  255. package/fesm2022/bottom-sheet.mjs.map +1 -1
  256. package/fesm2022/button-toggle.mjs +10 -10
  257. package/fesm2022/button-toggle.mjs.map +1 -1
  258. package/fesm2022/button.mjs +35 -35
  259. package/fesm2022/button.mjs.map +1 -1
  260. package/fesm2022/card.mjs +46 -46
  261. package/fesm2022/card.mjs.map +1 -1
  262. package/fesm2022/checkbox.mjs +14 -14
  263. package/fesm2022/checkbox.mjs.map +1 -1
  264. package/fesm2022/chips.mjs +45 -45
  265. package/fesm2022/chips.mjs.map +1 -1
  266. package/fesm2022/core.mjs +59 -59
  267. package/fesm2022/core.mjs.map +1 -1
  268. package/fesm2022/datepicker.mjs +82 -82
  269. package/fesm2022/datepicker.mjs.map +1 -1
  270. package/fesm2022/dialog.mjs +28 -25
  271. package/fesm2022/dialog.mjs.map +1 -1
  272. package/fesm2022/divider.mjs +7 -7
  273. package/fesm2022/divider.mjs.map +1 -1
  274. package/fesm2022/expansion.mjs +25 -25
  275. package/fesm2022/expansion.mjs.map +1 -1
  276. package/fesm2022/form-field.mjs +34 -34
  277. package/fesm2022/form-field.mjs.map +1 -1
  278. package/fesm2022/grid-list.mjs +22 -22
  279. package/fesm2022/grid-list.mjs.map +1 -1
  280. package/fesm2022/icon/testing.mjs +7 -7
  281. package/fesm2022/icon/testing.mjs.map +1 -1
  282. package/fesm2022/icon.mjs +10 -10
  283. package/fesm2022/icon.mjs.map +1 -1
  284. package/fesm2022/input.mjs +7 -7
  285. package/fesm2022/input.mjs.map +1 -1
  286. package/fesm2022/list.mjs +49 -49
  287. package/fesm2022/list.mjs.map +1 -1
  288. package/fesm2022/menu.mjs +16 -16
  289. package/fesm2022/menu.mjs.map +1 -1
  290. package/fesm2022/paginator.mjs +10 -10
  291. package/fesm2022/paginator.mjs.map +1 -1
  292. package/fesm2022/progress-bar.mjs +7 -7
  293. package/fesm2022/progress-bar.mjs.map +1 -1
  294. package/fesm2022/progress-spinner.mjs +7 -7
  295. package/fesm2022/progress-spinner.mjs.map +1 -1
  296. package/fesm2022/radio.mjs +10 -10
  297. package/fesm2022/radio.mjs.map +1 -1
  298. package/fesm2022/select.mjs +10 -10
  299. package/fesm2022/select.mjs.map +1 -1
  300. package/fesm2022/sidenav.mjs +22 -22
  301. package/fesm2022/sidenav.mjs.map +1 -1
  302. package/fesm2022/slide-toggle.mjs +16 -16
  303. package/fesm2022/slide-toggle.mjs.map +1 -1
  304. package/fesm2022/slider.mjs +16 -16
  305. package/fesm2022/slider.mjs.map +1 -1
  306. package/fesm2022/snack-bar.mjs +22 -22
  307. package/fesm2022/snack-bar.mjs.map +1 -1
  308. package/fesm2022/sort.mjs +13 -13
  309. package/fesm2022/sort.mjs.map +1 -1
  310. package/fesm2022/stepper.mjs +31 -31
  311. package/fesm2022/stepper.mjs.map +1 -1
  312. package/fesm2022/table.mjs +55 -55
  313. package/fesm2022/table.mjs.map +1 -1
  314. package/fesm2022/tabs.mjs +43 -43
  315. package/fesm2022/tabs.mjs.map +1 -1
  316. package/fesm2022/toolbar.mjs +10 -10
  317. package/fesm2022/toolbar.mjs.map +1 -1
  318. package/fesm2022/tooltip.mjs +14 -11
  319. package/fesm2022/tooltip.mjs.map +1 -1
  320. package/fesm2022/tree.mjs +25 -25
  321. package/fesm2022/tree.mjs.map +1 -1
  322. package/package.json +2 -2
  323. package/prebuilt-themes/azure-blue.css +1 -1
  324. package/prebuilt-themes/cyan-orange.css +1 -1
  325. package/prebuilt-themes/deeppurple-amber.css +1 -1
  326. package/prebuilt-themes/indigo-pink.css +1 -1
  327. package/prebuilt-themes/magenta-violet.css +1 -1
  328. package/prebuilt-themes/pink-bluegrey.css +1 -1
  329. package/prebuilt-themes/purple-green.css +1 -1
  330. package/prebuilt-themes/rose-red.css +1 -1
  331. package/schematics/ng-add/index.js +1 -1
  332. package/schematics/ng-add/index.mjs +1 -1
  333. package/schematics/ng-generate/m3-theme/index_bundled.js +4 -3
  334. package/schematics/ng-generate/m3-theme/index_bundled.js.map +2 -2
  335. package/schematics/ng-generate/m3-theme/schema.json +3 -20
  336. package/core/tokens/_custom-tokens.scss +0 -1918
@@ -1,102 +1,12 @@
1
- @use 'sass:list';
2
1
  @use 'sass:map';
3
- @use 'sass:meta';
4
2
  @use '@material/tokens/v0_161' as mdc-tokens;
5
3
  @use '../style/sass-utils';
6
4
  @use '../m2' as m2-theming;
5
+ @use './m3';
7
6
  @use '../tokens/m2' as m2-tokens;
8
7
  @use './density';
9
- @use './custom-tokens';
10
8
  @use './format-tokens';
11
9
 
12
- // TODO(mmalerba): Split up this file into smaller pieces.
13
-
14
- /// Maps the values in a map to new values using the given mapping function
15
- /// @param {Map} $map The maps whose values will be mapped to new values.
16
- /// @param {Function} $fn The value mapping function.
17
- /// @param {Map} A new map with its values updated using the mapping function.
18
- @function _map-values($map, $fn) {
19
- $result: ();
20
- @each $key, $value in $map {
21
- $result: map.set($result, $key, meta.call($fn, $value));
22
- }
23
- @return $result;
24
- }
25
-
26
- /// Picks a submap containing only the given keys out the given map.
27
- /// @param {Map} $map The map to pick from.
28
- /// @param {List} $keys The map keys to pick.
29
- /// @return {Map} A submap containing only the given keys.
30
- @function _pick($map, $keys) {
31
- $result: ();
32
- @each $key in $keys {
33
- @if map.has-key($map, $key) {
34
- $result: map.set($result, $key, map.get($map, $key));
35
- }
36
- }
37
- @return $result;
38
- }
39
-
40
- /// Filters keys with a null value out of the map.
41
- /// @param {Map} $map The map to filter.
42
- /// @return {Map} The given map with all of the null keys filtered out.
43
- @function _filter-nulls($map) {
44
- $result: ();
45
- @each $key, $val in $map {
46
- @if $val != null {
47
- $result: map.set($result, $key, $val);
48
- }
49
- }
50
- @return $result;
51
- }
52
-
53
- /// Renames the keys in a map
54
- /// @param {Map} $map The map whose keys should be renamed
55
- /// @param {Map} $rename-keys A map of original key to renamed key to apply to $map
56
- /// @return {Map} The result of applying the given key renames to the given map.
57
- @function _rename-map-keys($map, $rename-keys) {
58
- $result: $map;
59
- @each $old-key-name, $new-key-name in $rename-keys {
60
- @if map.has-key($map, $old-key-name) {
61
- $result: map.set($result, $new-key-name, map.get($map, $old-key-name));
62
- }
63
- }
64
- @return $result;
65
- }
66
-
67
- /// Gets the MDC tokens for the given prefix, M3 token values, and supported token slots.
68
- /// @param {List} $prefix The token prefix for the given tokens.
69
- /// @param {Map|(Map, Map)} $values A map of M3 token values for the given prefix.
70
- /// This param may also be a tuple of maps, the first one representing the default M3 token values,
71
- // and the second containing overrides for different color variants.
72
- // Single map example:
73
- // (token1: green, token2: 2px)
74
- // Tuple example:
75
- // (
76
- // (token1: green, token2: 2px),
77
- // (
78
- // secondary: (token1: blue),
79
- // error: (token1: red),
80
- // )
81
- // )
82
- /// @param {Map} $slots A map of token slots, with null value indicating the token is not supported.
83
- /// @param {String|null} $variant The name of the variant the token values are for.
84
- /// @return {Map} A map of fully qualified token names to values, for only the supported tokens.
85
- @function _namespace-tokens($prefix, $values, $slots, $variant: null) {
86
- $result: ();
87
- @if $variant == null and meta.type-of($values) == 'list' and list.length($values == 2) {
88
- $variants: list.nth($values, 2);
89
- $values: list.nth($values, 1);
90
- @each $variant, $overrides in $variants {
91
- $result: map.merge($result, _namespace-tokens($prefix, $overrides, $slots, $variant));
92
- }
93
- }
94
- $used-token-names: map.keys(_filter-nulls(map.get($slots, $prefix)));
95
- $used-m3-tokens: _pick(_filter-nulls($values), $used-token-names);
96
- $prefix: if($variant == null, $prefix, list.append($prefix, $variant));
97
- @return map.merge($result, ($prefix: $used-m3-tokens));
98
- }
99
-
100
10
  /// Generates tokens for the given palette with the given prefix.
101
11
  /// @param {Map} $palette The palette to generate tokens for
102
12
  /// @param {String} $prefix The key prefix used to name the tokens
@@ -147,346 +57,30 @@
147
57
  );
148
58
  }
149
59
 
150
- /// At the time of writing, some color tokens (e.g. disabled state) are defined as a solid color
151
- /// token and a separate opacity token. This function applies the opacity to the color and drops the
152
- /// opacity key from the map. Can be removed once b/213331407 is resolved.
153
- /// @param {Map} $tokens The map of tokens currently being generated
154
- /// @param {Map} $all-tokens A map of all tokens, including hardcoded values
155
- /// @param {List} $pairs Pairs of color token names and their opacities. Should be in the shape of
156
- /// `((color: 'color-key', opacity: 'opacity-key'))`.
157
- /// @return {Map} The initial tokens with the combined color values.
158
- @function _combine-color-tokens($tokens, $opacity-lookup, $pairs) {
159
- $result: $tokens;
160
-
161
- @each $pair in $pairs {
162
- $color-key: map.get($pair, color);
163
- $opacity-key: map.get($pair, opacity);
164
- $color: map.get($tokens, $color-key);
165
- $opacity: map.get($opacity-lookup, $opacity-key);
166
-
167
- @if(meta.type-of($color) == 'color') {
168
- $result: map.remove($result, $opacity-key);
169
- $result: map.set($result, $color-key, rgba($color, $opacity));
170
- }
171
- @else if($color != null) {
172
- $result: map.remove($result, $opacity-key);
173
- $combined-color: #{color-mix(in srgb, #{$color} #{($opacity * 100) + '%'}, transparent)};
174
- $result: map.set($result, $color-key, $combined-color);
175
- }
176
- }
177
-
178
- @return $result;
179
- }
180
-
181
- /// Renames the official checkbox tokens to match the names actually used in MDC's code (which are
182
- /// different). This is a temporary workaround until MDC updates to use the correct names for the
183
- /// tokens.
184
- /// @param {Map} $tokens The map of checkbox tokens with the official tokens names
185
- /// @param {Map} $all-tokens Map of all checkbox tokens, including hardcoded values.
186
- /// This is necessary in order to do opacity lookups.
187
- /// @return {Map} The given tokens, renamed to be compatible with MDC's token implementation.
188
- @function _fix-checkbox-tokens($tokens) {
189
- // Need to get the hardcoded values, because they include opacities that are used for the disabled
190
- // state.
191
- $hardcoded-tokens: mdc-tokens.md-comp-checkbox-values((), false);
192
-
193
- $rename-keys: (
194
- selected-icon-color: selected-checkmark-color,
195
- selected-disabled-icon-color: disabled-selected-checkmark-color,
196
- selected-container-color: selected-icon-color,
197
- selected-hover-container-color: selected-hover-icon-color,
198
- selected-disabled-container-color: disabled-selected-icon-color,
199
- selected-disabled-container-opacity: disabled-selected-icon-opacity,
200
- selected-focus-container-color: selected-focus-icon-color,
201
- selected-pressed-container-color: selected-pressed-icon-color,
202
- unselected-disabled-outline-color: disabled-unselected-icon-color,
203
- unselected-disabled-container-opacity: disabled-unselected-icon-opacity,
204
- unselected-focus-outline-color: unselected-focus-icon-color,
205
- unselected-hover-outline-color: unselected-hover-icon-color,
206
- unselected-outline-color: unselected-icon-color,
207
- unselected-pressed-outline-color: unselected-pressed-icon-color
208
- );
209
-
210
- $remapped-tokens: _rename-map-keys($tokens, $rename-keys);
211
- $remapped-hardcoded-tokens: _rename-map-keys($hardcoded-tokens, $rename-keys);
212
-
213
- @return _combine-color-tokens($remapped-tokens, $remapped-hardcoded-tokens, (
214
- (
215
- color: disabled-selected-icon-color,
216
- opacity: disabled-selected-icon-opacity,
217
- ),
218
- (
219
- color: disabled-unselected-icon-color,
220
- opacity: disabled-unselected-icon-opacity,
221
- ),
222
- ));
223
- }
224
-
225
- /// Fixes inconsistent values in the filled text field tokens so that they can produce valid
226
- /// styles.
227
- /// @param {Map} $initial-tokens Map of filled text field tokens currently being generated.
228
- /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
229
- @function _fix-filled-text-field-tokens($initial-tokens) {
230
- // Need to get the hardcoded values, because they include opacities that are used for the disabled
231
- // state.
232
- $hardcoded-tokens: mdc-tokens.md-comp-filled-text-field-values((), false);
233
-
234
- $tokens: _combine-color-tokens($initial-tokens, $hardcoded-tokens, (
235
- (
236
- color: disabled-active-indicator-color,
237
- opacity: disabled-active-indicator-opacity
238
- ),
239
- (
240
- color: disabled-container-color,
241
- opacity: disabled-container-opacity
242
- ),
243
- (
244
- color: disabled-input-text-color,
245
- opacity: disabled-input-text-opacity
246
- ),
247
- (
248
- color: disabled-label-text-color,
249
- opacity: disabled-label-text-opacity
250
- ),
251
- (
252
- color: disabled-leading-icon-color,
253
- opacity: disabled-leading-icon-opacity
254
- ),
255
- (
256
- color: disabled-supporting-text-color,
257
- opacity: disabled-supporting-text-opacity
258
- ),
259
- (
260
- color: disabled-trailing-icon-color,
261
- opacity: disabled-trailing-icon-opacity
262
- )
263
- ));
264
-
265
- $container-shape: map.get($tokens, container-shape);
60
+ $_cached-token-slots: null;
266
61
 
267
- // The M2 token slots define a single `container-shape` slot while the M3 tokens provide a list
268
- // of shapes (e.g. top/bottom/left/right). Extract the first value so it matches the expected
269
- // token slot in M2.
270
- @if meta.type-of($container-shape) == 'list' {
271
- $tokens: map.set($tokens, container-shape, list.nth($container-shape, 1));
62
+ /// Determines the token slots for all components.
63
+ @function _get-token-slots() {
64
+ // Cache the slots since they're constant and calculating
65
+ // them appears to be expensive (see #29009).
66
+ @if ($_cached-token-slots) {
67
+ @return $_cached-token-slots;
272
68
  }
273
69
 
274
- @return $tokens;
275
- }
276
-
277
-
278
- /// Fixes inconsistent values in the text button tokens so that they can produce valid styles.
279
- /// @param {Map} $initial-tokens Map of text button tokens currently being generated.
280
- /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
281
- @function _fix-text-button-tokens($initial-tokens) {
282
- // Need to get the hardcoded values, because they include opacities that are used for the disabled
283
- // state.
284
- $hardcoded-tokens: mdc-tokens.md-comp-text-button-values((), false);
285
-
286
- @return _combine-color-tokens($initial-tokens, $hardcoded-tokens, (
287
- (
288
- color: disabled-label-text-color,
289
- opacity: disabled-label-text-opacity,
290
- ),
291
- ));
292
- }
293
-
294
- /// Fixes inconsistent values in the filled button tokens so that they can produce valid styles.
295
- /// @param {Map} $initial-tokens Map of filled button tokens currently being generated.
296
- /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
297
- @function _fix-filled-button-tokens($initial-tokens) {
298
- // Need to get the hardcoded values, because they include opacities that are used for the disabled
299
- // state.
300
- $hardcoded-tokens: mdc-tokens.md-comp-filled-button-values((), false);
301
-
302
- @return _combine-color-tokens($initial-tokens, $hardcoded-tokens, (
303
- (
304
- color: disabled-label-text-color,
305
- opacity: disabled-label-text-opacity,
306
- ),
307
- (
308
- color: disabled-container-color,
309
- opacity: disabled-container-opacity,
310
- )
311
- ));
312
- }
313
-
314
- /// Fixes inconsistent values in the protected button tokens so that they can produce valid styles.
315
- /// @param {Map} $initial-tokens Map of protected button tokens currently being generated.
316
- /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
317
- @function _fix-protected-button-tokens($initial-tokens) {
318
- // Need to get the hardcoded values, because they include opacities that are used for the disabled
319
- // state.
320
- $hardcoded-tokens: mdc-tokens.md-comp-elevated-button-values((), false);
321
-
322
- @return _combine-color-tokens($initial-tokens, $hardcoded-tokens, (
323
- (
324
- color: disabled-label-text-color,
325
- opacity: disabled-label-text-opacity,
326
- ),
327
- (
328
- color: disabled-container-color,
329
- opacity: disabled-container-opacity,
330
- )
331
- ));
332
- }
333
-
334
- /// Fixes inconsistent values in the outlined button tokens so that they can produce valid styles.
335
- /// @param {Map} $initial-tokens Map of outlined button tokens currently being generated.
336
- /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
337
- @function _fix-outlined-button-tokens($initial-tokens) {
338
- $hardcoded-tokens: mdc-tokens.md-comp-outlined-button-values((), false);
339
-
340
- @return _combine-color-tokens($initial-tokens, $hardcoded-tokens, (
341
- (
342
- color: disabled-label-text-color,
343
- opacity: disabled-label-text-opacity,
344
- ),
345
- (
346
- color: disabled-outline-color,
347
- opacity: disabled-outline-opacity,
348
- )
349
- ));
350
- }
351
-
352
- /// Fixes inconsistent values in the outlined text field tokens so that they can produce valid
353
- /// styles.
354
- /// @param {Map} $initial-tokens Map of outlined text field tokens currently being generated.
355
- /// @param {Map} $all-tokens Map of all outlined text field tokens, including hardcoded values.
356
- /// This is necessary in order to do opacity lookups.
357
- /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
358
- @function _fix-outlined-text-field-tokens($initial-tokens) {
359
- // Need to get the hardcoded values, because they include opacities that are used for the disabled
360
- // state.
361
- $hardcoded-tokens: mdc-tokens.md-comp-outlined-text-field-values((), false);
362
-
363
- @return _combine-color-tokens($initial-tokens, $hardcoded-tokens, (
364
- (
365
- color: disabled-outline-color,
366
- opacity: disabled-outline-opacity
367
- ),
368
- (
369
- color: disabled-active-indicator-color,
370
- opacity: disabled-active-indicator-opacity
371
- ),
372
- (
373
- color: disabled-container-color,
374
- opacity: disabled-container-opacity
375
- ),
376
- (
377
- color: disabled-input-text-color,
378
- opacity: disabled-input-text-opacity
379
- ),
380
- (
381
- color: disabled-label-text-color,
382
- opacity: disabled-label-text-opacity
383
- ),
384
- (
385
- color: disabled-leading-icon-color,
386
- opacity: disabled-leading-icon-opacity
387
- ),
388
- (
389
- color: disabled-supporting-text-color,
390
- opacity: disabled-supporting-text-opacity
391
- ),
392
- (
393
- color: disabled-trailing-icon-color,
394
- opacity: disabled-trailing-icon-opacity
395
- )
396
- ));
397
- }
398
-
399
- /// Gets the token values for the MDC form field.
400
- /// @param {Map} $systems The MDC system tokens.
401
- /// @return {Map} The form field tokens.
402
- @function _get-form-field-tokens($systems) {
403
- @return (
404
- // TODO: MDC currently doesn't provide tokens for the form field so we need to
405
- // define them ourselves. Clean this up once b/246297033 is resolved.
406
- label-text-color: map.get($systems, 'md-sys-color', 'on-surface'),
407
- label-text-font: map.get($systems, 'md-sys-typescale', 'body-medium-font'),
408
- label-text-line-height: map.get($systems, 'md-sys-typescale', 'body-medium-line-height'),
409
- label-text-size: map.get($systems, 'md-sys-typescale', 'body-medium-size'),
410
- label-text-tracking: map.get($systems, 'md-sys-typescale', 'body-medium-tracking'),
411
- label-text-weight: map.get($systems, 'md-sys-typescale', 'body-medium-weight'),
412
- );
413
- }
414
-
415
- /// Fixes inconsistent values in the icon button tokens so that they can produce valid styles.
416
- /// @param {Map} $initial-tokens Map of icon button tokens currently being generated.
417
- /// @param {Map} $all-tokens Map of all icon button tokens, including hardcoded values.
418
- /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
419
- @function _fix-icon-button-tokens($tokens) {
420
- // Need to get the hardcoded values, because they include opacities that are used for the disabled
421
- // state.
422
- $hardcoded-tokens: mdc-tokens.md-comp-icon-button-values((), false);
423
-
424
- $rename-keys: (
425
- unselected-icon-color: icon-color,
426
- );
427
-
428
- $remapped-tokens: _rename-map-keys($tokens, $rename-keys);
429
- $remapped-hardcoded-tokens: _rename-map-keys($hardcoded-tokens, $rename-keys);
430
-
431
- @return _combine-color-tokens($remapped-tokens, $remapped-hardcoded-tokens, (
432
- (
433
- color: disabled-icon-color,
434
- opacity: disabled-icon-opacity,
70
+ // TODO(mmalerba): Refactor this to not depend on the legacy theme when moving out of
71
+ // material-experimental. This is a hack for now because there is no good way to get the token
72
+ // slots in material-experimental without exposing them all from material.
73
+ $fake-theme: m2-theming.define-light-theme((
74
+ color: (
75
+ primary: m2-theming.define-palette(m2-theming.$red-palette),
76
+ accent: m2-theming.define-palette(m2-theming.$red-palette),
77
+ warn: m2-theming.define-palette(m2-theming.$red-palette),
435
78
  ),
79
+ typography: m2-theming.define-typography-config(),
80
+ density: 0
436
81
  ));
437
- }
438
-
439
- /// Fixes inconsistent values in the dialog tokens so that they can produce valid styles.
440
- /// @param {Map} $initial-tokens Map of dialog tokens currently being generated.
441
- /// @param {Map} $all-tokens Map of all dialog tokens, including hardcoded values.
442
- /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
443
- @function _fix-dialog-tokens($systems, $tokens) {
444
- $tokens: _rename-map-keys($tokens, (
445
- headline-color: subhead-color,
446
- headline-font: subhead-font,
447
- headline-line-height: subhead-line-height,
448
- headline-size: subhead-size,
449
- headline-tracking: subhead-tracking,
450
- headline-weight: subhead-weight,
451
- ));
452
-
453
- @if map.get($tokens, container-elevation) != null {
454
- $tokens: map.merge($tokens, (
455
- // The spec has the dialog at an elevation of 3 which is consistent with the current
456
- // version of the tokens (0_161), however both the designs and MDC's implementation
457
- // have the elevation set to 0. Set it manually to 0 here since the value in the
458
- // exported tokens is likely outdated.
459
- container-elevation: 0,
460
-
461
- // This color needs to be supplied for MDC to produce the shadow. Technically we don't
462
- // have to provide it since the elevation is set to 0 above, but we do it in case
463
- // the value changes in the future.
464
- container-shadow-color: #000,
465
- ));
466
- }
467
-
468
- @return $tokens;
469
- }
470
-
471
- /// Fixes values in the list tokens that are inconsistent with its usage.
472
- /// @param {Map} $initial-tokens Map of list tokens currently being generated.
473
- /// @return {Map} The given tokens, with the inconsistent values replaced with valid ones.
474
- @function _fix-list-tokens($tokens) {
475
- // This does not match the spec, which defines this to be `md.sys.color.surface`.
476
- // However, this interferes with the use case of placing a list on other components. For example,
477
- // the bottom sheet's container color is `md.sys.color.surface-container-low`. Instead, allow the
478
- // list to just display the colors for its background.
479
- @if map.get($tokens, list-item-container-color) != null {
480
- $tokens: map.set($tokens, list-item-container-color, transparent);
481
- }
482
-
483
- // Match spec, which has list-item-leading-icon-size of 24px. Current version of tokens (0_161)
484
- // has 18px.
485
- @if map.get($tokens, list-item-leading-icon-size) != null {
486
- $tokens: map.set($tokens, list-item-leading-icon-size, 24px);
487
- }
488
-
489
- @return $tokens;
82
+ $_cached-token-slots: m2-tokens.m2-tokens-from-theme($fake-theme) !global;
83
+ @return $_cached-token-slots;
490
84
  }
491
85
 
492
86
  /// Generates a set of namespaced tokens for all components.
@@ -507,20 +101,7 @@
507
101
  // DO NOT REMOVE
508
102
  // This function is used internally.
509
103
  $systems: format-tokens.private-format-tokens($systems);
510
-
511
- // TODO(mmalerba): Refactor this to not depend on the legacy theme when moving out of
512
- // material-experimental. This is a hack for now because there is no good way to get the token
513
- // slots in material-experimental without exposing them all from material.
514
- $fake-theme: m2-theming.define-light-theme((
515
- color: (
516
- primary: m2-theming.define-palette(m2-theming.$red-palette),
517
- accent: m2-theming.define-palette(m2-theming.$red-palette),
518
- warn: m2-theming.define-palette(m2-theming.$red-palette),
519
- ),
520
- typography: m2-theming.define-typography-config(),
521
- density: 0
522
- ));
523
- $token-slots: m2-tokens.m2-tokens-from-theme($fake-theme);
104
+ $token-slots: _get-token-slots();
524
105
 
525
106
  // TODO(mmalerba): Fill in remaining tokens.
526
107
  $result: sass-utils.deep-merge-all(
@@ -529,447 +110,7 @@
529
110
  (mdc, theme): map.get($systems, md-sys-color),
530
111
  (mdc, typography): map.get($systems, md-sys-typescale),
531
112
  ),
532
- // Get the official MDC component tokens
533
- _namespace-tokens(
534
- (mdc, checkbox),
535
- (
536
- _fix-checkbox-tokens(mdc-tokens.md-comp-checkbox-values($systems, $exclude-hardcoded)),
537
- _map-values(
538
- custom-tokens.mdc-checkbox-color-variants($systems, $exclude-hardcoded),
539
- meta.get-function(_fix-checkbox-tokens)
540
- )
541
- ),
542
- $token-slots
543
- ),
544
- _namespace-tokens(
545
- (mdc, chip),
546
- custom-tokens.mdc-chip($systems, $exclude-hardcoded),
547
- $token-slots
548
- ),
549
- _namespace-tokens(
550
- (mdc, circular-progress),
551
- (
552
- mdc-tokens.md-comp-circular-progress-indicator-values($systems, $exclude-hardcoded),
553
- custom-tokens.mdc-circular-progress-color-variants($systems, $exclude-hardcoded),
554
- ),
555
- $token-slots
556
- ),
557
- _namespace-tokens(
558
- (mdc, dialog),
559
- _fix-dialog-tokens($systems, mdc-tokens.md-comp-dialog-values($systems, $exclude-hardcoded)),
560
- $token-slots
561
- ),
562
- _namespace-tokens(
563
- (mdc, elevated-card),
564
- mdc-tokens.md-comp-elevated-card-values($systems, $exclude-hardcoded),
565
- $token-slots
566
- ),
567
- _namespace-tokens(
568
- (mdc, fab),
569
- (
570
- mdc-tokens.md-comp-fab-primary-values($systems, $exclude-hardcoded),
571
- (
572
- // Color variants
573
- primary: (), // Default, no overrides needed.
574
- secondary: mdc-tokens.md-comp-fab-secondary-values($systems, $exclude-hardcoded),
575
- tertiary: mdc-tokens.md-comp-fab-tertiary-values($systems, $exclude-hardcoded)
576
- )
577
- ),
578
- $token-slots
579
- ),
580
- _namespace-tokens(
581
- (mdc, fab-small),
582
- (
583
- mdc-tokens.md-comp-fab-primary-small-values($systems, $exclude-hardcoded),
584
- (
585
- // Color variants
586
- primary: (), // Default, no overrides needed.
587
- secondary: mdc-tokens.md-comp-fab-secondary-small-values($systems, $exclude-hardcoded),
588
- tertiary: mdc-tokens.md-comp-fab-tertiary-small-values($systems, $exclude-hardcoded)
589
- )
590
- ),
591
- $token-slots
592
- ),
593
- _namespace-tokens(
594
- (mdc, extended-fab),
595
- (
596
- mdc-tokens.md-comp-extended-fab-primary-values($systems, $exclude-hardcoded),
597
- (
598
- // Color variants
599
- primary: (), // Default, no overrides needed.
600
- secondary: mdc-tokens.md-comp-extended-fab-secondary-values($systems, $exclude-hardcoded),
601
- tertiary: mdc-tokens.md-comp-extended-fab-tertiary-values($systems, $exclude-hardcoded)
602
- ),
603
- ),
604
- $token-slots
605
- ),
606
- _namespace-tokens(
607
- (mdc, filled-text-field),
608
- (
609
- _fix-filled-text-field-tokens(
610
- mdc-tokens.md-comp-filled-text-field-values($systems, $exclude-hardcoded)
611
- ),
612
- _map-values(
613
- custom-tokens.mdc-filled-text-field-color-variants($systems, $exclude-hardcoded),
614
- meta.get-function(_fix-filled-text-field-tokens)
615
- )
616
- ),
617
- $token-slots
618
- ),
619
- _namespace-tokens(
620
- (mdc, form-field),
621
- _get-form-field-tokens($systems),
622
- $token-slots
623
- ),
624
- _namespace-tokens(
625
- (mdc, icon-button),
626
- _fix-icon-button-tokens(mdc-tokens.md-comp-icon-button-values($systems, $exclude-hardcoded)),
627
- $token-slots
628
- ),
629
- _namespace-tokens(
630
- (mdc, text-button),
631
- (
632
- _fix-text-button-tokens(
633
- mdc-tokens.md-comp-text-button-values($systems, $exclude-hardcoded)
634
- ),
635
- _map-values(
636
- custom-tokens.mdc-text-button-color-variants($systems, $exclude-hardcoded),
637
- meta.get-function(_fix-text-button-tokens)
638
- )
639
- ),
640
- $token-slots
641
- ),
642
- _namespace-tokens(
643
- // Note: in M3 the "protected" button is called "elevated".
644
- (mdc, protected-button),
645
- (
646
- _fix-protected-button-tokens(
647
- mdc-tokens.md-comp-elevated-button-values($systems, $exclude-hardcoded)
648
- ),
649
- _map-values(
650
- custom-tokens.mdc-elevated-button-color-variants($systems, $exclude-hardcoded),
651
- meta.get-function(_fix-protected-button-tokens)
652
- )
653
- ),
654
- $token-slots
655
- ),
656
- _namespace-tokens(
657
- (mdc, filled-button),
658
- (
659
- _fix-filled-button-tokens(
660
- mdc-tokens.md-comp-filled-button-values($systems, $exclude-hardcoded),
661
- ),
662
- _map-values(
663
- custom-tokens.mdc-filled-button-color-variants($systems, $exclude-hardcoded),
664
- meta.get-function(_fix-filled-button-tokens)
665
- )
666
- ),
667
- $token-slots
668
- ),
669
- _namespace-tokens(
670
- (mdc, outlined-button),
671
- (
672
- _fix-outlined-button-tokens(
673
- mdc-tokens.md-comp-outlined-button-values($systems, $exclude-hardcoded),
674
- ),
675
- _map-values(
676
- custom-tokens.mdc-outlined-button-color-variants($systems, $exclude-hardcoded),
677
- meta.get-function(_fix-outlined-button-tokens)
678
- )
679
- ),
680
- $token-slots
681
- ),
682
- _namespace-tokens(
683
- (mdc, linear-progress),
684
- (
685
- mdc-tokens.md-comp-linear-progress-indicator-values($systems, $exclude-hardcoded),
686
- custom-tokens.mdc-linear-progress-color-variants($systems, $exclude-hardcoded),
687
- ),
688
- $token-slots
689
- ),
690
- _namespace-tokens(
691
- (mdc, list),
692
- _fix-list-tokens(
693
- mdc-tokens.md-comp-list-values($systems, $exclude-hardcoded)
694
- ),
695
- $token-slots
696
- ),
697
- _namespace-tokens(
698
- (mdc, outlined-card),
699
- mdc-tokens.md-comp-outlined-card-values($systems, $exclude-hardcoded),
700
- $token-slots
701
- ),
702
- _namespace-tokens(
703
- (mdc, outlined-text-field),
704
- (
705
- _fix-outlined-text-field-tokens(
706
- mdc-tokens.md-comp-outlined-text-field-values($systems, $exclude-hardcoded)
707
- ),
708
- _map-values(
709
- custom-tokens.mdc-outlined-text-field-color-variants($systems, $exclude-hardcoded),
710
- meta.get-function(_fix-outlined-text-field-tokens)
711
- )
712
- ),
713
- $token-slots
714
- ),
715
- _namespace-tokens(
716
- (mdc, plain-tooltip),
717
- mdc-tokens.md-comp-plain-tooltip-values($systems, $exclude-hardcoded),
718
- $token-slots
719
- ),
720
- _namespace-tokens(
721
- (mdc, radio),
722
- (
723
- mdc-tokens.md-comp-radio-button-values($systems, $exclude-hardcoded),
724
- custom-tokens.mdc-radio-color-variants($systems, $exclude-hardcoded)
725
- ),
726
- $token-slots
727
- ),
728
- _namespace-tokens(
729
- (mdc, slider),
730
- (
731
- mdc-tokens.md-comp-slider-values($systems, $exclude-hardcoded),
732
- custom-tokens.mdc-slider-color-variants($systems, $exclude-hardcoded)
733
- ),
734
- $token-slots
735
- ),
736
- _namespace-tokens(
737
- (mdc, snackbar),
738
- mdc-tokens.md-comp-snackbar-values($systems, $exclude-hardcoded),
739
- $token-slots,
740
- ),
741
- _namespace-tokens(
742
- (mdc, switch),
743
- (
744
- mdc-tokens.md-comp-switch-values($systems, $exclude-hardcoded),
745
- custom-tokens.mdc-switch-color-variants($systems, $exclude-hardcoded)
746
- ),
747
- $token-slots
748
- ),
749
- _namespace-tokens(
750
- (mdc, tab),
751
- mdc-tokens.md-comp-secondary-navigation-tab-values($systems, $exclude-hardcoded),
752
- $token-slots
753
- ),
754
-
755
- // Choose values for our made up tokens based on MDC system tokens or sensible hardcoded
756
- // values.
757
- _namespace-tokens(
758
- (mat, app),
759
- custom-tokens.app($systems, $exclude-hardcoded),
760
- $token-slots
761
- ),
762
- _namespace-tokens(
763
- (mdc, tab-indicator),
764
- custom-tokens.tab-indicator($systems, $exclude-hardcoded),
765
- $token-slots
766
- ),
767
- _namespace-tokens(
768
- (mat, autocomplete),
769
- custom-tokens.autocomplete($systems, $exclude-hardcoded),
770
- $token-slots
771
- ),
772
- _namespace-tokens(
773
- (mat, badge),
774
- custom-tokens.badge($systems, $exclude-hardcoded),
775
- $token-slots
776
- ),
777
- _namespace-tokens(
778
- (mat, bottom-sheet),
779
- custom-tokens.bottom-sheet($systems, $exclude-hardcoded),
780
- $token-slots
781
- ),
782
- _namespace-tokens(
783
- (mat, card),
784
- custom-tokens.card($systems, $exclude-hardcoded),
785
- $token-slots
786
- ),
787
- _namespace-tokens(
788
- (mat, chip),
789
- custom-tokens.chip($systems, $exclude-hardcoded),
790
- $token-slots
791
- ),
792
- _namespace-tokens(
793
- (mat, datepicker),
794
- custom-tokens.datepicker($systems, $exclude-hardcoded),
795
- $token-slots
796
- ),
797
- _namespace-tokens(
798
- (mat, dialog),
799
- custom-tokens.dialog($systems, $exclude-hardcoded),
800
- $token-slots
801
- ),
802
- _namespace-tokens(
803
- (mat, divider),
804
- custom-tokens.divider($systems, $exclude-hardcoded),
805
- $token-slots
806
- ),
807
- _namespace-tokens(
808
- (mat, fab),
809
- custom-tokens.fab($systems, $exclude-hardcoded),
810
- $token-slots
811
- ),
812
- _namespace-tokens(
813
- (mat, fab-small),
814
- custom-tokens.fab-small($systems, $exclude-hardcoded),
815
- $token-slots
816
- ),
817
- _namespace-tokens(
818
- (mat, form-field),
819
- custom-tokens.form-field($systems, $exclude-hardcoded),
820
- $token-slots
821
- ),
822
- _namespace-tokens(
823
- (mat, expansion),
824
- custom-tokens.expansion($systems, $exclude-hardcoded),
825
- $token-slots
826
- ),
827
- _namespace-tokens(
828
- (mat, grid-list),
829
- custom-tokens.grid-list($systems, $exclude-hardcoded),
830
- $token-slots
831
- ),
832
- _namespace-tokens(
833
- (mat, icon),
834
- custom-tokens.icon($systems, $exclude-hardcoded),
835
- $token-slots
836
- ),
837
- _namespace-tokens(
838
- (mat, text-button),
839
- custom-tokens.text-button($systems, $exclude-hardcoded),
840
- $token-slots
841
- ),
842
- _namespace-tokens(
843
- (mat, filled-button),
844
- custom-tokens.filled-button($systems, $exclude-hardcoded),
845
- $token-slots
846
- ),
847
- _namespace-tokens(
848
- (mat, list),
849
- custom-tokens.list($systems, $exclude-hardcoded),
850
- $token-slots
851
- ),
852
- _namespace-tokens(
853
- // Note: in M3 the "protected" button is called "elevated".
854
- (mat, protected-button),
855
- custom-tokens.elevated-button($systems, $exclude-hardcoded),
856
- $token-slots
857
- ),
858
- _namespace-tokens(
859
- (mat, outlined-button),
860
- custom-tokens.outlined-button($systems, $exclude-hardcoded),
861
- $token-slots
862
- ),
863
- _namespace-tokens(
864
- (mat, icon-button),
865
- custom-tokens.icon-button($systems, $exclude-hardcoded),
866
- $token-slots
867
- ),
868
- _namespace-tokens(
869
- (mat, menu),
870
- custom-tokens.menu($systems, $exclude-hardcoded),
871
- $token-slots
872
- ),
873
- _namespace-tokens(
874
- (mat, optgroup),
875
- custom-tokens.optgroup($systems, $exclude-hardcoded),
876
- $token-slots
877
- ),
878
- _namespace-tokens(
879
- (mat, option),
880
- custom-tokens.option($systems, $exclude-hardcoded),
881
- $token-slots
882
- ),
883
- _namespace-tokens(
884
- (mat, paginator),
885
- custom-tokens.paginator($systems, $exclude-hardcoded),
886
- $token-slots
887
- ),
888
- _namespace-tokens(
889
- (mat, full-pseudo-checkbox),
890
- custom-tokens.full-pseudo-checkbox($systems, $exclude-hardcoded),
891
- $token-slots
892
- ),
893
- _namespace-tokens(
894
- (mat, minimal-pseudo-checkbox),
895
- custom-tokens.minimal-pseudo-checkbox($systems, $exclude-hardcoded),
896
- $token-slots
897
- ),
898
- _namespace-tokens(
899
- (mat, checkbox),
900
- custom-tokens.checkbox($systems, $exclude-hardcoded),
901
- $token-slots
902
- ),
903
- _namespace-tokens(
904
- (mat, radio),
905
- custom-tokens.radio($systems, $exclude-hardcoded),
906
- $token-slots
907
- ),
908
- _namespace-tokens(
909
- (mat, ripple),
910
- custom-tokens.ripple($systems, $exclude-hardcoded),
911
- $token-slots
912
- ),
913
- _namespace-tokens(
914
- (mat, select),
915
- custom-tokens.select($systems, $exclude-hardcoded),
916
- $token-slots
917
- ),
918
- _namespace-tokens(
919
- (mat, sidenav),
920
- custom-tokens.sidenav($systems, $exclude-hardcoded),
921
- $token-slots
922
- ),
923
- _namespace-tokens(
924
- (mat, slider),
925
- custom-tokens.slider($systems, $exclude-hardcoded),
926
- $token-slots
927
- ),
928
- _namespace-tokens(
929
- (mat, snack-bar),
930
- custom-tokens.snack-bar($systems, $exclude-hardcoded),
931
- $token-slots
932
- ),
933
- _namespace-tokens(
934
- (mat, sort),
935
- custom-tokens.sort($systems, $exclude-hardcoded),
936
- $token-slots
937
- ),
938
- _namespace-tokens(
939
- (mat, standard-button-toggle),
940
- custom-tokens.button-toggle($systems, $exclude-hardcoded),
941
- $token-slots
942
- ),
943
- _namespace-tokens(
944
- (mat, stepper),
945
- custom-tokens.stepper($systems, $exclude-hardcoded),
946
- $token-slots
947
- ),
948
- _namespace-tokens(
949
- (mat, switch),
950
- custom-tokens.switch($systems, $exclude-hardcoded),
951
- $token-slots
952
- ),
953
- _namespace-tokens(
954
- (mat, tab-header),
955
- custom-tokens.tab-header($systems, $exclude-hardcoded),
956
- $token-slots
957
- ),
958
- _namespace-tokens(
959
- (mat, table),
960
- custom-tokens.table($systems, $exclude-hardcoded),
961
- $token-slots
962
- ),
963
- _namespace-tokens(
964
- (mat, toolbar),
965
- custom-tokens.toolbar($systems, $exclude-hardcoded),
966
- $token-slots,
967
- ),
968
- _namespace-tokens(
969
- (mat, tree),
970
- custom-tokens.tree($systems, $exclude-hardcoded),
971
- $token-slots
972
- ),
113
+ m3.get-m3-tokens($systems, $exclude-hardcoded, $token-slots),
973
114
  );
974
115
 
975
116
  // Strip out tokens that are systemized by our made up density system.
@@ -1031,6 +172,10 @@
1031
172
  }
1032
173
 
1033
174
  @function _get-sys-color($type, $ref) {
175
+ $mdc-sys-color: if($type == dark,
176
+ mdc-tokens.md-sys-color-values-dark($ref),
177
+ mdc-tokens.md-sys-color-values-light($ref));
178
+
1034
179
  @if (sass-utils.$use-system-color-variables) {
1035
180
  @return (
1036
181
  'background': var(--sys-background),
@@ -1067,7 +212,7 @@
1067
212
  'secondary-container': var(--sys-secondary-container),
1068
213
  'secondary-fixed': var(--sys-secondary-fixed),
1069
214
  'secondary-fixed-dim': var(--sys-secondary-fixed-dim),
1070
- 'shadow': var(--sys-shadow),
215
+ 'shadow': map.get($mdc-sys-color, shadow),
1071
216
  'surface': var(--sys-surface),
1072
217
  'surface-bright': var(--sys-surface-bright),
1073
218
  'surface-container': var(--sys-surface-container),
@@ -1085,9 +230,7 @@
1085
230
  );
1086
231
  }
1087
232
 
1088
- @return if($type == dark,
1089
- mdc-tokens.md-sys-color-values-dark($ref),
1090
- mdc-tokens.md-sys-color-values-light($ref));
233
+ @return $mdc-sys-color;
1091
234
  }
1092
235
 
1093
236
  @function _get-sys-typeface($ref) {