@angular/material 20.0.0-rc.1 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/autocomplete/_autocomplete-theme.scss +17 -37
  2. package/autocomplete/_m2-autocomplete.scss +3 -6
  3. package/autocomplete/_m3-autocomplete.scss +14 -9
  4. package/autocomplete/index.d.ts +2 -2
  5. package/badge/_badge-theme.scss +9 -35
  6. package/badge/_m2-badge.scss +32 -35
  7. package/badge/_m3-badge.scss +31 -32
  8. package/bottom-sheet/_bottom-sheet-theme.scss +16 -27
  9. package/bottom-sheet/_m2-bottom-sheet.scss +11 -11
  10. package/bottom-sheet/_m3-bottom-sheet.scss +18 -17
  11. package/button/_button-theme.scss +29 -46
  12. package/button/_fab-theme.scss +22 -41
  13. package/button/_icon-button-theme.scss +29 -46
  14. package/button/_m2-button.scss +135 -133
  15. package/button/_m2-fab.scss +51 -53
  16. package/button/_m2-icon-button.scss +14 -17
  17. package/button/_m3-button.scss +145 -240
  18. package/button/_m3-fab.scss +69 -166
  19. package/button/_m3-icon-button.scss +28 -56
  20. package/button-toggle/_button-toggle-theme.scss +23 -49
  21. package/button-toggle/_m2-button-toggle.scss +45 -37
  22. package/button-toggle/_m3-button-toggle.scss +53 -53
  23. package/card/_card-theme.scss +16 -37
  24. package/card/_m2-card.scss +24 -25
  25. package/card/_m3-card.scss +32 -36
  26. package/checkbox/_checkbox-theme.scss +25 -52
  27. package/checkbox/_m2-checkbox.scss +32 -35
  28. package/checkbox/_m3-checkbox.scss +49 -84
  29. package/chips/_chips-theme.scss +24 -44
  30. package/chips/_m2-chip.scss +47 -51
  31. package/chips/_m3-chip.scss +63 -110
  32. package/core/_core-theme.scss +58 -56
  33. package/core/_core.scss +15 -18
  34. package/core/_m2-app.scss +3 -7
  35. package/core/_m3-app.scss +37 -24
  36. package/core/index.d.ts +2 -2
  37. package/core/option/_m2-optgroup.scss +6 -9
  38. package/core/option/_m2-option.scss +10 -13
  39. package/core/option/_m3-optgroup.scss +16 -13
  40. package/core/option/_m3-option.scss +28 -48
  41. package/core/option/_optgroup-theme.scss +14 -25
  42. package/core/option/_option-theme.scss +22 -33
  43. package/core/ripple/_m2-ripple.scss +1 -4
  44. package/core/ripple/_m3-ripple.scss +11 -13
  45. package/core/ripple/_ripple-theme.scss +15 -33
  46. package/core/ripple/_ripple.scss +5 -5
  47. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +10 -11
  48. package/core/selection/pseudo-checkbox/_m3-pseudo-checkbox.scss +25 -40
  49. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +16 -27
  50. package/core/style/_sass-utils.scss +0 -29
  51. package/core/theming/_color-api-backwards-compatibility.scss +46 -29
  52. package/core/theming/_definition.scss +6 -0
  53. package/core/theming/_inspection.scss +0 -25
  54. package/core/tokens/_m3-system.scss +19 -68
  55. package/core/tokens/_m3-tokens.scss +0 -128
  56. package/core/tokens/_m3-utils.scss +11 -83
  57. package/core/tokens/_token-utils.scss +52 -246
  58. package/core/tokens/m3/_index.scss +1 -0
  59. package/core/tokens/m3/_theme.scss +47 -0
  60. package/datepicker/_datepicker-theme.scss +24 -39
  61. package/datepicker/_m2-datepicker.scss +55 -50
  62. package/datepicker/_m3-datepicker.scss +65 -113
  63. package/datepicker/index.d.ts +9 -0
  64. package/dialog/_dialog-theme.scss +15 -27
  65. package/dialog/_m2-dialog.scss +25 -26
  66. package/dialog/_m3-dialog.scss +35 -35
  67. package/divider/_divider-theme.scss +14 -25
  68. package/divider/_m2-divider.scss +2 -5
  69. package/divider/_m3-divider.scss +13 -13
  70. package/expansion/_expansion-theme.scss +15 -33
  71. package/expansion/_m2-expansion.scss +28 -27
  72. package/expansion/_m3-expansion.scss +41 -36
  73. package/fesm2022/animation-DfMFjxHu.mjs.map +1 -1
  74. package/fesm2022/autocomplete/testing.mjs.map +1 -1
  75. package/fesm2022/autocomplete.mjs +23 -23
  76. package/fesm2022/autocomplete.mjs.map +1 -1
  77. package/fesm2022/badge/testing.mjs.map +1 -1
  78. package/fesm2022/badge.mjs +11 -11
  79. package/fesm2022/badge.mjs.map +1 -1
  80. package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
  81. package/fesm2022/bottom-sheet.mjs +11 -11
  82. package/fesm2022/bottom-sheet.mjs.map +1 -1
  83. package/fesm2022/button/testing.mjs.map +1 -1
  84. package/fesm2022/button-toggle/testing.mjs.map +1 -1
  85. package/fesm2022/button-toggle.mjs +19 -23
  86. package/fesm2022/button-toggle.mjs.map +1 -1
  87. package/fesm2022/button.mjs +20 -20
  88. package/fesm2022/button.mjs.map +1 -1
  89. package/fesm2022/card/testing.mjs.map +1 -1
  90. package/fesm2022/card.mjs +47 -47
  91. package/fesm2022/card.mjs.map +1 -1
  92. package/fesm2022/checkbox/testing.mjs.map +1 -1
  93. package/fesm2022/checkbox.mjs +22 -22
  94. package/fesm2022/checkbox.mjs.map +1 -1
  95. package/fesm2022/chips/testing.mjs.map +1 -1
  96. package/fesm2022/chips.mjs +52 -52
  97. package/fesm2022/chips.mjs.map +1 -1
  98. package/fesm2022/{common-module-CF0eSYO4.mjs → common-module-cKSwHniA.mjs} +5 -5
  99. package/fesm2022/common-module-cKSwHniA.mjs.map +1 -0
  100. package/fesm2022/core/testing.mjs.map +1 -1
  101. package/fesm2022/core.mjs +24 -24
  102. package/fesm2022/core.mjs.map +1 -1
  103. package/fesm2022/date-formats-K6TQue-Y.mjs.map +1 -1
  104. package/fesm2022/date-range-input-harness-Bp1T4oUe.mjs.map +1 -1
  105. package/fesm2022/datepicker/testing.mjs.map +1 -1
  106. package/fesm2022/datepicker.mjs +154 -133
  107. package/fesm2022/datepicker.mjs.map +1 -1
  108. package/fesm2022/dialog/testing.mjs +18 -5
  109. package/fesm2022/dialog/testing.mjs.map +1 -1
  110. package/fesm2022/dialog.mjs +2 -2
  111. package/fesm2022/dialog.mjs.map +1 -1
  112. package/fesm2022/divider/testing.mjs.map +1 -1
  113. package/fesm2022/divider.mjs +8 -8
  114. package/fesm2022/divider.mjs.map +1 -1
  115. package/fesm2022/{error-options-CbAHLQL5.mjs → error-options-DCNQlTOA.mjs} +7 -7
  116. package/fesm2022/error-options-DCNQlTOA.mjs.map +1 -0
  117. package/fesm2022/error-state-Dtb1IHM-.mjs.map +1 -1
  118. package/fesm2022/expansion/testing.mjs.map +1 -1
  119. package/fesm2022/expansion.mjs +28 -28
  120. package/fesm2022/expansion.mjs.map +1 -1
  121. package/fesm2022/form-field/testing/control.mjs.map +1 -1
  122. package/fesm2022/form-field/testing.mjs.map +1 -1
  123. package/fesm2022/{form-field-sL9_TuE-.mjs → form-field-C9DZXojn.mjs} +33 -33
  124. package/fesm2022/form-field-C9DZXojn.mjs.map +1 -0
  125. package/fesm2022/form-field.mjs +3 -3
  126. package/fesm2022/form-field.mjs.map +1 -1
  127. package/fesm2022/grid-list/testing.mjs.map +1 -1
  128. package/fesm2022/grid-list.mjs +24 -24
  129. package/fesm2022/grid-list.mjs.map +1 -1
  130. package/fesm2022/icon/testing.mjs +8 -8
  131. package/fesm2022/icon/testing.mjs.map +1 -1
  132. package/fesm2022/{icon-button-BASP1JI8.mjs → icon-button-B2tPB5AH.mjs} +9 -9
  133. package/fesm2022/icon-button-B2tPB5AH.mjs.map +1 -0
  134. package/fesm2022/{icon-registry-DVLYRZv3.mjs → icon-registry-CwOTJ7YM.mjs} +4 -4
  135. package/fesm2022/icon-registry-CwOTJ7YM.mjs.map +1 -0
  136. package/fesm2022/icon.mjs +10 -10
  137. package/fesm2022/icon.mjs.map +1 -1
  138. package/fesm2022/index-BFRo2fUq.mjs +20 -0
  139. package/fesm2022/index-BFRo2fUq.mjs.map +1 -0
  140. package/fesm2022/index-DwiL-HGk.mjs +22 -0
  141. package/fesm2022/index-DwiL-HGk.mjs.map +1 -0
  142. package/fesm2022/input/testing.mjs.map +1 -1
  143. package/fesm2022/input-harness-oQzj5EsQ.mjs.map +1 -1
  144. package/fesm2022/input-value-accessor-D1GvPuqO.mjs.map +1 -1
  145. package/fesm2022/input.mjs +12 -12
  146. package/fesm2022/input.mjs.map +1 -1
  147. package/fesm2022/{internal-form-field-_OHaksOO.mjs → internal-form-field-D5iFxU6d.mjs} +4 -4
  148. package/fesm2022/internal-form-field-D5iFxU6d.mjs.map +1 -0
  149. package/fesm2022/{line-CtAKiRo6.mjs → line-Bz5f9Cyx.mjs} +9 -9
  150. package/fesm2022/line-Bz5f9Cyx.mjs.map +1 -0
  151. package/fesm2022/list/testing.mjs.map +1 -1
  152. package/fesm2022/list.mjs +66 -66
  153. package/fesm2022/list.mjs.map +1 -1
  154. package/fesm2022/material.mjs.map +1 -1
  155. package/fesm2022/menu/testing.mjs.map +1 -1
  156. package/fesm2022/menu.mjs +20 -20
  157. package/fesm2022/menu.mjs.map +1 -1
  158. package/fesm2022/{module-DqTK2swA.mjs → module-BDiw_nWS.mjs} +25 -19
  159. package/fesm2022/module-BDiw_nWS.mjs.map +1 -0
  160. package/fesm2022/{module-m5vWw9-5.mjs → module-CWxMD37a.mjs} +12 -12
  161. package/fesm2022/module-CWxMD37a.mjs.map +1 -0
  162. package/fesm2022/{module-ChwDH6BC.mjs → module-Ce6F7TNm.mjs} +28 -28
  163. package/fesm2022/module-Ce6F7TNm.mjs.map +1 -0
  164. package/fesm2022/{module-DToxyW7l.mjs → module-DzZHEh7B.mjs} +7 -7
  165. package/fesm2022/module-DzZHEh7B.mjs.map +1 -0
  166. package/fesm2022/{option-hkPAbXDN.mjs → option-BzhYL_xC.mjs} +15 -15
  167. package/fesm2022/option-BzhYL_xC.mjs.map +1 -0
  168. package/fesm2022/option-harness-BFcc-M_4.mjs.map +1 -1
  169. package/fesm2022/paginator/testing.mjs.map +1 -1
  170. package/fesm2022/paginator.mjs +25 -25
  171. package/fesm2022/paginator.mjs.map +1 -1
  172. package/fesm2022/progress-bar/testing.mjs.map +1 -1
  173. package/fesm2022/progress-bar.mjs +8 -8
  174. package/fesm2022/progress-bar.mjs.map +1 -1
  175. package/fesm2022/progress-spinner/testing.mjs.map +1 -1
  176. package/fesm2022/progress-spinner.mjs +8 -8
  177. package/fesm2022/progress-spinner.mjs.map +1 -1
  178. package/fesm2022/{pseudo-checkbox-Ddidc23S.mjs → pseudo-checkbox-DDmgx3P4.mjs} +4 -4
  179. package/fesm2022/pseudo-checkbox-DDmgx3P4.mjs.map +1 -0
  180. package/fesm2022/pseudo-checkbox-module-4F8Up4PL.mjs +20 -0
  181. package/fesm2022/pseudo-checkbox-module-4F8Up4PL.mjs.map +1 -0
  182. package/fesm2022/public-api-BoO5eSq-.mjs.map +1 -1
  183. package/fesm2022/radio/testing.mjs.map +1 -1
  184. package/fesm2022/radio.mjs +19 -16
  185. package/fesm2022/radio.mjs.map +1 -1
  186. package/fesm2022/{ripple-DUGA2BAa.mjs → ripple-BYgV4oZC.mjs} +7 -7
  187. package/fesm2022/ripple-BYgV4oZC.mjs.map +1 -0
  188. package/fesm2022/{ripple-loader-Xy4bv6Xh.mjs → ripple-loader-BnMiRtmT.mjs} +5 -5
  189. package/fesm2022/ripple-loader-BnMiRtmT.mjs.map +1 -0
  190. package/fesm2022/select/testing.mjs.map +1 -1
  191. package/fesm2022/select.mjs +12 -12
  192. package/fesm2022/select.mjs.map +1 -1
  193. package/fesm2022/sidenav/testing.mjs.map +1 -1
  194. package/fesm2022/sidenav.mjs +35 -31
  195. package/fesm2022/sidenav.mjs.map +1 -1
  196. package/fesm2022/slide-toggle/testing.mjs.map +1 -1
  197. package/fesm2022/slide-toggle.mjs +11 -11
  198. package/fesm2022/slide-toggle.mjs.map +1 -1
  199. package/fesm2022/slider/testing.mjs.map +1 -1
  200. package/fesm2022/slider.mjs +21 -21
  201. package/fesm2022/slider.mjs.map +1 -1
  202. package/fesm2022/snack-bar/testing.mjs.map +1 -1
  203. package/fesm2022/snack-bar.mjs +29 -29
  204. package/fesm2022/snack-bar.mjs.map +1 -1
  205. package/fesm2022/sort/testing.mjs.map +1 -1
  206. package/fesm2022/sort.mjs +15 -15
  207. package/fesm2022/sort.mjs.map +1 -1
  208. package/fesm2022/stepper/testing.mjs.map +1 -1
  209. package/fesm2022/stepper.mjs +39 -50
  210. package/fesm2022/stepper.mjs.map +1 -1
  211. package/fesm2022/{structural-styles-DA18Hchc.mjs → structural-styles-CObeNzjn.mjs} +4 -4
  212. package/fesm2022/structural-styles-CObeNzjn.mjs.map +1 -0
  213. package/fesm2022/table/testing.mjs.map +1 -1
  214. package/fesm2022/table.mjs +56 -56
  215. package/fesm2022/table.mjs.map +1 -1
  216. package/fesm2022/tabs/testing.mjs.map +1 -1
  217. package/fesm2022/tabs.mjs +81 -65
  218. package/fesm2022/tabs.mjs.map +1 -1
  219. package/fesm2022/timepicker/testing.mjs.map +1 -1
  220. package/fesm2022/timepicker.mjs +20 -20
  221. package/fesm2022/timepicker.mjs.map +1 -1
  222. package/fesm2022/toolbar/testing.mjs.map +1 -1
  223. package/fesm2022/toolbar.mjs +12 -12
  224. package/fesm2022/toolbar.mjs.map +1 -1
  225. package/fesm2022/tooltip/testing.mjs.map +1 -1
  226. package/fesm2022/tooltip.mjs +2 -2
  227. package/fesm2022/tooltip.mjs.map +1 -1
  228. package/fesm2022/tree/testing.mjs.map +1 -1
  229. package/fesm2022/tree.mjs +26 -26
  230. package/fesm2022/tree.mjs.map +1 -1
  231. package/form-field/_form-field-theme.scss +23 -55
  232. package/form-field/_m2-form-field.scss +112 -91
  233. package/form-field/_m3-form-field.scss +116 -131
  234. package/grid-list/_grid-list-theme.scss +13 -23
  235. package/grid-list/_m2-grid-list.scss +8 -7
  236. package/grid-list/_m3-grid-list.scss +14 -15
  237. package/icon/_icon-theme.scss +20 -30
  238. package/icon/_m2-icon.scss +1 -4
  239. package/icon/_m3-icon.scss +13 -27
  240. package/{index.d-CikM2bbf.d.ts → index.d-DAhBYbjm.d.ts} +1 -1
  241. package/input/_input-theme.scss +7 -40
  242. package/list/_list-theme.scss +22 -52
  243. package/list/_m2-list.scss +56 -55
  244. package/list/_m3-list.scss +69 -67
  245. package/menu/_m2-menu.scss +22 -25
  246. package/menu/_m3-menu.scss +35 -38
  247. package/menu/_menu-theme.scss +15 -27
  248. package/{module.d-DMabQ4_c.d.ts → module.d-bebo7gS5.d.ts} +5 -3
  249. package/package.json +6 -6
  250. package/paginator/_m2-paginator.scss +16 -17
  251. package/paginator/_m3-paginator.scss +28 -27
  252. package/paginator/_paginator-theme.scss +14 -40
  253. package/paginator/index.d.ts +3 -3
  254. package/prebuilt-themes/deeppurple-amber.css +1 -1
  255. package/prebuilt-themes/indigo-pink.css +1 -1
  256. package/prebuilt-themes/pink-bluegrey.css +1 -1
  257. package/prebuilt-themes/purple-green.css +1 -1
  258. package/progress-bar/_m2-progress-bar.scss +5 -8
  259. package/progress-bar/_m3-progress-bar.scss +17 -26
  260. package/progress-bar/_progress-bar-theme.scss +17 -27
  261. package/progress-spinner/_m2-progress-spinner.scss +3 -6
  262. package/progress-spinner/_m3-progress-spinner.scss +15 -22
  263. package/progress-spinner/_progress-spinner-theme.scss +20 -43
  264. package/radio/_m2-radio.scss +24 -27
  265. package/radio/_m3-radio.scss +44 -58
  266. package/radio/_radio-theme.scss +23 -50
  267. package/schematics/ng-add/index.js +2 -2
  268. package/schematics/ng-update/index_bundled.js +2 -0
  269. package/schematics/ng-update/index_bundled.js.map +1 -1
  270. package/select/_m2-select.scss +15 -18
  271. package/select/_m3-select.scss +32 -38
  272. package/select/_select-theme.scss +23 -50
  273. package/select/index.d.ts +3 -3
  274. package/sidenav/_m2-sidenav.scss +9 -12
  275. package/sidenav/_m3-sidenav.scss +20 -22
  276. package/sidenav/_sidenav-theme.scss +14 -25
  277. package/slide-toggle/_m2-slide-toggle.scss +82 -83
  278. package/slide-toggle/_m3-slide-toggle.scss +102 -143
  279. package/slide-toggle/_slide-toggle-theme.scss +26 -61
  280. package/slider/_m2-slider.scss +46 -46
  281. package/slider/_m3-slider.scss +54 -109
  282. package/slider/_slider-theme.scss +23 -34
  283. package/snack-bar/_m2-snack-bar.scss +10 -11
  284. package/snack-bar/_m3-snack-bar.scss +20 -19
  285. package/snack-bar/_snack-bar-theme.scss +14 -26
  286. package/sort/_m2-sort.scss +1 -4
  287. package/sort/_m3-sort.scss +11 -9
  288. package/sort/_sort-theme.scss +15 -27
  289. package/stepper/_m2-stepper.scss +32 -31
  290. package/stepper/_m3-stepper.scss +44 -79
  291. package/stepper/_stepper-theme.scss +22 -50
  292. package/stepper/index.d.ts +0 -3
  293. package/table/_m2-table.scss +25 -26
  294. package/table/_m3-table.scss +36 -27
  295. package/table/_table-theme.scss +15 -32
  296. package/tabs/_m2-tabs.scss +26 -29
  297. package/tabs/_m3-tabs.scss +40 -51
  298. package/tabs/_tabs-theme.scss +37 -58
  299. package/tabs/index.d.ts +11 -5
  300. package/timepicker/_m2-timepicker.scss +3 -6
  301. package/timepicker/_m3-timepicker.scss +14 -15
  302. package/timepicker/_timepicker-theme.scss +20 -45
  303. package/timepicker/index.d.ts +1 -1
  304. package/toolbar/_m2-toolbar.scss +11 -12
  305. package/toolbar/_m3-toolbar.scss +22 -17
  306. package/toolbar/_toolbar-theme.scss +13 -37
  307. package/tooltip/_m2-tooltip.scss +9 -11
  308. package/tooltip/_m3-tooltip.scss +19 -19
  309. package/tooltip/_tooltip-theme.scss +17 -35
  310. package/tree/_m2-tree.scss +6 -9
  311. package/tree/_m3-tree.scss +19 -16
  312. package/tree/_tree-theme.scss +14 -36
  313. package/fesm2022/common-module-CF0eSYO4.mjs.map +0 -1
  314. package/fesm2022/error-options-CbAHLQL5.mjs.map +0 -1
  315. package/fesm2022/form-field-sL9_TuE-.mjs.map +0 -1
  316. package/fesm2022/icon-button-BASP1JI8.mjs.map +0 -1
  317. package/fesm2022/icon-registry-DVLYRZv3.mjs.map +0 -1
  318. package/fesm2022/index-BNtCg9r0.mjs +0 -22
  319. package/fesm2022/index-BNtCg9r0.mjs.map +0 -1
  320. package/fesm2022/index-DxCSjCL3.mjs +0 -20
  321. package/fesm2022/index-DxCSjCL3.mjs.map +0 -1
  322. package/fesm2022/internal-form-field-_OHaksOO.mjs.map +0 -1
  323. package/fesm2022/line-CtAKiRo6.mjs.map +0 -1
  324. package/fesm2022/module-ChwDH6BC.mjs.map +0 -1
  325. package/fesm2022/module-DToxyW7l.mjs.map +0 -1
  326. package/fesm2022/module-DqTK2swA.mjs.map +0 -1
  327. package/fesm2022/module-m5vWw9-5.mjs.map +0 -1
  328. package/fesm2022/option-hkPAbXDN.mjs.map +0 -1
  329. package/fesm2022/pseudo-checkbox-Ddidc23S.mjs.map +0 -1
  330. package/fesm2022/pseudo-checkbox-module--am9-RIA.mjs +0 -20
  331. package/fesm2022/pseudo-checkbox-module--am9-RIA.mjs.map +0 -1
  332. package/fesm2022/ripple-DUGA2BAa.mjs.map +0 -1
  333. package/fesm2022/ripple-loader-Xy4bv6Xh.mjs.map +0 -1
  334. package/fesm2022/structural-styles-DA18Hchc.mjs.map +0 -1
  335. package/schematics/tsconfig.json +0 -26
  336. package/{option.d-BVGX3edu.d.ts → option.d-BcvS44bt.d.ts} +1 -1
