@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
package/core/index.d.ts CHANGED
@@ -77,7 +77,7 @@ export declare interface CanUpdateErrorState {
77
77
  /** Whether the component is in an error state. */
78
78
  errorState: boolean;
79
79
  /** An object used to control the error state of the component. */
80
- errorStateMatcher: ErrorStateMatcher;
80
+ errorStateMatcher: ErrorStateMatcher_2;
81
81
  }
82
82
 
83
83
  declare type CanUpdateErrorStateCtor = _Constructor<CanUpdateErrorState> & _AbstractConstructor<CanUpdateErrorState>;
@@ -314,6 +314,9 @@ export declare class ErrorStateMatcher {
314
314
  static ɵprov: i0.ɵɵInjectableDeclaration<ErrorStateMatcher>;
315
315
  }
316
316
 
317
+ declare interface ErrorStateMatcher_2 extends ErrorStateMatcher {
318
+ }
319
+
317
320
  /**
318
321
  * Class that tracks the error state of a component.
319
322
  * @docs-private
@@ -327,8 +330,8 @@ export declare class _ErrorStateTracker {
327
330
  /** Whether the tracker is currently in an error state. */
328
331
  errorState: boolean;
329
332
  /** User-defined matcher for the error state. */
330
- matcher: ErrorStateMatcher;
331
- constructor(_defaultMatcher: ErrorStateMatcher | null, ngControl: NgControl | null, _parentFormGroup: FormGroupDirective | null, _parentForm: NgForm | null, _stateChanges: Subject<void>);
333
+ matcher: ErrorStateMatcher_2;
334
+ constructor(_defaultMatcher: ErrorStateMatcher_2 | null, ngControl: NgControl | null, _parentFormGroup: FormGroupDirective | null, _parentForm: NgForm | null, _stateChanges: Subject<void>);
332
335
  /** Updates the error state based on the provided error state matcher. */
333
336
  updateErrorState(): void;
334
337
  }
@@ -359,7 +362,7 @@ declare interface HasElementRef {
359
362
  declare interface HasErrorState {
360
363
  _parentFormGroup: FormGroupDirective;
361
364
  _parentForm: NgForm;
362
- _defaultErrorStateMatcher: ErrorStateMatcher;
365
+ _defaultErrorStateMatcher: ErrorStateMatcher_2;
363
366
  ngControl: NgControl;
364
367
  stateChanges: Subject<void>;
365
368
  }
@@ -5,7 +5,6 @@
5
5
  @use '@material/typography' as mdc-typography;
6
6
  @use '@material/theme/theme-color' as mdc-theme-color;
7
7
  @use '@material/theme/css' as mdc-theme-css;
8
- @use 'sass:meta';
9
8
 
10
9
  // A set of standard queries to use with MDC's queryable mixins.
11
10
  $mdc-base-styles-query: mdc-feature-targeting.without(mdc-feature-targeting.any(color, typography));
@@ -59,10 +58,3 @@ $mdc-typography-styles-query: typography;
59
58
  @content;
60
59
  mdc-theme-css.$enable-fallback-declarations: $previous-value;
61
60
  }
62
-
63
- // Excludes the passed-in CSS content if the layout is too dense to supports touch targets.
64
- @mixin if-touch-targets-unsupported($scale) {
65
- @if ($scale == 'minimum' or (meta.type-of($scale) == 'number' and $scale < -1)) {
66
- @content;
67
- }
68
- }
@@ -1,4 +1,3 @@
1
- @use 'sass:map';
2
1
  @use '../tokens/m2/mat/option' as tokens-mat-option;
3
2
  @use '../tokens/token-utils';
4
3
  @use '../style/sass-utils';
@@ -6,6 +5,9 @@
6
5
  @use '../theming/inspection';
7
6
  @use '../typography/typography';
8
7
 
