@angular/material 17.1.0 → 17.2.0-next.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 (312) hide show
  1. package/_index.scss +4 -4
  2. package/badge/_badge-theme.scss +30 -180
  3. package/badge/index.d.ts +11 -1
  4. package/button/_button-base.scss +50 -10
  5. package/button/_button-theme.scss +92 -51
  6. package/button/_fab-theme.scss +82 -15
  7. package/button/_icon-button-theme.scss +11 -4
  8. package/button-toggle/_button-toggle-theme.scss +26 -11
  9. package/checkbox/_checkbox-theme.scss +41 -23
  10. package/chips/_chips-theme.scss +25 -9
  11. package/core/_core-theme.scss +85 -38
  12. package/core/index.d.ts +7 -4
  13. package/core/mdc-helpers/_mdc-helpers.scss +0 -8
  14. package/core/option/_option-theme.scss +24 -10
  15. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +64 -24
  16. package/core/tokens/_token-utils.scss +22 -0
  17. package/core/tokens/m2/_index.scss +16 -0
  18. package/core/tokens/m2/mat/_badge.scss +27 -1
  19. package/core/tokens/m2/mat/_checkbox.scss +45 -0
  20. package/core/tokens/m2/mat/_dialog.scss +49 -0
  21. package/core/tokens/m2/mat/_fab-small.scss +95 -0
  22. package/core/tokens/m2/mat/_fab.scss +6 -1
  23. package/core/tokens/m2/mat/_filled-button.scss +17 -2
  24. package/core/tokens/m2/mat/_form-field.scss +15 -0
  25. package/core/tokens/m2/mat/_icon-button.scss +6 -1
  26. package/core/tokens/m2/mat/_outlined-button.scss +17 -2
  27. package/core/tokens/m2/mat/_protected-button.scss +17 -2
  28. package/core/tokens/m2/mat/_radio.scss +6 -1
  29. package/core/tokens/m2/mat/_stepper.scss +6 -1
  30. package/core/tokens/m2/mat/_text-button.scss +20 -2
  31. package/core/tokens/m2/mdc/_extended-fab.scss +3 -2
  32. package/core/tokens/m2/mdc/_fab-small.scss +90 -0
  33. package/core/tokens/m2/mdc/_fab.scss +0 -11
  34. package/core/tokens/m2/mdc/_filled-text-field.scss +8 -8
  35. package/core/tokens/m2/mdc/_icon-button.scss +15 -7
  36. package/core/tokens/m2/mdc/_outlined-text-field.scss +6 -6
  37. package/core/tokens/m2/mdc/_switch.scss +12 -3
  38. package/datepicker/_datepicker-theme.scss +25 -9
  39. package/dialog/_dialog-theme.scss +10 -0
  40. package/dialog/index.d.ts +28 -9
  41. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  42. package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
  43. package/esm2022/autocomplete/autocomplete.mjs +4 -4
  44. package/esm2022/autocomplete/module.mjs +5 -5
  45. package/esm2022/badge/badge-module.mjs +9 -7
  46. package/esm2022/badge/badge.mjs +32 -6
  47. package/esm2022/badge/public-api.mjs +2 -2
  48. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
  49. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  50. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  51. package/esm2022/button/button-base.mjs +7 -7
  52. package/esm2022/button/button.mjs +10 -11
  53. package/esm2022/button/fab.mjs +18 -19
  54. package/esm2022/button/icon-button.mjs +10 -11
  55. package/esm2022/button/module.mjs +5 -5
  56. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  57. package/esm2022/button-toggle/button-toggle.mjs +7 -7
  58. package/esm2022/card/card.mjs +43 -43
  59. package/esm2022/card/module.mjs +5 -5
  60. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  61. package/esm2022/checkbox/checkbox.mjs +7 -8
  62. package/esm2022/checkbox/module.mjs +9 -9
  63. package/esm2022/chips/chip-action.mjs +4 -4
  64. package/esm2022/chips/chip-edit-input.mjs +4 -4
  65. package/esm2022/chips/chip-grid.mjs +4 -4
  66. package/esm2022/chips/chip-icons.mjs +10 -10
  67. package/esm2022/chips/chip-input.mjs +4 -4
  68. package/esm2022/chips/chip-listbox.mjs +4 -4
  69. package/esm2022/chips/chip-option.mjs +4 -4
  70. package/esm2022/chips/chip-row.mjs +5 -6
  71. package/esm2022/chips/chip-set.mjs +4 -4
  72. package/esm2022/chips/chip.mjs +5 -6
  73. package/esm2022/chips/module.mjs +5 -5
  74. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  75. package/esm2022/core/common-behaviors/error-state.mjs +2 -4
  76. package/esm2022/core/datetime/index.mjs +9 -9
  77. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  78. package/esm2022/core/error/error-options.mjs +7 -7
  79. package/esm2022/core/internal-form-field/internal-form-field.mjs +4 -4
  80. package/esm2022/core/line/line.mjs +8 -8
  81. package/esm2022/core/option/index.mjs +5 -5
  82. package/esm2022/core/option/optgroup.mjs +4 -4
  83. package/esm2022/core/option/option.mjs +4 -4
  84. package/esm2022/core/private/ripple-loader.mjs +4 -4
  85. package/esm2022/core/ripple/index.mjs +5 -5
  86. package/esm2022/core/ripple/ripple.mjs +5 -6
  87. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  88. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +5 -6
  89. package/esm2022/core/version.mjs +1 -1
  90. package/esm2022/datepicker/calendar-body.mjs +4 -4
  91. package/esm2022/datepicker/calendar.mjs +7 -7
  92. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  93. package/esm2022/datepicker/date-range-input.mjs +4 -4
  94. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  95. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  96. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  97. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  98. package/esm2022/datepicker/datepicker-base.mjs +7 -7
  99. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  100. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  101. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  102. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  103. package/esm2022/datepicker/datepicker-toggle.mjs +7 -7
  104. package/esm2022/datepicker/datepicker.mjs +4 -4
  105. package/esm2022/datepicker/month-view.mjs +4 -4
  106. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  107. package/esm2022/datepicker/year-view.mjs +4 -4
  108. package/esm2022/dialog/dialog-config.mjs +1 -3
  109. package/esm2022/dialog/dialog-container.mjs +17 -7
  110. package/esm2022/dialog/dialog-content-directives.mjs +49 -31
  111. package/esm2022/dialog/dialog-ref.mjs +3 -1
  112. package/esm2022/dialog/dialog.mjs +4 -4
  113. package/esm2022/dialog/module.mjs +5 -5
  114. package/esm2022/dialog/public-api.mjs +2 -2
  115. package/esm2022/divider/divider-module.mjs +5 -5
  116. package/esm2022/divider/divider.mjs +4 -4
  117. package/esm2022/expansion/accordion.mjs +4 -4
  118. package/esm2022/expansion/expansion-module.mjs +5 -5
  119. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  120. package/esm2022/expansion/expansion-panel-header.mjs +11 -12
  121. package/esm2022/expansion/expansion-panel.mjs +8 -9
  122. package/esm2022/form-field/directives/error.mjs +4 -4
  123. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  124. package/esm2022/form-field/directives/hint.mjs +4 -4
  125. package/esm2022/form-field/directives/label.mjs +4 -4
  126. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  127. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  128. package/esm2022/form-field/directives/prefix.mjs +4 -4
  129. package/esm2022/form-field/directives/suffix.mjs +4 -4
  130. package/esm2022/form-field/form-field-control.mjs +4 -4
  131. package/esm2022/form-field/form-field.mjs +7 -8
  132. package/esm2022/form-field/module.mjs +5 -5
  133. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  134. package/esm2022/grid-list/grid-list.mjs +4 -4
  135. package/esm2022/grid-list/grid-tile.mjs +16 -16
  136. package/esm2022/icon/icon-module.mjs +5 -5
  137. package/esm2022/icon/icon-registry.mjs +4 -4
  138. package/esm2022/icon/icon.mjs +4 -4
  139. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  140. package/esm2022/input/input.mjs +4 -4
  141. package/esm2022/input/module.mjs +5 -5
  142. package/esm2022/list/action-list.mjs +4 -4
  143. package/esm2022/list/list-base.mjs +8 -9
  144. package/esm2022/list/list-item-sections.mjs +19 -19
  145. package/esm2022/list/list-module.mjs +5 -5
  146. package/esm2022/list/list-option.mjs +4 -4
  147. package/esm2022/list/list.mjs +8 -9
  148. package/esm2022/list/nav-list.mjs +4 -4
  149. package/esm2022/list/selection-list.mjs +4 -4
  150. package/esm2022/list/subheader.mjs +4 -4
  151. package/esm2022/menu/menu-content.mjs +4 -4
  152. package/esm2022/menu/menu-item.mjs +4 -4
  153. package/esm2022/menu/menu-trigger.mjs +4 -4
  154. package/esm2022/menu/menu.mjs +4 -4
  155. package/esm2022/menu/module.mjs +5 -5
  156. package/esm2022/paginator/module.mjs +5 -5
  157. package/esm2022/paginator/paginator-intl.mjs +4 -4
  158. package/esm2022/paginator/paginator.mjs +4 -4
  159. package/esm2022/progress-bar/module.mjs +5 -5
  160. package/esm2022/progress-bar/progress-bar.mjs +5 -6
  161. package/esm2022/progress-spinner/module.mjs +5 -5
  162. package/esm2022/progress-spinner/progress-spinner.mjs +5 -6
  163. package/esm2022/radio/module.mjs +5 -5
  164. package/esm2022/radio/radio.mjs +9 -10
  165. package/esm2022/select/module.mjs +5 -5
  166. package/esm2022/select/select.mjs +7 -7
  167. package/esm2022/sidenav/drawer.mjs +11 -12
  168. package/esm2022/sidenav/sidenav-module.mjs +5 -5
  169. package/esm2022/sidenav/sidenav.mjs +10 -10
  170. package/esm2022/slide-toggle/module.mjs +9 -9
  171. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  172. package/esm2022/slide-toggle/slide-toggle.mjs +7 -8
  173. package/esm2022/slider/module.mjs +5 -5
  174. package/esm2022/slider/slider-input.mjs +7 -7
  175. package/esm2022/slider/slider-thumb.mjs +4 -4
  176. package/esm2022/slider/slider.mjs +5 -6
  177. package/esm2022/snack-bar/module.mjs +5 -5
  178. package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
  179. package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
  180. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  181. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  182. package/esm2022/sort/sort-header-intl.mjs +4 -4
  183. package/esm2022/sort/sort-header.mjs +4 -4
  184. package/esm2022/sort/sort-module.mjs +5 -5
  185. package/esm2022/sort/sort.mjs +4 -4
  186. package/esm2022/stepper/step-content.mjs +4 -4
  187. package/esm2022/stepper/step-header.mjs +5 -5
  188. package/esm2022/stepper/step-label.mjs +4 -4
  189. package/esm2022/stepper/stepper-button.mjs +7 -7
  190. package/esm2022/stepper/stepper-icon.mjs +4 -4
  191. package/esm2022/stepper/stepper-intl.mjs +4 -4
  192. package/esm2022/stepper/stepper-module.mjs +5 -5
  193. package/esm2022/stepper/stepper.mjs +7 -7
  194. package/esm2022/table/cell.mjs +22 -22
  195. package/esm2022/table/module.mjs +5 -5
  196. package/esm2022/table/row.mjs +22 -22
  197. package/esm2022/table/table.mjs +7 -7
  198. package/esm2022/table/text-column.mjs +4 -4
  199. package/esm2022/tabs/module.mjs +5 -5
  200. package/esm2022/tabs/paginated-tab-header.mjs +5 -6
  201. package/esm2022/tabs/tab-body.mjs +7 -7
  202. package/esm2022/tabs/tab-content.mjs +4 -4
  203. package/esm2022/tabs/tab-group.mjs +5 -6
  204. package/esm2022/tabs/tab-header.mjs +5 -6
  205. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  206. package/esm2022/tabs/tab-label.mjs +4 -4
  207. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +11 -12
  208. package/esm2022/tabs/tab.mjs +4 -4
  209. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  210. package/esm2022/toolbar/toolbar.mjs +7 -7
  211. package/esm2022/tooltip/module.mjs +5 -5
  212. package/esm2022/tooltip/tooltip.mjs +8 -9
  213. package/esm2022/tree/node.mjs +10 -10
  214. package/esm2022/tree/outlet.mjs +4 -4
  215. package/esm2022/tree/padding.mjs +4 -4
  216. package/esm2022/tree/toggle.mjs +4 -4
  217. package/esm2022/tree/tree-module.mjs +5 -5
  218. package/esm2022/tree/tree.mjs +4 -4
  219. package/fesm2022/autocomplete.mjs +13 -13
  220. package/fesm2022/autocomplete.mjs.map +1 -1
  221. package/fesm2022/badge.mjs +38 -10
  222. package/fesm2022/badge.mjs.map +1 -1
  223. package/fesm2022/bottom-sheet.mjs +10 -10
  224. package/fesm2022/bottom-sheet.mjs.map +1 -1
  225. package/fesm2022/button-toggle.mjs +10 -10
  226. package/fesm2022/button-toggle.mjs.map +1 -1
  227. package/fesm2022/button.mjs +43 -44
  228. package/fesm2022/button.mjs.map +1 -1
  229. package/fesm2022/card.mjs +46 -46
  230. package/fesm2022/card.mjs.map +1 -1
  231. package/fesm2022/checkbox.mjs +17 -18
  232. package/fesm2022/checkbox.mjs.map +1 -1
  233. package/fesm2022/chips.mjs +41 -42
  234. package/fesm2022/chips.mjs.map +1 -1
  235. package/fesm2022/core.mjs +62 -65
  236. package/fesm2022/core.mjs.map +1 -1
  237. package/fesm2022/datepicker.mjs +82 -82
  238. package/fesm2022/datepicker.mjs.map +1 -1
  239. package/fesm2022/dialog.mjs +74 -46
  240. package/fesm2022/dialog.mjs.map +1 -1
  241. package/fesm2022/divider.mjs +7 -7
  242. package/fesm2022/divider.mjs.map +1 -1
  243. package/fesm2022/expansion.mjs +26 -27
  244. package/fesm2022/expansion.mjs.map +1 -1
  245. package/fesm2022/form-field.mjs +37 -38
  246. package/fesm2022/form-field.mjs.map +1 -1
  247. package/fesm2022/grid-list.mjs +22 -22
  248. package/fesm2022/grid-list.mjs.map +1 -1
  249. package/fesm2022/icon/testing.mjs +7 -7
  250. package/fesm2022/icon/testing.mjs.map +1 -1
  251. package/fesm2022/icon.mjs +10 -10
  252. package/fesm2022/icon.mjs.map +1 -1
  253. package/fesm2022/input.mjs +7 -7
  254. package/fesm2022/input.mjs.map +1 -1
  255. package/fesm2022/list.mjs +51 -52
  256. package/fesm2022/list.mjs.map +1 -1
  257. package/fesm2022/menu.mjs +16 -16
  258. package/fesm2022/menu.mjs.map +1 -1
  259. package/fesm2022/paginator.mjs +10 -10
  260. package/fesm2022/paginator.mjs.map +1 -1
  261. package/fesm2022/progress-bar.mjs +8 -9
  262. package/fesm2022/progress-bar.mjs.map +1 -1
  263. package/fesm2022/progress-spinner.mjs +8 -9
  264. package/fesm2022/progress-spinner.mjs.map +1 -1
  265. package/fesm2022/radio.mjs +12 -13
  266. package/fesm2022/radio.mjs.map +1 -1
  267. package/fesm2022/select.mjs +10 -10
  268. package/fesm2022/select.mjs.map +1 -1
  269. package/fesm2022/sidenav.mjs +23 -24
  270. package/fesm2022/sidenav.mjs.map +1 -1
  271. package/fesm2022/slide-toggle.mjs +17 -18
  272. package/fesm2022/slide-toggle.mjs.map +1 -1
  273. package/fesm2022/slider.mjs +17 -18
  274. package/fesm2022/slider.mjs.map +1 -1
  275. package/fesm2022/snack-bar.mjs +22 -22
  276. package/fesm2022/snack-bar.mjs.map +1 -1
  277. package/fesm2022/sort.mjs +13 -13
  278. package/fesm2022/sort.mjs.map +1 -1
  279. package/fesm2022/stepper.mjs +32 -32
  280. package/fesm2022/stepper.mjs.map +1 -1
  281. package/fesm2022/table.mjs +55 -55
  282. package/fesm2022/table.mjs.map +1 -1
  283. package/fesm2022/tabs.mjs +41 -42
  284. package/fesm2022/tabs.mjs.map +1 -1
  285. package/fesm2022/toolbar.mjs +10 -10
  286. package/fesm2022/toolbar.mjs.map +1 -1
  287. package/fesm2022/tooltip.mjs +11 -12
  288. package/fesm2022/tooltip.mjs.map +1 -1
  289. package/fesm2022/tree.mjs +25 -25
  290. package/fesm2022/tree.mjs.map +1 -1
  291. package/form-field/_form-field-theme.scss +31 -14
  292. package/icon/_icon-theme.scss +2 -2
  293. package/package.json +7 -7
  294. package/paginator/_paginator-theme.scss +10 -16
  295. package/prebuilt-themes/deeppurple-amber.css +1 -1
  296. package/prebuilt-themes/indigo-pink.css +1 -1
  297. package/prebuilt-themes/pink-bluegrey.css +1 -1
  298. package/prebuilt-themes/purple-green.css +1 -1
  299. package/progress-bar/_progress-bar-theme.scss +27 -9
  300. package/progress-spinner/_progress-spinner-theme.scss +38 -17
  301. package/radio/_radio-theme.scss +34 -18
  302. package/schematics/ng-add/index.js +2 -2
  303. package/schematics/ng-add/index.mjs +2 -2
  304. package/schematics/ng-add/setup-project.js +7 -75
  305. package/schematics/ng-add/setup-project.mjs +7 -75
  306. package/schematics/ng-generate/mdc-migration/index_bundled.js +122 -115
  307. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  308. package/select/_select-theme.scss +24 -10
  309. package/slide-toggle/_slide-toggle-theme.scss +36 -16
  310. package/slider/_slider-theme.scss +28 -11
  311. package/stepper/_stepper-theme.scss +28 -7
  312. package/tabs/_tabs-theme.scss +32 -14