@@ -1,6 +1,5 @@
1
1
  @use './theming/theming';
2
2
  @use './theming/inspection';
3
- @use './theming/validation';
4
3
  @use './ripple/ripple-theme';
5
4
  @use './option/option-theme';
6
5
  @use './option/optgroup-theme';
@@ -9,44 +8,57 @@
9
8
  @use './typography/typography';
10
9
  @use './tokens/token-utils';
11
10
  @use './m2-app';
12
- @use 'ripple/m2-ripple';
13
- @use 'option/m2-option';
14
- @use 'option/m2-optgroup';
15
- @use 'selection/pseudo-checkbox/m2-pseudo-checkbox';
11
+ @use './m3-app';
12
+ @use 'ripple/m3-ripple';
13
+ @use 'option/m3-option';
14
+ @use 'option/m3-optgroup';
15
+ @use 'selection/pseudo-checkbox/m3-pseudo-checkbox';
16
+ @use 'sass:map';
16
17
 
17
18
  @mixin base($theme) {
18
19
  @if inspection.get-theme-version($theme) == 1 {
19
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
20
+ @include token-utils.create-token-values(map.get(m3-app.get-tokens($theme), base));
21
+ @include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), base));
22
+ @include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), base));
23
+ @include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), base));
24
+ @include token-utils.create-token-values(map.get(m3-pseudo-checkbox.get-tokens($theme), base));
20
25
  } @else {
21
26
  @include ripple-theme.base($theme);
22
27
  @include option-theme.base($theme);
23
28
  @include optgroup-theme.base($theme);
24
29
  @include pseudo-checkbox-theme.base($theme);
25
30
  @include sass-utils.current-selector-or-root() {
26
- @include token-utils.create-token-values-mixed(
27
- m2-app.$prefix, m2-app.get-unthemable-tokens());
31
+ @include token-utils.create-token-values-mixed(m2-app.get-unthemable-tokens());
28
32
  }
29
33
  }