8
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
9
+ /// for the mat-option.
10
+ /// @param {Map} $theme The theme to generate base styles for.
9
11
  @mixin base($theme) {
10
12
  @if inspection.get-theme-version($theme) == 1 {
11
13
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -13,9 +15,14 @@
13
15
  @else {}
14
16
  }
15
17
 
16
- @mixin color($theme) {
18
+ /// Outputs color theme styles for the mat-option.
19
+ /// @param {Map} $theme The theme to generate color styles for.
20
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
21
+ /// $color-variant: The color variant to use for the selected option: primary, secondary,
22
+ /// tertiary, or error (If not specified, default secondary color will be used).
23
+ @mixin color($theme, $options...) {
17
24
  @if inspection.get-theme-version($theme) == 1 {
18
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
25
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
19
26
  }
20
27
  @else {
21
28
  @include sass-utils.current-selector-or-root() {
@@ -35,6 +42,8 @@
35
42
  }
36
43
  }
37
44
 
45
+ /// Outputs typography theme styles for the mat-option.
46
+ /// @param {Map} $theme The theme to generate typography styles for.
38
47
  @mixin typography($theme) {
39
48
  @if inspection.get-theme-version($theme) == 1 {
40
49
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -47,6 +56,8 @@
47
56
  }
48
57
  }
49
58
 
59
+ /// Outputs density theme styles for the mat-option.
60
+ /// @param {Map} $theme The theme to generate density styles for.
50
61
  @mixin density($theme) {
51
62
  @if inspection.get-theme-version($theme) == 1 {
52
63
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -54,10 +65,15 @@
54
65
  @else {}
55
66
  }
56
67
 
57
- @mixin theme($theme) {
68
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-option.
69
+ /// @param {Map} $theme The theme to generate styles for.
70
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
71
+ /// $color-variant: The color variant to use for the selected option: primary, secondary,
72
+ /// tertiary, or error (If not specified, default secondary color will be used).
73
+ @mixin theme($theme, $options...) {
58
74
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-option') {
59
75
  @if inspection.get-theme-version($theme) == 1 {
60
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
76
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
61
77
  }
62
78
  @else {
63
79
  @include base($theme);
@@ -74,9 +90,7 @@
74
90
  }
75
91
  }
76
92
 
77
- @mixin _theme-from-tokens($tokens) {
78
- @if ($tokens != ()) {
79
- @include token-utils.create-token-values(
80
- tokens-mat-option.$prefix, map.get($tokens, tokens-mat-option.$prefix));
81
- }
93
+ @mixin _theme-from-tokens($tokens, $options...) {
94
+ $mat-option-tokens: token-utils.get-tokens-for($tokens, tokens-mat-option.$prefix, $options...);
95
+ @include token-utils.create-token-values(tokens-mat-option.$prefix, $mat-option-tokens);
82
96
  }
@@ -14,43 +14,83 @@
14
14
  }
15
15
  }
16
16
 
17
+ @mixin _theme-from-tokens($tokens, $options...) {
18
+ $mat-full-pseudo-checkbox-tokens:
19
+ token-utils.get-tokens-for($tokens, tokens-mat-full-pseudo-checkbox.$prefix, $options...);
20
+ $mat-minimal-pseudo-checkbox-tokens:
21
+ token-utils.get-tokens-for($tokens, tokens-mat-minimal-pseudo-checkbox.$prefix, $options...);
22
+ @include token-utils.create-token-values(
23
+ tokens-mat-full-pseudo-checkbox.$prefix, $mat-full-pseudo-checkbox-tokens);
24
+ @include token-utils.create-token-values(
25
+ tokens-mat-minimal-pseudo-checkbox.$prefix, $mat-minimal-pseudo-checkbox-tokens);
26
+ }
27
+
28
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
29
+ /// for the mat-pseudo-checkbox.
30
+ /// @param {Map} $theme The theme to generate base styles for.
17
31
  @mixin base($theme) {}
18
32
 
19
- @mixin color($theme) {
20
- .mat-primary {
21
- @include _palette-styles($theme, primary);
33
+ /// Outputs color theme styles for the mat-pseudo-checkbox.
34
+ /// @param {Map} $theme The theme to generate color styles for.
35
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
36
+ /// $color-variant: The color variant to use for the pseudo-checkbox: primary, secondary,
37
+ /// tertiary, or error (If not specified, default primary color will be used).
38
+ @mixin color($theme, $options...) {
39
+ @if inspection.get-theme-version($theme) == 1 {
40
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
22
41
  }
42
+ @else {
43
+ .mat-primary {
44
+ @include _palette-styles($theme, primary);
45
+ }
23
46
 
24
- // Default to the accent color. Note that the pseudo checkboxes are meant to inherit the
25
- // theme from their parent, rather than implementing their own theming, which is why we
26
- // don't attach to the `mat-*` classes. Also note that this needs to be below `.mat-primary`
27
- // in order to allow for the color to be overwritten if the checkbox is inside a parent that
28
- // has `mat-accent` and is placed inside another parent that has `mat-primary`.
29
- @include _palette-styles($theme, accent);
30
- .mat-accent {
47
+ // Default to the accent color. Note that the pseudo checkboxes are meant to inherit the
48
+ // theme from their parent, rather than implementing their own theming, which is why we
49
+ // don't attach to the `mat-*` classes. Also note that this needs to be below `.mat-primary`
50
+ // in order to allow for the color to be overwritten if the checkbox is inside a parent that
51
+ // has `mat-accent` and is placed inside another parent that has `mat-primary`.
31
52
  @include _palette-styles($theme, accent);
32
- }
53
+ .mat-accent {
54
+ @include _palette-styles($theme, accent);
55
+ }
33
56
 
34
- .mat-warn {
35
- @include _palette-styles($theme, warn);
57
+ .mat-warn {
58
+ @include _palette-styles($theme, warn);
59
+ }
36
60
  }
37
61
  }
38
62
 
39
- @mixin typography($theme) {}
63
+ /// Outputs typography theme styles for the mat-pseudo-checkbox.
64
+ /// @param {Map} $theme The theme to generate typography styles for.
65
+ @mixin typography($theme) {
66
+ }
40
67
 
41
- @mixin density($theme) {}
68
+ /// Outputs density theme styles for the mat-pseudo-checkbox.
69
+ /// @param {Map} $theme The theme to generate density styles for.
70
+ @mixin density($theme) {
71
+ }
42
72
 
43
- @mixin theme($theme) {
73
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-pseudo-checkbox.
74
+ /// @param {Map} $theme The theme to generate styles for.
75
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
76
+ /// $color-variant: The color variant to use for the pseudo-checkbox: primary, secondary,
77
+ /// tertiary, or error (If not specified, default primary color will be used).
78
+ @mixin theme($theme, $options...) {
44
79
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-pseudo-checkbox') {
45
- @include base($theme);
46
- @if inspection.theme-has($theme, color) {
47
- @include color($theme);
48
- }
49
- @if inspection.theme-has($theme, density) {
50
- @include density($theme);
80
+ @if inspection.get-theme-version($theme) == 1 {
81
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
51
82
  }
52
- @if inspection.theme-has($theme, typography) {
53
- @include typography($theme);
83
+ @else {
84
+ @include base($theme);
85
+ @if inspection.theme-has($theme, color) {
86
+ @include color($theme);
87
+ }
88
+ @if inspection.theme-has($theme, density) {
89
+ @include density($theme);
90
+ }
91
+ @if inspection.theme-has($theme, typography) {
92
+ @include typography($theme);
93
+ }
54
94
  }
55
95
  }
56
96
  }
@@ -110,6 +110,28 @@ $_component-prefix: null;
110
110
  @return mdc-custom-properties.create-varname('#{$_component-prefix}-#{$token}');
111
111
  }
112
112
 
113
+ // TODO(crisbeto): should be able to replace the usages of `get-token-variable` with this.
114
+ // Returns a `var()` reference to a specific token. Intended for declarations
115
+ // where the token has to be referenced as a part of a larger expression.
116
+ @function get-token-variable-reference($token, $emit-fallback: false) {
117
+ @if $_component-prefix == null or $_tokens == null {
118
+ @error '`get-token-variable-reference` must be used within `use-tokens`';
119
+ }
120
+ @if not map.has-key($_tokens, $token) {
121
+ @error 'Token #{$token} does not exist. Configured tokens are: #{map.keys($_tokens)}';
122
+ }
123
+
124
+ $var: get-token-variable($token);
125
+ $fallback: if($emit-fallback, map.get($_tokens, $token), null);
126
+
127
+ @if ($fallback != null) {
128
+ @return var($var, $fallback);
129
+ }
130
+ @else {
131
+ @return var($var);
132
+ }
133
+ }
134
+
113
135
  @mixin create-token-values($prefix, $tokens) {
114
136
  @include _configure-token-prefix($prefix...) {
115
137
  @include mdc-keys.declare-custom-properties($tokens, $_component-prefix);
@@ -1,18 +1,21 @@
1
1
  @use 'sass:map';
2
2
  @use 'sass:meta';
3
3
  @use '../../style/sass-utils';
4
+ @use './mat/app' as tokens-mat-app;
4
5
  @use './mat/autocomplete' as tokens-mat-autocomplete;
5
6
  @use './mat/badge' as tokens-mat-badge;
6
7
  @use './mat/text-button' as tokens-mat-text-button;
7
8
  @use './mat/protected-button' as tokens-mat-protected-button;
8
9
  @use './mat/filled-button' as tokens-mat-filled-button;
9
10
  @use './mat/outlined-button' as tokens-mat-outlined-button;
11
+ @use './mat/dialog' as tokens-mat-dialog;
10
12
  @use './mat/bottom-sheet' as tokens-mat-bottom-sheet;
11
13
  @use './mat/card' as tokens-mat-card;
12
14
  @use './mat/datepicker' as tokens-mat-datepicker;
13
15
  @use './mat/divider' as tokens-mat-divider;
14
16
  @use './mat/expansion' as tokens-mat-expansion;
15
17
  @use './mat/fab' as tokens-mat-fab;
18
+ @use './mat/fab-small' as tokens-mat-fab-small;
16
19
  @use './mat/form-field' as tokens-mat-form-field;
17
20
  @use './mat/grid-list' as tokens-mat-grid-list;
18
21
  @use './mat/icon' as tokens-mat-icon;
@@ -21,6 +24,9 @@
21
24
  @use './mat/option' as tokens-mat-option;
22
25
  @use './mat/optgroup' as tokens-mat-optgroup;
23
26
  @use './mat/paginator' as tokens-mat-paginator;
27
+ @use './mat/checkbox' as tokens-mat-checkbox;
28
+ @use './mat/full-pseudo-checkbox' as tokens-mat-full-pseudo-checkbox;
29
+ @use './mat/minimal-pseudo-checkbox' as tokens-mat-minimal-pseudo-checkbox;
24
30
  @use './mat/radio' as tokens-mat-radio;
25
31
  @use './mat/ripple' as tokens-mat-ripple;
26
32
  @use './mat/select' as tokens-mat-select;
@@ -46,6 +52,8 @@
46
52
  @use './mdc/elevated-card' as tokens-mdc-elevated-card;
47
53
  @use './mdc/extended-fab' as tokens-mdc-extended-fab;
48
54
  @use './mdc/fab' as tokens-mdc-fab;
55
+ @use './mdc/fab-small' as tokens-mdc-fab-small;
56
+ @use './mdc/form-field' as tokens-mdc-form-field;
49
57
  @use './mdc/filled-text-field' as tokens-mdc-filled-text-field;
50
58
  @use './mdc/icon-button' as tokens-mdc-icon-button;
51
59
  @use './mdc/linear-progress' as tokens-mdc-linear-progress;
@@ -103,15 +111,18 @@
103
111
  /// )
104
112
  @function m2-tokens-from-theme($theme) {
105
113
  @return sass-utils.deep-merge-all(
114
+ _get-tokens-for-module($theme, tokens-mat-app),
106
115
  _get-tokens-for-module($theme, tokens-mat-autocomplete),
107
116
  _get-tokens-for-module($theme, tokens-mat-badge),
108
117
  _get-tokens-for-module($theme, tokens-mat-bottom-sheet),
109
118
  _get-tokens-for-module($theme, tokens-mat-button-toggle),
110
119
  _get-tokens-for-module($theme, tokens-mat-card),
111
120
  _get-tokens-for-module($theme, tokens-mat-datepicker),
121
+ _get-tokens-for-module($theme, tokens-mat-dialog),
112
122
  _get-tokens-for-module($theme, tokens-mat-divider),
113
123
  _get-tokens-for-module($theme, tokens-mat-expansion),
114
124
  _get-tokens-for-module($theme, tokens-mat-fab),
125
+ _get-tokens-for-module($theme, tokens-mat-fab-small),
115
126
  _get-tokens-for-module($theme, tokens-mat-filled-button),
116
127
  _get-tokens-for-module($theme, tokens-mat-form-field),
117
128
  _get-tokens-for-module($theme, tokens-mat-grid-list),
@@ -122,6 +133,9 @@
122
133
  _get-tokens-for-module($theme, tokens-mat-option),
123
134
  _get-tokens-for-module($theme, tokens-mat-outlined-button),
124
135
  _get-tokens-for-module($theme, tokens-mat-paginator),
136
+ _get-tokens-for-module($theme, tokens-mat-checkbox),
137
+ _get-tokens-for-module($theme, tokens-mat-full-pseudo-checkbox),
138
+ _get-tokens-for-module($theme, tokens-mat-minimal-pseudo-checkbox),
125
139
  _get-tokens-for-module($theme, tokens-mat-protected-button),
126
140
  _get-tokens-for-module($theme, tokens-mat-radio),
127
141
  _get-tokens-for-module($theme, tokens-mat-ripple),
@@ -144,8 +158,10 @@
144
158
  _get-tokens-for-module($theme, tokens-mdc-elevated-card),
145
159
  _get-tokens-for-module($theme, tokens-mdc-extended-fab),
146
160
  _get-tokens-for-module($theme, tokens-mdc-fab),
161
+ _get-tokens-for-module($theme, tokens-mdc-fab-small),
147
162
  _get-tokens-for-module($theme, tokens-mdc-filled-button),
148
163
  _get-tokens-for-module($theme, tokens-mdc-filled-text-field),
164
+ _get-tokens-for-module($theme, tokens-mdc-form-field),
149
165
  _get-tokens-for-module($theme, tokens-mdc-icon-button),
150
166
  _get-tokens-for-module($theme, tokens-mdc-linear-progress),
151
167
  _get-tokens-for-module($theme, tokens-mdc-list),
@@ -1,5 +1,6 @@
1
1
  @use 'sass:meta';
2
2
  @use 'sass:map';
3
+ @use 'sass:math';
3
4
  @use 'sass:color';
4
5
  @use '../../token-utils';
5
6
  @use '../../../theming/inspection';
@@ -11,7 +12,32 @@ $prefix: (mat, badge);
11
12
  // Tokens that can't be configured through Angular Material's current theming API,
12
13
  // but may be in a future version of the theming API.
13
14
  @function get-unthemable-tokens() {
14
- @return ();
15
+ $default-size: 22px;
16
+ $small-size: $default-size - 6;
17
+ $large-size: $default-size + 6;
18
+
19
+ @return (
20
+ container-shape: 50%,
21
+ container-size: unset,
22
+ small-size-container-size: unset,
23
+ large-size-container-size: unset,
24
+
25
+ legacy-container-size: $default-size,
26
+ legacy-small-size-container-size: $small-size,
27
+ legacy-large-size-container-size: $large-size,
28
+
29
+ container-offset: math.div($default-size, -2) 0,
30
+ small-size-container-offset: math.div($small-size, -2) 0,
31
+ large-size-container-offset: math.div($large-size, -2) 0,
32
+
33
+ container-overlap-offset: math.div($default-size, -2),
34
+ small-size-container-overlap-offset: math.div($small-size, -2),
35
+ large-size-container-overlap-offset: math.div($large-size, -2),
36
+
37
+ container-padding: 0,
38
+ small-size-container-padding: 0,
39
+ large-size-container-padding: 0,
40
+ );
15
41
  }
16
42
 
17
43
  // Tokens that can be configured through Angular Material's color theming API.
@@ -0,0 +1,45 @@
1
+ @use '../../token-utils';
2
+ @use '../../../theming/theming';
3
+ @use '../../../theming/inspection';
4
+ @use '../../../style/sass-utils';
5
+
6
+ // The prefix used to generate the fully qualified name for tokens in this file.
7
+ $prefix: (mat, checkbox);
8
+
9
+ // Tokens that can't be configured through Angular Material's current theming API,
10
+ // but may be in a future version of the theming API.
11
+ @function get-unthemable-tokens() {
12
+ @return ();
13
+ }
14
+
15
+ // Tokens that can be configured through Angular Material's color theming API.
16
+ @function get-color-tokens($theme) {
17
+ @return (
18
+ disabled-label-color: inspection.get-theme-color($theme, foreground, disabled-text),
19
+ );
20
+ }
21
+
22
+ // Tokens that can be configured through Angular Material's typography theming API.
23
+ @function get-typography-tokens($theme) {
24
+ @return ();
25
+ }
26
+
27
+ // Tokens that can be configured through Angular Material's density theming API.
28
+ @function get-density-tokens($theme) {
29
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
30
+
31
+ @return (
32
+ touch-target-display: if($density-scale < -1, none, block),
33
+ );
34
+ }
35
+
36
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
37
+ // This is used to create token slots.
38
+ @function get-token-slots() {
39
+ @return sass-utils.deep-merge-all(
40
+ get-unthemable-tokens(),
41
+ get-color-tokens(token-utils.$placeholder-color-config),
42
+ get-typography-tokens(token-utils.$placeholder-typography-config),
43
+ get-density-tokens(token-utils.$placeholder-density-config)
44
+ );
45
+ }
@@ -0,0 +1,49 @@
1
+ @use '../../token-utils';
2
+ @use '../../../style/sass-utils';
3
+
4
+ // The prefix used to generate the fully qualified name for tokens in this file.
5
+ $prefix: (mat, dialog);
6
+
7
+ // Tokens that can't be configured through Angular Material's current theming API,
8
+ // but may be in a future version of the theming API.
9
+ @function get-unthemable-tokens() {
10
+ @return (
11
+ container-max-width: 80vw,
12
+ container-small-max-width: 80vw,
13
+ container-min-width: 0,
14
+ actions-alignment: start,
15
+ actions-padding: 8px,
16
+ content-padding: 20px 24px,
17
+ with-actions-content-padding: 20px 24px,
18
+
19
+ // Note: the CSS class is `title` while the M2 tokens call it `subhead`.
20
+ // M3 calls it `headline` which is what we're aligning with.
21
+ headline-padding: 0 24px 9px,
22
+ );
23
+ }
24
+
25
+ // Tokens that can be configured through Angular Material's color theming API.
26
+ @function get-color-tokens($theme) {
27
+ @return ();
28
+ }
29
+
30
+ // Tokens that can be configured through Angular Material's typography theming API.
31
+ @function get-typography-tokens($theme) {
32
+ @return ();
33
+ }
34
+
35
+ // Tokens that can be configured through Angular Material's density theming API.
36
+ @function get-density-tokens($theme) {
37
+ @return ();
38
+ }
39
+
40
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
41
+ // This is used to create token slots.
42
+ @function get-token-slots() {
43
+ @return sass-utils.deep-merge-all(
44
+ get-unthemable-tokens(),
45
+ get-color-tokens(token-utils.$placeholder-color-config),
46
+ get-typography-tokens(token-utils.$placeholder-typography-config),
47
+ get-density-tokens(token-utils.$placeholder-density-config)
48
+ );
49
+ }
@@ -0,0 +1,95 @@
1
+ @use 'sass:map';
2
+ @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
3
+ @use '../../token-utils';
4
+ @use '../../../theming/theming';
5
+ @use '../../../theming/inspection';
6
+ @use '../../../style/sass-utils';
7
+ @use '../../../mdc-helpers/mdc-helpers';
8
+
9
+ // The prefix used to generate the fully qualified name for tokens in this file.
10
+ $prefix: (mat, fab-small);
11
+
12
+ // Tokens that can't be configured through Angular Material's current theming API,
13
+ // but may be in a future version of the theming API.
14
+ @function get-unthemable-tokens() {
15
+ @return ();
16
+ }
17
+
18
+ // Tokens that can be configured through Angular Material's color theming API.
19
+ @function get-color-tokens($theme) {
20
+ $is-dark: inspection.get-theme-type($theme) == dark;
21
+ $on-surface: if($is-dark, #fff, #000);
22
+ $ripple-opacities: if($is-dark,
23
+ mdc-ripple-theme.$light-ink-opacities,
24
+ mdc-ripple-theme.$dark-ink-opacities
25
+ );
26
+
27
+ @return (
28
+ // Color of icons and text projected into a FAB.
29
+ foreground-color: inspection.get-theme-color($theme, foreground, base),
30
+
31
+ // Color of the element that shows the hover, focus and pressed states.
32
+ state-layer-color: $on-surface,
33
+
34
+ // Color of the element that shows the hover, focus and pressed states while disabled.
35
+ disabled-state-layer-color: $on-surface,
36
+
37
+ // Color of the ripple element.
38
+ ripple-color: rgba($on-surface, 0.1),
39
+
40
+ // Opacity of the ripple when the button is hovered.
41
+ hover-state-layer-opacity: map.get($ripple-opacities, hover),
42
+
43
+ // Opacity of the ripple when the button is focused.
44
+ focus-state-layer-opacity: map.get($ripple-opacities, focus),
45
+
46
+ // Opacity of the ripple when the button is pressed.
47
+ pressed-state-layer-opacity: map.get($ripple-opacities, press),
48
+
49
+ // MDC doesn't have tokens for disabled FABs so we need to implemented them ourselves.
50
+ // Background color of the container when the FAB is disabled.
51
+ disabled-state-container-color: rgba($on-surface, 0.12),
52
+
53
+ // Color of the icons and projected text when the FAB is disabled.
54
+ disabled-state-foreground-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
55
+ );
56
+ }
57
+
58
+ // Generates the mapping for the properties that change based on the FAB palette color.
59
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
60
+ $is-dark: inspection.get-theme-type($theme) == dark;
61
+ $container-color: inspection.get-theme-color($theme, $palette-name);
62
+ $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
63
+ $color: if($contrast-tone == 'dark', #000, #fff);
64
+
65
+ @return (
66
+ foreground-color: $color,
67
+ state-layer-color: $color,
68
+ ripple-color: rgba($color, 0.1),
69
+ );
70
+ }
71
+
72
+ // Tokens that can be configured through Angular Material's typography theming API.
73
+ @function get-typography-tokens($theme) {
74
+ @return ();
75
+ }
76
+
77
+ // Tokens that can be configured through Angular Material's density theming API.
78
+ @function get-density-tokens($theme) {
79
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
80
+
81
+ @return (
82
+ touch-target-display: if($density-scale < -1, none, block),
83
+ );
84
+ }
85
+
86
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
87
+ // This is used to create token slots.
88
+ @function get-token-slots() {
89
+ @return sass-utils.deep-merge-all(
90
+ get-unthemable-tokens(),
91
+ get-color-tokens(token-utils.$placeholder-color-config),
92
+ get-typography-tokens(token-utils.$placeholder-typography-config),
93
+ get-density-tokens(token-utils.$placeholder-density-config)
94
+ );
95
+ }
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
3
3
  @use '../../token-utils';
4
+ @use '../../../theming/theming';
4
5
  @use '../../../theming/inspection';
5
6
  @use '../../../style/sass-utils';
6
7
  @use '../../../mdc-helpers/mdc-helpers';
@@ -75,7 +76,11 @@ $prefix: (mat, fab);
75
76
 
76
77
  // Tokens that can be configured through Angular Material's density theming API.
77
78
  @function get-density-tokens($theme) {
78
- @return ();
79
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
80
+
81
+ @return (
82
+ touch-target-display: if($density-scale < -1, none, block),
83
+ );
79
84
  }
80
85
 
81
86
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
3
3
  @use '../../token-utils';
4
+ @use '../../../theming/theming';
4
5
  @use '../../../theming/inspection';
5
6
  @use '../../../style/sass-utils';
6
7
  @use '../../../mdc-helpers/mdc-helpers';
@@ -11,7 +12,17 @@ $prefix: (mat, filled-button);
11
12
  // Tokens that can't be configured through Angular Material's current theming API,
12
13
  // but may be in a future version of the theming API.
13
14
  @function get-unthemable-tokens() {
14
- @return ();
15
+ @return (
16
+ // Start/end padding of the button.
17
+ horizontal-padding: 16px,
18
+
19
+ // Space between the icon and the button's main content.
20
+ icon-spacing: 8px,
21
+
22
+ // Amount by which to offset the icon so that its presence
23
+ // doesn't increase throw off the horizontal padding.
24
+ icon-offset: -4px,
25
+ );
15
26
  }
16
27
 
17
28
  // Tokens that can be configured through Angular Material's color theming API.
@@ -64,7 +75,11 @@ $prefix: (mat, filled-button);
64
75
 
65
76
  // Tokens that can be configured through Angular Material's density theming API.
66
77
  @function get-density-tokens($theme) {
67
- @return ();
78
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
79
+
80
+ @return (
81
+ touch-target-display: if($density-scale < -1, none, block),
82
+ );
68
83
  }
69
84
 
70
85
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -39,6 +39,21 @@ $prefix: (mat, form-field);
39
39
  // https://developer.mozilla.org/en-US/docs/Web/CSS/system-color
40
40
  select-disabled-option-text-color: if($is-dark, palette.$dark-disabled-text, GrayText),
41
41
 
42
+ // These tokens are necessary for M3. MDC has them built in already, but:
43
+ // 1. They are too specific, breaking a lot of internal clients.
44
+ // 2. The larger selectors result in a larger bundle.
45
+ // Note: MDC has tokens for all the various states of the icons. Some of them are ommitted,
46
+ // because they resolve to the same value (e.g. focus and base states for the leading icon
47
+ // are the same).
48
+ leading-icon-color: unset,
49
+ disabled-leading-icon-color: unset,
50
+
51
+ trailing-icon-color: unset,
52
+ disabled-trailing-icon-color: unset,
53
+ error-focus-trailing-icon-color: unset,
54
+ error-hover-trailing-icon-color: unset,
55
+ error-trailing-icon-color: unset,
56
+
42
57
  // These values are taken from the MDC select implementation:
43
58
  // https://github.com/material-components/material-components-web/blob/master/packages/mdc-select/_select-theme.scss
44
59
  enabled-select-arrow-color: rgba($on-surface, 0.54),