@@ -1,15 +1,20 @@
1
- @use 'sass:map';
2
1
  @use '@material/fab/fab-theme' as mdc-fab-theme;
2
+ @use '@material/fab/fab-small-theme' as mdc-fab-small-theme;
3
3
  @use '@material/fab/extended-fab-theme' as mdc-extended-fab-theme;
4
4
  @use '../core/style/sass-utils';
5
5
  @use '../core/theming/theming';
6
6
  @use '../core/theming/inspection';
7
7
  @use '../core/tokens/m2/mdc/fab' as tokens-mdc-fab;
8
+ @use '../core/tokens/m2/mdc/fab-small' as tokens-mdc-fab-small;
8
9
  @use '../core/tokens/m2/mdc/extended-fab' as tokens-mdc-extended-fab;
9
10
  @use '../core/tokens/m2/mat/fab' as tokens-mat-fab;
11
+ @use '../core/tokens/m2/mat/fab-small' as tokens-mat-fab-small;
10
12
  @use '../core/tokens/token-utils';
11
13
  @use '../core/typography/typography';
12
14
 
15
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
16
+ /// for the mat-fab.
17
+ /// @param {Map} $theme The theme to generate base styles for.
13
18
  @mixin base($theme) {
14
19
  @if inspection.get-theme-version($theme) == 1 {
15
20
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -18,6 +23,7 @@
18
23
  // Add default values for tokens not related to color, typography, or density.
19
24
  @include sass-utils.current-selector-or-root() {
20
25
  @include mdc-fab-theme.theme(tokens-mdc-fab.get-unthemable-tokens());
26
+ @include mdc-fab-small-theme.theme(tokens-mdc-fab-small.get-unthemable-tokens());
21
27
  @include mdc-extended-fab-theme.theme(
22
28
  tokens-mdc-extended-fab.get-unthemable-tokens()
23
29
  );
@@ -40,17 +46,37 @@
40
46
  @include token-utils.create-token-values(tokens-mat-fab.$prefix, $mat-tokens);
41
47
  }
42
48
 
43
- @mixin color($theme) {
49
+ @mixin _fab-small-variant($theme, $palette) {
50
+ $mdc-tokens: if($palette,
51
+ tokens-mdc-fab-small.private-get-color-palette-color-tokens($theme, $palette),
52
+ tokens-mdc-fab-small.get-color-tokens($theme)
53
+ );
54
+
55
+ $mat-tokens: if($palette,
56
+ tokens-mat-fab-small.private-get-color-palette-color-tokens($theme, $palette),
57
+ tokens-mat-fab-small.get-color-tokens($theme)
58
+ );
59
+
60
+ @include mdc-fab-small-theme.theme($mdc-tokens);
61
+ @include token-utils.create-token-values(tokens-mat-fab-small.$prefix, $mat-tokens);
62
+ }
63
+
64
+ /// Outputs color theme styles for the mat-fab.
65
+ /// @param {Map} $theme The theme to generate color styles for.
66
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
67
+ /// $color-variant: The color variant to use for the fab: primary, secondary, or tertiary
68
+ /// (If not specified, default primary color will be used).
69
+ @mixin color($theme, $options...) {
44
70
  @if inspection.get-theme-version($theme) == 1 {
45
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
71
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
46
72
  }
47
73
  @else {
48
74
  @include sass-utils.current-selector-or-root() {
49
75
  @include _fab-variant($theme, null);
76
+ @include _fab-small-variant($theme, null);
50
77
  @include mdc-extended-fab-theme.theme(tokens-mdc-extended-fab.get-color-tokens($theme));
51
78
 
52
- .mat-mdc-fab,
53
- .mat-mdc-mini-fab {
79
+ .mat-mdc-fab {
54
80
  &.mat-primary {
55
81
  @include _fab-variant($theme, primary);
56
82
  }
@@ -63,10 +89,26 @@
63
89
  @include _fab-variant($theme, warn);
64
90
  }
65
91
  }
92
+
93
+ .mat-mdc-mini-fab {
94
+ &.mat-primary {
95
+ @include _fab-small-variant($theme, primary);
96
+ }
97
+
98
+ &.mat-accent {
99
+ @include _fab-small-variant($theme, accent);
100
+ }
101
+
102
+ &.mat-warn {
103
+ @include _fab-small-variant($theme, warn);
104
+ }
105
+ }
66
106
  }
67
107
  }
68
108
  }
69
109
 
110
+ /// Outputs typography theme styles for the mat-fab.
111
+ /// @param {Map} $theme The theme to generate typography styles for.
70
112
  @mixin typography($theme) {
71
113
  @if inspection.get-theme-version($theme) == 1 {
72
114
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -74,21 +116,39 @@
74
116
  @else {
75
117
  @include sass-utils.current-selector-or-root() {
76
118
  @include mdc-extended-fab-theme.theme(tokens-mdc-extended-fab.get-typography-tokens($theme));
119
+ @include token-utils.create-token-values(tokens-mat-fab.$prefix,
120
+ tokens-mat-fab.get-typography-tokens($theme));
121
+ @include token-utils.create-token-values(tokens-mat-fab-small.$prefix,
122
+ tokens-mat-fab-small.get-typography-tokens($theme));
77
123
  }
78
124
  }
79
125
  }
80
126
 
127
+ /// Outputs density theme styles for the mat-fab.
128
+ /// @param {Map} $theme The theme to generate density styles for.
81
129
  @mixin density($theme) {
82
130
  @if inspection.get-theme-version($theme) == 1 {
83
131
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
84
132
  }
85
- @else {}
133
+ @else {
134
+ @include sass-utils.current-selector-or-root() {
135
+ @include token-utils.create-token-values(tokens-mat-fab.$prefix,
136
+ tokens-mat-fab.get-density-tokens($theme));
137
+ @include token-utils.create-token-values(tokens-mat-fab-small.$prefix,
138
+ tokens-mat-fab-small.get-density-tokens($theme));
139
+ }
140
+ }
86
141
  }
87
142
 
88
- @mixin theme($theme) {
143
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-checkbox.
144
+ /// @param {Map} $theme The theme to generate styles for.
145
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
146
+ /// $color-variant: The color variant to use for the fab: primary, secondary, or tertiary
147
+ /// (If not specified, default primary color will be used).
148
+ @mixin theme($theme, $options...) {
89
149
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-fab') {
90
150
  @if inspection.get-theme-version($theme) == 1 {
91
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
151
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
92
152
  }
93
153
  @else {
94
154
  @include base($theme);
@@ -105,11 +165,18 @@
105
165
  }
106
166
  }
107
167
 
108
- @mixin _theme-from-tokens($tokens) {
109
- @if ($tokens != ()) {
110
- @include mdc-extended-fab-theme.theme(map.get($tokens, tokens-mdc-extended-fab.$prefix));
111
- @include mdc-fab-theme.theme(map.get($tokens, tokens-mdc-fab.$prefix));
112
- @include token-utils.create-token-values(
113
- tokens-mat-fab.$prefix, map.get($tokens, tokens-mat-fab.$prefix));
114
- }
168
+ @mixin _theme-from-tokens($tokens, $options...) {
169
+ $mdc-extended-fab-tokens: token-utils.get-tokens-for(
170
+ $tokens, tokens-mdc-extended-fab.$prefix, $options...);
171
+ $mdc-fab-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-fab.$prefix, $options...);
172
+ $mdc-fab-small-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-fab-small.$prefix,
173
+ $options...);
174
+ $mat-fab-tokens: token-utils.get-tokens-for($tokens, tokens-mat-fab.$prefix, $options...);
175
+ $mat-fab-small-tokens: token-utils.get-tokens-for($tokens, tokens-mat-fab-small.$prefix,
176
+ $options...);
177
+ @include mdc-extended-fab-theme.theme($mdc-extended-fab-tokens);
178
+ @include mdc-fab-theme.theme($mdc-fab-tokens);
179
+ @include mdc-fab-small-theme.theme($mdc-fab-small-tokens);
180
+ @include token-utils.create-token-values(tokens-mat-fab.$prefix, $mat-fab-tokens);
181
+ @include token-utils.create-token-values(tokens-mat-fab-small.$prefix, $mat-fab-small-tokens);
115
182
  }
@@ -5,7 +5,6 @@
5
5
  @use '../core/tokens/m2/mdc/icon-button' as tokens-mdc-icon-button;
6
6
  @use '../core/tokens/m2/mat/icon-button' as tokens-mat-icon-button;
7
7
  @use '../core/style/sass-utils';
8
- @use './button-base';
9
8
  @use '../core/tokens/token-utils';
10
9
  @use '../core/theming/theming';
11
10
  @use '../core/theming/inspection';
@@ -67,7 +66,12 @@
67
66
  @if inspection.get-theme-version($theme) == 1 {
68
67
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
69
68
  }
70
- @else {}
69
+ @else {
70
+ @include sass-utils.current-selector-or-root() {
71
+ @include token-utils.create-token-values(tokens-mat-icon-button.$prefix,
72
+ tokens-mat-icon-button.get-typography-tokens($theme));
73
+ }
74
+ }
71
75
  }
72
76
 
73
77
  @mixin density($theme) {
@@ -91,6 +95,11 @@
91
95
  $property-name: size,
92
96
  );
93
97
 
98
+ @include sass-utils.current-selector-or-root() {
99
+ @include token-utils.create-token-values(tokens-mat-icon-button.$prefix,
100
+ tokens-mat-icon-button.get-density-tokens($theme));
101
+ }
102
+
94
103
  // Use `mat-mdc-button-base` to increase the specificity over the button's structural styles.
95
104
  .mat-mdc-icon-button.mat-mdc-button-base {
96
105
  // Match the styles that used to be present. This is necessary for backwards
@@ -107,8 +116,6 @@
107
116
  width: var(--mdc-icon-button-state-layer-size);
108
117
  height: var(--mdc-icon-button-state-layer-size);
109
118
  padding: math.div($calculated-size - $icon-size, 2);
110
-
111
- @include button-base.mat-private-button-touch-target-density($density-scale);
112
119
  }
113
120
  }
114
121
  }
@@ -1,4 +1,3 @@
1
- @use 'sass:map';
2
1
  @use '../core/theming/theming';
3
2
  @use '../core/theming/inspection';
4
3
  @use '../core/typography/typography';
@@ -7,6 +6,9 @@
7
6
  @use '../core/tokens/token-utils';
8
7
  @use '../core/style/sass-utils';
9
8
 
9
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
10
+ /// for the mat-button-toggle.
11
+ /// @param {Map} $theme The theme to generate base styles for.
10
12
  @mixin base($theme) {
11
13
  @if inspection.get-theme-version($theme) == 1 {
12
14
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -25,9 +27,14 @@
25
27
  }
26
28
  }
27
29
 
28
- @mixin color($theme) {
30
+ /// Outputs color theme styles for the mat-button-toggle.
31
+ /// @param {Map} $theme The theme to generate color styles for.
32
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
33
+ /// $color-variant: The color variant to use for the button toggle: primary, secondary, tertiary,
34
+ /// or error (If not specified, default secondary color will be used).
35
+ @mixin color($theme, $options...) {
29
36
  @if inspection.get-theme-version($theme) == 1 {
30
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
37
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
31
38
  }
32
39
  @else {
33
40
  @include sass-utils.current-selector-or-root() {
@@ -39,6 +46,8 @@
39
46
  }
40
47
  }
41
48
 
49
+ /// Outputs typography theme styles for the mat-button-toggle.
50
+ /// @param {Map} $theme The theme to generate typography styles for.
42
51
  @mixin typography($theme) {
43
52
  @if inspection.get-theme-version($theme) == 1 {
44
53
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -53,6 +62,8 @@
53
62
  }
54
63
  }
55
64
 
65
+ /// Outputs density theme styles for the mat-button-toggle.
66
+ /// @param {Map} $theme The theme to generate density styles for.
56
67
  @mixin density($theme) {
57
68
  @if inspection.get-theme-version($theme) == 1 {
58
69
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -67,10 +78,15 @@
67
78
  }
68
79
  }
69
80
 
70
- @mixin theme($theme) {
81
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-button-toggle.
82
+ /// @param {Map} $theme The theme to generate styles for.
83
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
84
+ /// $color-variant: The color variant to use for the button toggle: primary, secondary, tertiary,
85
+ /// or error (If not specified, default secondary color will be used).
86
+ @mixin theme($theme, $options...) {
71
87
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-button-toggle') {
72
88
  @if inspection.get-theme-version($theme) == 1 {
73
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
89
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
74
90
  }
75
91
  @else {
76
92
  @include base($theme);
@@ -87,10 +103,9 @@
87
103
  }
88
104
  }
89
105
 
90
- @mixin _theme-from-tokens($tokens) {
91
- @if ($tokens != ()) {
92
- @include token-utils.create-token-values(
93
- tokens-mat-standard-button-toggle.$prefix,
94
- map.get($tokens, tokens-mat-standard-button-toggle.$prefix));
95
- }
106
+ @mixin _theme-from-tokens($tokens, $options...) {
107
+ $mat-standard-button-toggle-tokens:
108
+ token-utils.get-tokens-for($tokens, tokens-mat-standard-button-toggle.$prefix, $options...);
109
+ @include token-utils.create-token-values(
110
+ tokens-mat-standard-button-toggle.$prefix, $mat-standard-button-toggle-tokens);
96
111
  }
@@ -1,14 +1,17 @@
1
- @use 'sass:map';
2
1
  @use '@material/checkbox/checkbox-theme' as mdc-checkbox-theme;
3
2
  @use '@material/form-field/form-field-theme' as mdc-form-field-theme;
4
3
  @use '../core/style/sass-utils';
5
4
  @use '../core/theming/theming';
6
5
  @use '../core/theming/inspection';
6
+ @use '../core/tokens/token-utils';
7
7
  @use '../core/typography/typography';
8
- @use '../core/mdc-helpers/mdc-helpers';
9
8
  @use '../core/tokens/m2/mdc/checkbox' as tokens-mdc-checkbox;
10
9
  @use '../core/tokens/m2/mdc/form-field' as tokens-mdc-form-field;
10
+ @use '../core/tokens/m2/mat/checkbox' as tokens-mat-checkbox;
11
11
 
12
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
13
+ /// for the mat-checkbox.
14
+ /// @param {Map} $theme The theme to generate base styles for.
12
15
  @mixin base($theme) {
13
16
  @if inspection.get-theme-version($theme) == 1 {
14
17
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -16,17 +19,26 @@
16
19
  @else {
17
20
  @include sass-utils.current-selector-or-root() {
18
21
  @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-unthemable-tokens());
22
+ @include token-utils.create-token-values(
23
+ tokens-mat-checkbox.$prefix, tokens-mat-checkbox.get-unthemable-tokens());
19
24
  }
20
25
  }
21
26
  }
22
27
 
23
- @mixin color($theme) {
28
+ /// Outputs color theme styles for the mat-checkbox.
29
+ /// @param {Map} $theme The theme to generate color styles for.
30
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
31
+ /// $color-variant: The color variant to use for the checkbox: primary, secondary, tertiary, or
32
+ /// error (If not specified, default primary color will be used).
33
+ @mixin color($theme, $options...) {
24
34
  @if inspection.get-theme-version($theme) == 1 {
25
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
35
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
26
36
  }
27
37
  @else {
28
38
  @include sass-utils.current-selector-or-root() {
29
39
  @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme));
40
+ @include token-utils.create-token-values(
41
+ tokens-mat-checkbox.$prefix, tokens-mat-checkbox.get-color-tokens($theme));
30
42
  }
31
43
 
32
44
  .mat-mdc-checkbox {
@@ -39,15 +51,12 @@
39
51
  &.mat-warn {
40
52
  @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, warn));
41
53
  }
42
-
43
- &.mat-mdc-checkbox-disabled label {
44
- // MDC should set the disabled color on the label, but doesn't, so we do it here instead.
45
- color: inspection.get-theme-color($theme, foreground, disabled-text);
46
- }
47
54
  }
48
55
  }
49
56
  }
50
57
 
58
+ /// Outputs typography theme styles for the mat-checkbox.
59
+ /// @param {Map} $theme The theme to generate typography styles for.
51
60
  @mixin typography($theme) {
52
61
  @if inspection.get-theme-version($theme) == 1 {
53
62
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -55,6 +64,8 @@
55
64
  @else {
56
65
  @include sass-utils.current-selector-or-root() {
57
66
  @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-typography-tokens($theme));
67
+ @include token-utils.create-token-values(
68
+ tokens-mat-checkbox.$prefix, tokens-mat-checkbox.get-typography-tokens($theme));
58
69
  }
59
70
 
60
71
  .mat-mdc-checkbox {
@@ -63,6 +74,8 @@
63
74
  }
64
75
  }
65
76
 
77
+ /// Outputs density theme styles for the mat-checkbox.
78
+ /// @param {Map} $theme The theme to generate density styles for.
66
79
  @mixin density($theme) {
67
80
  $density-scale: inspection.get-theme-density($theme);
68
81
 
@@ -72,20 +85,21 @@
72
85
  @else {
73
86
  @include sass-utils.current-selector-or-root() {
74
87
  @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-density-tokens($theme));
75
- }
76
-
77
- @include mdc-helpers.if-touch-targets-unsupported($density-scale) {
78
- .mat-mdc-checkbox-touch-target {
79
- display: none;
80
- }
88
+ @include token-utils.create-token-values(
89
+ tokens-mat-checkbox.$prefix, tokens-mat-checkbox.get-density-tokens($theme));
81
90
  }
82
91
  }
83
92
  }
84
93
 
85
- @mixin theme($theme) {
94
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-checkbox.
95
+ /// @param {Map} $theme The theme to generate styles for.
96
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
97
+ /// $color-variant: The color variant to use for the checkbox: primary, secondary, tertiary, or
98
+ /// error (If not specified, default primary color will be used).
99
+ @mixin theme($theme, $options...) {
86
100
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-checkbox') {
87
101
  @if inspection.get-theme-version($theme) == 1 {
88
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
102
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
89
103
  }
90
104
  @else {
91
105
  @include base($theme);
@@ -102,10 +116,14 @@
102
116
  }
103
117
  }
104
118
 
105
- @mixin _theme-from-tokens($tokens) {
106
- @if ($tokens != ()) {
107
- // TODO(mmalerba): Some of the theme styles above are not represented in terms of tokens,
108
- // so this mixin is currently incomplete.
109
- @include mdc-checkbox-theme.theme(map.get($tokens, tokens-mdc-checkbox.$prefix));
110
- }
119
+ @mixin _theme-from-tokens($tokens, $options...) {
120
+ $mdc-checkbox-tokens: token-utils.get-tokens-for(
121
+ $tokens, tokens-mdc-checkbox.$prefix, $options...);
122
+ // Don't pass $options here, since the mdc-form-field doesn't support color options,
123
+ // only the mdc-checkbox does.
124
+ $mdc-form-field-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-form-field.$prefix);
125
+ $mat-checkbox-tokens: token-utils.get-tokens-for($tokens, tokens-mat-checkbox.$prefix);
126
+ @include mdc-checkbox-theme.theme($mdc-checkbox-tokens);
127
+ @include mdc-form-field-theme.theme($mdc-form-field-tokens);
128
+ @include token-utils.create-token-values(tokens-mat-checkbox.$prefix, $mat-checkbox-tokens);
111
129
  }
@@ -1,11 +1,14 @@
1
- @use 'sass:map';
2
1
  @use 'sass:color';
3
2
  @use '@material/chips/chip-theme' as mdc-chip-theme;
4
3
  @use '../core/tokens/m2/mdc/chip' as tokens-mdc-chip;
4
+ @use '../core/tokens/token-utils';
5
5
  @use '../core/theming/theming';
6
6
  @use '../core/theming/inspection';
7
7
  @use '../core/typography/typography';
8
8
 
9
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
10
+ /// for the mat-chips.
11
+ /// @param {Map} $theme The theme to generate base styles for.
9
12
  @mixin base($theme) {
10
13
  @if inspection.get-theme-version($theme) == 1 {
11
14
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -17,9 +20,14 @@
17
20
  }
18
21
  }
19
22
 
20
- @mixin color($theme) {
23
+ /// Outputs color theme styles for the mat-chips.
24
+ /// @param {Map} $theme The theme to generate color styles for.
25
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
26
+ /// $color-variant: The color variant to use for the selected chip: primary, secondary, tertiary,
27
+ /// or error (If not specified, default secondary color will be used).
28
+ @mixin color($theme, $options...) {
21
29
  @if inspection.get-theme-version($theme) == 1 {
22
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
30
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
23
31
  }
24
32
  @else {
25
33
  .mat-mdc-standard-chip {
@@ -47,6 +55,8 @@
47
55
  }
48
56
  }
49
57
 
58
+ /// Outputs typography theme styles for the mat-chips.
59
+ /// @param {Map} $theme The theme to generate typography styles for.
50
60
  @mixin typography($theme) {
51
61
  @if inspection.get-theme-version($theme) == 1 {
52
62
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -60,6 +70,8 @@
60
70
  }
61
71
  }
62
72
 
73
+ /// Outputs density theme styles for the mat-chips.
74
+ /// @param {Map} $theme The theme to generate density styles for.
63
75
  @mixin density($theme) {
64
76
  @if inspection.get-theme-version($theme) == 1 {
65
77
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -73,10 +85,15 @@
73
85
  }
74
86
  }
75
87
 
76
- @mixin theme($theme) {
88
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-chips.
89
+ /// @param {Map} $theme The theme to generate styles for.
90
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
91
+ /// $color-variant: The color variant to use for the selected chip: primary, secondary, tertiary,
92
+ /// or error (If not specified, default secondary color will be used).
93
+ @mixin theme($theme, $options...) {
77
94
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-chips') {
78
95
  @if inspection.get-theme-version($theme) == 1 {
79
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
96
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
80
97
  }
81
98
  @else {
82
99
  @include base($theme);
@@ -93,8 +110,7 @@
93
110
  }
94
111
  }
95
112
 
96
- @mixin _theme-from-tokens($tokens) {
97
- @if ($tokens != ()) {
98
- @include mdc-chip-theme.theme(map.get($tokens, tokens-mdc-chip.$prefix));
99
- }
113
+ @mixin _theme-from-tokens($tokens, $options...) {
114
+ $mdc-chip-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-chip.$prefix, $options...);
115
+ @include mdc-chip-theme.theme($mdc-chip-tokens);
100
116
  }
@@ -10,37 +10,51 @@
10
10
  @use './typography/typography';
11
11
  @use './tokens/token-utils';
12
12
  @use './tokens/m2/mat/app' as tokens-mat-app;
13
+ @use './tokens/m2/mat/ripple' as tokens-mat-ripple;
14
+ @use './tokens/m2/mat/option' as tokens-mat-option;
15
+ @use './tokens/m2/mat/full-pseudo-checkbox' as tokens-mat-full-pseudo-checkbox;
16
+ @use './tokens/m2/mat/minimal-pseudo-checkbox' as tokens-mat-minimal-pseudo-checkbox;
13
17
 
14
18
  @mixin base($theme) {
15
- @include ripple-theme.base($theme);
16
- @include option-theme.base($theme);
17
- @include optgroup-theme.base($theme);
18
- @include pseudo-checkbox-theme.base($theme);
19
- // TODO(mmalerba): Move additional core base tokens here
19
+ @if inspection.get-theme-version($theme) == 1 {
20
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
21
+ }
22
+ @else {
23
+ @include ripple-theme.base($theme);
24
+ @include option-theme.base($theme);
25
+ @include optgroup-theme.base($theme);
26
+ @include pseudo-checkbox-theme.base($theme);
27
+ }
20
28
  }
21
29
 
22
30
  @mixin color($theme) {
23
- @include ripple-theme.color($theme);
24
- @include option-theme.color($theme);
25
- @include optgroup-theme.color($theme);
26
- @include pseudo-checkbox-theme.color($theme);
27
- @include sass-utils.current-selector-or-root() {
28
- @include token-utils.create-token-values(tokens-mat-app.$prefix,
29
- tokens-mat-app.get-color-tokens($theme));
31
+ @if inspection.get-theme-version($theme) == 1 {
32
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
30
33
  }
34
+ @else {
35
+ @include ripple-theme.color($theme);
36
+ @include option-theme.color($theme);
37
+ @include optgroup-theme.color($theme);
38
+ @include pseudo-checkbox-theme.color($theme);
39
+ @include sass-utils.current-selector-or-root() {
40
+ @include token-utils.create-token-values(tokens-mat-app.$prefix,
41
+ tokens-mat-app.get-color-tokens($theme));
42
+ }
31
43
 
32
- // Provides external CSS classes for each elevation value. Each CSS class is formatted as
33
- // `mat-elevation-z$zValue` where `$zValue` corresponds to the z-space to which the element is
34
- // elevated.
35
- @for $zValue from 0 through 24 {
36
- $selector: elevation.$prefix + $zValue;
37
- // We need the `mat-mdc-elevation-specific`, because some MDC mixins
38
- // come with elevation baked in and we don't have a way of removing it.
39
- .#{$selector}, .mat-mdc-elevation-specific.#{$selector} {
40
- @include private.private-theme-elevation($zValue, $theme);
44
+ // Provides external CSS classes for each elevation value. Each CSS class is formatted as
45
+ // `mat-elevation-z$zValue` where `$zValue` corresponds to the z-space to which the element is
46
+ // elevated.
47
+ @for $zValue from 0 through 24 {
48
+ $selector: elevation.$prefix + $zValue;
49
+ // We need the `mat-mdc-elevation-specific`, because some MDC mixins
50
+ // come with elevation baked in and we don't have a way of removing it.
51
+ .#{$selector}, .mat-mdc-elevation-specific.#{$selector} {
52
+ @include private.private-theme-elevation($zValue, $theme);
53
+ }
41
54
  }
42
55
  }
43
56
 
57
+ // TODO(crisbeto): move this into the base.
44
58
  // Marker that is used to determine whether the user has added a theme to their page.
45
59
  @at-root {
46
60
  .mat-theme-loaded-marker {
@@ -50,34 +64,67 @@
50
64
  }
51
65
 
52
66
  @mixin typography($theme) {
53
- @include option-theme.typography($theme);
54
- @include optgroup-theme.typography($theme);
55
- @include pseudo-checkbox-theme.typography($theme);
56
- @include ripple-theme.typography($theme);
67
+ @if inspection.get-theme-version($theme) == 1 {
68
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
69
+ }
70
+ @else {
71
+ @include option-theme.typography($theme);
72
+ @include optgroup-theme.typography($theme);
73
+ @include pseudo-checkbox-theme.typography($theme);
74
+ @include ripple-theme.typography($theme);
75
+ }
57
76
  }
58
77
 
59
78
  @mixin density($theme) {
60
- @include option-theme.density($theme);
61
- @include optgroup-theme.density($theme);
62
- @include pseudo-checkbox-theme.density($theme);
63
- @include ripple-theme.density($theme);
79
+ @if inspection.get-theme-version($theme) == 1 {
80
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
81
+ }
82
+ @else {
83
+ @include option-theme.density($theme);
84
+ @include optgroup-theme.density($theme);
85
+ @include pseudo-checkbox-theme.density($theme);
86
+ @include ripple-theme.density($theme);
87
+ }
64
88
  }
65
89
 
66
90
  // Mixin that renders all of the core styles that depend on the theme.
67
- @mixin theme($theme) {
91
+ @mixin theme($theme, $options...) {
68
92
  // Wrap the sub-theme includes in the duplicate theme styles mixin. This ensures that
69
93
  // there won't be multiple warnings. e.g. if `mat-core-theme` reports a warning, then
70
94
  // the imported themes (such as `mat-ripple-theme`) should not report again.
71
95
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-core') {
72
- @include base($theme);
73
- @if inspection.theme-has($theme, color) {
74
- @include color($theme);
75
- }
76
- @if inspection.theme-has($theme, density) {
77
- @include density($theme);
96
+ @if inspection.get-theme-version($theme) == 1 {
97
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
78
98
  }
79
- @if inspection.theme-has($theme, typography) {
80
- @include typography($theme);
99
+ @else {
100
+ @include base($theme);
101
+ @if inspection.theme-has($theme, color) {
102
+ @include color($theme);
103
+ }
104
+ @if inspection.theme-has($theme, density) {
105
+ @include density($theme);
106
+ }
107
+ @if inspection.theme-has($theme, typography) {
108
+ @include typography($theme);
109
+ }
81
110
  }
82
111
  }
83
112
  }
113
+
114
+ @mixin _theme-from-tokens($tokens, $options...) {
115
+ $mat-app-tokens: token-utils.get-tokens-for($tokens, tokens-mat-app.$prefix, $options...);
116
+ $mat-ripple-tokens: token-utils.get-tokens-for($tokens, tokens-mat-ripple.$prefix, $options...);
117
+ $mat-option-tokens: token-utils.get-tokens-for($tokens, tokens-mat-option.$prefix, $options...);
118
+ $mat-full-pseudo-checkbox-tokens: token-utils.get-tokens-for($tokens,
119
+ tokens-mat-full-pseudo-checkbox.$prefix, $options...);
120
+ $mat-minimal-pseudo-checkbox-tokens: token-utils.get-tokens-for($tokens,
121
+ tokens-mat-minimal-pseudo-checkbox.$prefix, $options...);
122
+
123
+ @include token-utils.create-token-values(tokens-mat-app.$prefix, $mat-app-tokens);
124
+ @include token-utils.create-token-values(tokens-mat-ripple.$prefix, $mat-ripple-tokens);
125
+ @include token-utils.create-token-values(tokens-mat-option.$prefix, $mat-option-tokens);
126
+ @include token-utils.create-token-values(tokens-mat-full-pseudo-checkbox.$prefix,
127
+ $mat-full-pseudo-checkbox-tokens);
128
+ @include token-utils.create-token-values(tokens-mat-minimal-pseudo-checkbox.$prefix,
129
+ $mat-minimal-pseudo-checkbox-tokens);
130
+ }