30
34
  }
31
35
 
32
36
  @mixin color($theme) {
33
37
  @if inspection.get-theme-version($theme) == 1 {
34
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
38
+ @include token-utils.create-token-values(map.get(m3-app.get-tokens($theme), color));
39
+ @include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), color));
40
+ @include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), color));
41
+ @include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), color));
42
+ @include token-utils.create-token-values(map.get(m3-pseudo-checkbox.get-tokens($theme), color));
35
43
  } @else {
36
44
  @include ripple-theme.color($theme);
37
45
  @include option-theme.color($theme);
38
46
  @include optgroup-theme.color($theme);
39
47
  @include pseudo-checkbox-theme.color($theme);
40
48
  @include sass-utils.current-selector-or-root() {
41
- @include token-utils.create-token-values-mixed(
42
- m2-app.$prefix, m2-app.get-color-tokens($theme));
49
+ @include token-utils.create-token-values-mixed(m2-app.get-color-tokens($theme));
43
50
  }
44
51
  }
45
52
  }
46
53
 
47
54
  @mixin typography($theme) {
48
55
  @if inspection.get-theme-version($theme) == 1 {
49
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
56
+ @include token-utils.create-token-values(map.get(m3-app.get-tokens($theme), typography));
57
+ @include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), typography));
58
+ @include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), typography));
59
+ @include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), typography));
60
+ @include token-utils.create-token-values(
61
+ map.get(m3-pseudo-checkbox.get-tokens($theme), typography));
50
62
  } @else {
51
63
  @include option-theme.typography($theme);
52
64
  @include optgroup-theme.typography($theme);
@@ -57,7 +69,12 @@
57
69
 
58
70
  @mixin density($theme) {
59
71
  @if inspection.get-theme-version($theme) == 1 {
60
- // There are no M3 density tokens for this component
72
+ @include token-utils.create-token-values(map.get(m3-app.get-tokens($theme), density));
73
+ @include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), density));
74
+ @include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), density));
75
+ @include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), density));
76
+ @include token-utils.create-token-values(
77
+ map.get(m3-pseudo-checkbox.get-tokens($theme), density));
61
78
  } @else {
62
79
  @include option-theme.density($theme);
63
80
  @include optgroup-theme.density($theme);
@@ -67,37 +84,50 @@
67
84
  }
68
85
 
69
86
  @function _define-overrides() {
70
- $app-tokens: m2-app.get-token-slots();
71
- $ripple-tokens: m2-ripple.get-token-slots();
72
- $option-tokens: m2-option.get-token-slots();
73
- $optgroup-tokens: m2-optgroup.get-token-slots();
74
- $pseudo-checkbox-tokens: m2-pseudo-checkbox.get-token-slots();
75
-
76
87
  @return (
77
- (namespace: m2-app.$prefix, tokens: $app-tokens, prefix: 'app-'),
78
- (namespace: m2-ripple.$prefix, tokens: $ripple-tokens, prefix: 'ripple-'),
79
- (namespace: m2-option.$prefix, tokens: $option-tokens, prefix: 'option-'),
80
- (namespace: m2-optgroup.$prefix, tokens: $optgroup-tokens, prefix: 'optgroup-'),
81
88
  (
82
- namespace: m2-pseudo-checkbox.$prefix,
83
- tokens: m2-pseudo-checkbox.get-token-slots(),
89
+ namespace: app,
90
+ tokens: token-utils.get-overrides(m3-app.get-tokens(), app),
91
+ prefix: 'app-'
92
+ ),
93
+ (
94
+ namespace: ripple,
95
+ tokens: token-utils.get-overrides(m3-ripple.get-tokens(), ripple),
96
+ prefix: 'ripple-'
97
+ ),
98
+ (
99
+ namespace: option,
100
+ tokens: token-utils.get-overrides(m3-option.get-tokens(), option),
101
+ prefix: 'option-'
102
+ ),
103
+ (
104
+ namespace: optgroup,
105
+ tokens: token-utils.get-overrides(m3-optgroup.get-tokens(), optgroup),
106
+ prefix: 'optgroup-'
107
+ ),
108
+ (
109
+ namespace: pseudo-checkbox,
110
+ tokens: token-utils.get-overrides(m3-pseudo-checkbox.get-tokens(), pseudo-checkbox),
84
111
  prefix: 'pseudo-checkbox-'
85
112
  ),
86
113
  );
87
114
  }
88
115
 
89
116
  @mixin overrides($tokens: ()) {
90
- @include token-utils.batch-create-token-values($tokens, _define-overrides()...);
117
+ @include token-utils.batch-create-token-values($tokens, _define-overrides());
91
118
  }
92
119
 
93
120
  // Mixin that renders all of the core styles that depend on the theme.
94
- @mixin theme($theme, $options...) {
121
+ @mixin theme($theme) {
95
122
  // Wrap the sub-theme includes in the duplicate theme styles mixin. This ensures that
96
123
  // there won't be multiple warnings. e.g. if `mat-core-theme` reports a warning, then
97
124
  // the imported themes (such as `mat-ripple-theme`) should not report again.
98
125
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-core') {
99
126
  @if inspection.get-theme-version($theme) == 1 {
100
- @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
127
+ @include base($theme);
128
+ @include color($theme);
129
+ @include density($theme);
130
+ @include typography($theme);
101
131
  } @else {
102
132
  @include base($theme);
103
133
  @if inspection.theme-has($theme, color) {
@@ -112,31 +142,3 @@
112
142
  }
113
143
  }
114
144
  }
115
-
116
- @mixin _theme-from-tokens($tokens, $options...) {
117
- @include validation.selector-defined(
118
- 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector'
119
- );
120
- $mat-app-tokens: token-utils.get-tokens-for($tokens, m2-app.$prefix, $options...);
121
- $mat-ripple-tokens: token-utils.get-tokens-for($tokens, m2-ripple.$prefix, $options...);
122
- $mat-option-tokens: token-utils.get-tokens-for($tokens, m2-option.$prefix, $options...);
123
- $mat-optgroup-tokens: token-utils.get-tokens-for(
124
- $tokens,
125
- m2-optgroup.$prefix,
126
- $options...
127
- );
128
- $mat-pseudo-checkbox-tokens: token-utils.get-tokens-for(
129
- $tokens,
130
- m2-pseudo-checkbox.$prefix,
131
- $options...
132
- );
133
-
134
- @include token-utils.create-token-values(m2-app.$prefix, $mat-app-tokens);
135
- @include token-utils.create-token-values(m2-ripple.$prefix, $mat-ripple-tokens);
136
- @include token-utils.create-token-values(m2-option.$prefix, $mat-option-tokens);
137
- @include token-utils.create-token-values(m2-optgroup.$prefix, $mat-optgroup-tokens);
138
- @include token-utils.create-token-values(
139
- m2-pseudo-checkbox.$prefix,
140
- $mat-pseudo-checkbox-tokens
141
- );
142
- }
package/core/_core.scss CHANGED
@@ -1,7 +1,9 @@
1
- @use './m2-app';
1
+ @use './m3-app';
2
2
  @use './tokens/token-utils';
3
3
  @use './style/elevation';
4
4
 
5
+ $fallbacks: m3-app.get-tokens();
6
+
5
7
  /// @deprecated This mixin is a no-op and is going to be removed in v21.
6
8
  @mixin core() {}
7
9
 
@@ -20,11 +22,9 @@
20
22
  // user's content isn't inside of a `mat-sidenav-container`.
21
23
  @at-root {
22
24
  // Note: we need to emit fallback values here to avoid errors in internal builds.
23
- @include token-utils.use-tokens(m2-app.$prefix, m2-app.get-token-slots()) {
24
- .mat-app-background {
25
- background-color: token-utils.slot(background-color, transparent);
26
- color: token-utils.slot(text-color, inherit);
27
- }
25
+ .mat-app-background {
26
+ background-color: token-utils.slot(app-background-color, $fallbacks, transparent);
27
+ color: token-utils.slot(app-text-color, $fallbacks, inherit);
28
28
  }
29
29
  }
30
30
  }
@@ -35,18 +35,15 @@
35
35
  // Material Design specification.
36
36
  @mixin elevation-classes() {
37
37
  @at-root {
38
- @include token-utils.use-tokens(m2-app.$prefix, m2-app.get-token-slots()) {
39
- // Provides external CSS classes for each elevation value. Each CSS class is formatted as
40
- // `mat-elevation-z$z-value` where `$z-value` corresponds to the z-space to which the element
41
- // is elevated.
42
- @for $z-value from 0 through 24 {
43
- $selector: elevation.$prefix + $z-value;
44
- // We need the `mat-mdc-elevation-specific`, because some MDC mixins
45
- // come with elevation baked in and we don't have a way of removing it.
46
- .#{$selector}, .mat-mdc-elevation-specific.#{$selector} {
47
- box-shadow: token-utils.slot('elevation-shadow-level-#{$z-value}',
48
- none);
49
- }
38
+ // Provides external CSS classes for each elevation value. Each CSS class is formatted as
39
+ // `mat-elevation-z$z-value` where `$z-value` corresponds to the z-space to which the element
40
+ // is elevated.
41
+ @for $z-value from 0 through 24 {
42
+ $selector: elevation.$prefix + $z-value;
43
+ // We need the `mat-mdc-elevation-specific`, because some MDC mixins
44
+ // come with elevation baked in and we don't have a way of removing it.
45
+ .#{$selector}, .mat-mdc-elevation-specific.#{$selector} {
46
+ box-shadow: token-utils.slot('app-elevation-shadow-level-#{$z-value}', $fallbacks, none);
50
47
  }
51
48
  }
52
49
  }
package/core/_m2-app.scss CHANGED
@@ -4,10 +4,6 @@
4
4
  @use './style/sass-utils';
5
5
  @use './style/elevation';
6
6
 
7
-
8
- // The prefix used to generate the fully qualified name for tokens in this file.
9
- $prefix: (mat, app);
10
-
11
7
  // Tokens that can't be configured through Angular Material's current theming API,
12
8
  // but may be in a future version of the theming API.
13
9
  @function get-unthemable-tokens() {
@@ -17,15 +13,15 @@ $prefix: (mat, app);
17
13
  // Tokens that can be configured through Angular Material's color theming API.
18
14
  @function get-color-tokens($theme) {
19
15
  $tokens: (
20
- background-color: inspection.get-theme-color($theme, background, background),
21
- text-color: inspection.get-theme-color($theme, foreground, text),
16
+ app-background-color: inspection.get-theme-color($theme, background, background),
17
+ app-text-color: inspection.get-theme-color($theme, foreground, text),
22
18
  );
23
19
 
24
20
  @for $zValue from 0 through 24 {
25
21
  $elevation-color: inspection.get-theme-color($theme, foreground, elevation);
26
22
  $shadow: elevation.get-box-shadow($zValue,
27
23
  if($elevation-color == null, elevation.$color, $elevation-color));
28
- $tokens: map.set($tokens, 'elevation-shadow-level-#{$zValue}', $shadow);
24
+ $tokens: map.set($tokens, 'app-elevation-shadow-level-#{$zValue}', $shadow);
29
25
  }
30
26
 
31
27
  @return $tokens;
package/core/_m3-app.scss CHANGED
@@ -1,31 +1,44 @@
1
1
  @use 'sass:map';
2
- @use 'sass:meta';
3
2
  @use './style/elevation';
4
3
  @use './tokens/m3-utils';
5
-
6
- // The prefix used to generate the fully qualified name for tokens in this file.
7
- $prefix: (mat, app);
4
+ @use '../core/tokens/m3';
8
5
 
9
6
  /// Generates custom tokens for the app.
10
- /// @param {Map} $systems The MDC system tokens
11
- /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
12
- /// @param {Map} $token-slots Possible token slots
13
- /// @return {Map} A set of custom tokens for the app
14
- @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
15
- $tokens: (
16
- background-color: map.get($systems, md-sys-color, background),
17
- text-color: map.get($systems, md-sys-color, on-background),
18
- );
7
+ @function get-tokens($theme: m3.$sys-theme) {
8
+ $system: m3-utils.get-system($theme);
19
9
 
20
- // If the shadow-color is an actual color, convert it to a box-shadow value. Otherwise
21
- // use the token value as itself (e,g. as a CSS var name).
22
- $shadow-color: map.get($systems, md-sys-color, shadow);
23
- @if (meta.type-of($shadow-color) == color) {
24
- @for $zValue from 0 through 24 {
25
- $shadow: elevation.get-box-shadow($zValue, $shadow-color);
26
- $tokens: map.set($tokens, 'elevation-shadow-level-#{$zValue}', $shadow);
27
- }
28
- }
29
-
30
- @return m3-utils.namespace($prefix, $tokens, $token-slots);
10
+ @return (
11
+ base: (),
12
+ color: (
13
+ app-background-color: map.get($system, background),
14
+ app-text-color: map.get($system, on-background),
15
+ app-elevation-shadow-level-0: elevation.get-box-shadow(0, map.get($system, shadow)),
16
+ app-elevation-shadow-level-1: elevation.get-box-shadow(1, map.get($system, shadow)),
17
+ app-elevation-shadow-level-2: elevation.get-box-shadow(2, map.get($system, shadow)),
18
+ app-elevation-shadow-level-3: elevation.get-box-shadow(3, map.get($system, shadow)),
19
+ app-elevation-shadow-level-4: elevation.get-box-shadow(4, map.get($system, shadow)),
20
+ app-elevation-shadow-level-5: elevation.get-box-shadow(5, map.get($system, shadow)),
21
+ app-elevation-shadow-level-6: elevation.get-box-shadow(6, map.get($system, shadow)),
22
+ app-elevation-shadow-level-7: elevation.get-box-shadow(7, map.get($system, shadow)),
23
+ app-elevation-shadow-level-8: elevation.get-box-shadow(8, map.get($system, shadow)),
24
+ app-elevation-shadow-level-9: elevation.get-box-shadow(9, map.get($system, shadow)),
25
+ app-elevation-shadow-level-10: elevation.get-box-shadow(10, map.get($system, shadow)),
26
+ app-elevation-shadow-level-11: elevation.get-box-shadow(11, map.get($system, shadow)),
27
+ app-elevation-shadow-level-12: elevation.get-box-shadow(12, map.get($system, shadow)),
28
+ app-elevation-shadow-level-13: elevation.get-box-shadow(13, map.get($system, shadow)),
29
+ app-elevation-shadow-level-14: elevation.get-box-shadow(14, map.get($system, shadow)),
30
+ app-elevation-shadow-level-15: elevation.get-box-shadow(15, map.get($system, shadow)),
31
+ app-elevation-shadow-level-16: elevation.get-box-shadow(16, map.get($system, shadow)),
32
+ app-elevation-shadow-level-17: elevation.get-box-shadow(17, map.get($system, shadow)),
33
+ app-elevation-shadow-level-18: elevation.get-box-shadow(18, map.get($system, shadow)),
34
+ app-elevation-shadow-level-19: elevation.get-box-shadow(19, map.get($system, shadow)),
35
+ app-elevation-shadow-level-20: elevation.get-box-shadow(20, map.get($system, shadow)),
36
+ app-elevation-shadow-level-21: elevation.get-box-shadow(21, map.get($system, shadow)),
37
+ app-elevation-shadow-level-22: elevation.get-box-shadow(22, map.get($system, shadow)),
38
+ app-elevation-shadow-level-23: elevation.get-box-shadow(23, map.get($system, shadow)),
39
+ app-elevation-shadow-level-24: elevation.get-box-shadow(24, map.get($system, shadow)),
40
+ ),
41
+ typography: (),
42
+ density: (),
43
+ );
31
44
  }
package/core/index.d.ts CHANGED
@@ -7,13 +7,13 @@ import { Subject } from 'rxjs';
7
7
  import { E as ErrorStateMatcher$1 } from '../error-options.d-CGdTZUYk.js';
8
8
  export { S as ShowOnDirtyErrorStateMatcher } from '../error-options.d-CGdTZUYk.js';
9
9
  export { M as MatLine, a as MatLineModule, s as setLines } from '../line.d-C-QdueRc.js';
10
- export { M as MatOptionModule } from '../index.d-CikM2bbf.js';
10
+ export { M as MatOptionModule } from '../index.d-DAhBYbjm.js';
11
11
  export { M as MatRippleLoader } from '../ripple-loader.d-9me-KFSi.js';
12
12
  export { M as MatRippleModule } from '../index.d-C5neTPvr.js';
13
13
  export { b as MatPseudoCheckbox, M as MatPseudoCheckboxModule, a as MatPseudoCheckboxState } from '../pseudo-checkbox-module.d-BHmTZ10P.js';
14
14
  import { D as DateAdapter } from '../date-adapter.d-CtKXIxk0.js';
15
15
  export { M as MAT_DATE_LOCALE, a as MAT_DATE_LOCALE_FACTORY } from '../date-adapter.d-CtKXIxk0.js';
16
- export { d as MAT_OPTGROUP, a as MatOptgroup, M as MatOption, b as MatOptionSelectionChange, _ as _countGroupLabelsBeforeOption, c as _getOptionScrollPosition } from '../option.d-BVGX3edu.js';
16
+ export { d as MAT_OPTGROUP, a as MatOptgroup, M as MatOption, b as MatOptionSelectionChange, _ as _countGroupLabelsBeforeOption, c as _getOptionScrollPosition } from '../option.d-BcvS44bt.js';
17
17
  export { a as MAT_OPTION_PARENT_COMPONENT, M as MatOptionParentComponent } from '../option-parent.d-CnYuuMkO.js';
18
18
  export { c as MAT_RIPPLE_GLOBAL_OPTIONS, M as MatRipple, g as RippleAnimationConfig, f as RippleConfig, R as RippleGlobalOptions, h as RippleRef, a as RippleRenderer, e as RippleState, b as RippleTarget, d as defaultRippleAnimationConfig } from '../ripple.d-BT30YVLB.js';
19
19
  import '@angular/cdk/bidi';
@@ -2,9 +2,6 @@
2
2
  @use '../theming/inspection';
3
3
  @use '../tokens/m2-utils';
4
4
 
5
- // The prefix used to generate the fully qualified name for tokens in this file.
6
- $prefix: (mat, optgroup);
7
-
8
5
  // Tokens that can't be configured through Angular Material's current theming API,
9
6
  // but may be in a future version of the theming API.
10
7
  @function get-unthemable-tokens() {
@@ -14,18 +11,18 @@ $prefix: (mat, optgroup);
14
11
  // Tokens that can be configured through Angular Material's color theming API.
15
12
  @function get-color-tokens($theme) {
16
13
  @return (
17
- label-text-color: inspection.get-theme-color($theme, foreground, text),
14
+ optgroup-label-text-color: inspection.get-theme-color($theme, foreground, text),
18
15
  );
19
16
  }
20
17
 
21
18
  // Tokens that can be configured through Angular Material's typography theming API.
22
19
  @function get-typography-tokens($theme) {
23
20
  @return (
24
- label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
25
- label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
26
- label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
27
- label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
28
- label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight)
21
+ optgroup-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
22
+ optgroup-label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
23
+ optgroup-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
24
+ optgroup-label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
25
+ optgroup-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight)
29
26
  );
30
27
  }
31
28
 
@@ -2,9 +2,6 @@
2
2
  @use '../theming/inspection';
3
3
  @use '../style/sass-utils';
4
4
 
5
- // The prefix used to generate the fully qualified name for tokens in this file.
6
- $prefix: (mat, option);
7
-
8
5
  // Tokens that can't be configured through Angular Material's current theming API,
9
6
  // but may be in a future version of the theming API.
10
7
  @function get-unthemable-tokens() {
@@ -18,22 +15,22 @@ $prefix: (mat, option);
18
15
  if($is-dark, 0.08, 0.04));
19
16
 
20
17
  @return (
21
- selected-state-label-text-color: inspection.get-theme-color($theme, $palette-name),
22
- label-text-color: inspection.get-theme-color($theme, foreground, text),
23
- hover-state-layer-color: $active-state-layer-color,
24
- focus-state-layer-color: $active-state-layer-color,
25
- selected-state-layer-color: $active-state-layer-color,
18
+ option-selected-state-label-text-color: inspection.get-theme-color($theme, $palette-name),
19
+ option-label-text-color: inspection.get-theme-color($theme, foreground, text),
20
+ option-hover-state-layer-color: $active-state-layer-color,
21
+ option-focus-state-layer-color: $active-state-layer-color,
22
+ option-selected-state-layer-color: $active-state-layer-color,
26
23
  );
27
24
  }
28
25
 
29
26
  // Tokens that can be configured through Angular Material's typography theming API.
30
27
  @function get-typography-tokens($theme) {
31
28
  @return (
32
- label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
33
- label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
34
- label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
35
- label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
36
- label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight)
29
+ option-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
30
+ option-label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
31
+ option-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
32
+ option-label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
33
+ option-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight)
37
34
  );
38
35
  }
39
36
 
@@ -1,22 +1,25 @@
1
1
  @use 'sass:map';
2
- @use '../style/sass-utils';
3
2
  @use '../tokens/m3-utils';
3
+ @use '../tokens/m3';
4
4
 
5
5
  // The prefix used to generate the fully qualified name for tokens in this file.
6
6
  $prefix: (mat, optgroup);
7
7
 
8
8
  /// Generates custom tokens for the mat-optgroup.
9
- /// @param {Map} $systems The MDC system tokens
10
- /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
11
- /// @param {Map} $token-slots Possible token slots
12
- /// @return {Map} A set of custom tokens for the mat-optgroup
13
- @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
14
- $tokens: sass-utils.merge-all(
15
- m3-utils.generate-typography-tokens($systems, label-text, title-small),
16
- (
17
- label-text-color: map.get($systems, md-sys-color, on-surface-variant),
18
- )
9
+ @function get-tokens($theme: m3.$sys-theme) {
10
+ $system: m3-utils.get-system($theme);
11
+ @return (
12
+ base: (),
13
+ color: (
14
+ optgroup-label-text-color: map.get($system, on-surface-variant),
15
+ ),
16
+ typography: (
17
+ optgroup-label-text-font: map.get($system, title-small-font),
18
+ optgroup-label-text-line-height: map.get($system, title-small-line-height),
19
+ optgroup-label-text-size: map.get($system, title-small-size),
20
+ optgroup-label-text-tracking: map.get($system, title-small-tracking),
21
+ optgroup-label-text-weight: map.get($system, title-small-weight),
22
+ ),
23
+ density: (),
19
24
  );
20
-
21
- @return m3-utils.namespace($prefix, $tokens, $token-slots);
22
25
  }
@@ -1,57 +1,37 @@
1
1
  @use 'sass:map';
2
- @use '../style/sass-utils';
3
2
  @use '../tokens/m3-utils';
4
-
5
- // The prefix used to generate the fully qualified name for tokens in this file.
6
- $prefix: (mat, option);
3
+ @use '../tokens/m3';
7
4
 
8
5
  /// Generates custom tokens for the mat-option.
9
- /// @param {Map} $systems The MDC system tokens
10
- /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
11
- /// @param {Map} $token-slots Possible token slots
12
- /// @return {Map} A set of custom tokens for the mat-option
13
- @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
14
- $tokens: (
15
- selected-state-label-text-color: map.get($systems, md-sys-color, on-secondary-container),
16
- label-text-color: map.get($systems, md-sys-color, on-surface),
17
- hover-state-layer-color: sass-utils.safe-color-change(
18
- map.get($systems, md-sys-color, on-surface),
19
- $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
20
- ),
21
- focus-state-layer-color: sass-utils.safe-color-change(
22
- map.get($systems, md-sys-color, on-surface),
23
- $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
24
- ),
25
- selected-state-layer-color: map.get($systems, md-sys-color, secondary-container),
6
+ @function get-tokens($theme: m3.$sys-theme, $color-variant: null) {
7
+ $system: m3-utils.get-system($theme);
8
+ @if $color-variant {
9
+ $system: m3-utils.replace-colors-with-variant($system, secondary, $color-variant);
10
+ }
26
11
 
27
- // According to the spec the options have to be `label-large` in all typography
28
- // dimensions, however this is inconsistent with the designs and with MDC's
29
- // own implementation. This appears to be a bug in the spec, because MDC overrides
30
- // the font size and weight to be `body-large` (see b/261838263). We make the same
31
- // override here so the label looks correct.
32
- label-text-size: map.get($systems, md-sys-typescale, body-large-size),
33
- label-text-weight: map.get($systems, md-sys-typescale, body-large-weight),
34
- label-text-font: map.get($systems, md-sys-typescale, label-large-font),
35
- label-text-line-height: map.get($systems, md-sys-typescale, label-large-line-height),
36
- label-text-tracking: map.get($systems, md-sys-typescale, label-large-tracking),
37
- );
38
-
39
- $variant-tokens: (
40
- // Color variants:
41
- primary: (
42
- selected-state-label-text-color: map.get($systems, md-sys-color, on-primary-container),
43
- selected-state-layer-color: map.get($systems, md-sys-color, primary-container),
12
+ // According to the spec the options have to be `label-large` in all typography
13
+ // dimensions, however this is inconsistent with the designs and with MDC's
14
+ // own implementation. This appears to be a bug in the spec, because MDC overrides
15
+ // the font size and weight to be `body-large` (see b/261838263). We make the same
16
+ // override here so the label looks correct.
17
+ @return (
18
+ base: (),
19
+ color: (
20
+ option-focus-state-layer-color: m3-utils.color-with-opacity(
21
+ map.get($system, on-surface), map.get($system, focus-state-layer-opacity)),
22
+ option-hover-state-layer-color: m3-utils.color-with-opacity(
23
+ map.get($system, on-surface), map.get($system, hover-state-layer-opacity)),
24
+ option-label-text-color: map.get($system, on-surface),
25
+ option-selected-state-label-text-color: map.get($system, on-secondary-container),
26
+ option-selected-state-layer-color: map.get($system, secondary-container),
44
27
  ),
45
- secondary: (), // Default, no overrides needed
46
- tertiary: (
47
- selected-state-label-text-color: map.get($systems, md-sys-color, on-tertiary-container),
48
- selected-state-layer-color: map.get($systems, md-sys-color, tertiary-container),
28
+ typography: (
29
+ option-label-text-size: map.get($system, body-large-size),
30
+ option-label-text-weight: map.get($system, body-large-weight),
31
+ option-label-text-font: map.get($system, label-large-font),
32
+ option-label-text-line-height: map.get($system, label-large-line-height),
33
+ option-label-text-tracking: map.get($system, label-large-tracking),
49
34
  ),
50
- error: (
51
- selected-state-label-text-color: map.get($systems, md-sys-color, on-error-container),
52
- selected-state-layer-color: map.get($systems, md-sys-color, error-container),
53
- )
35
+ density: (),
54
36
  );
55
-
56
- @return m3-utils.namespace($prefix, ($tokens, $variant-tokens), $token-slots);
57
37
  }