@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/_index.scss CHANGED
@@ -60,7 +60,8 @@
60
60
  @forward './core/option/optgroup-theme' as optgroup-* show optgroup-color, optgroup-typography,
61
61
  optgroup-theme, optgroup-density, optgroup-base;
62
62
  @forward './core/selection/pseudo-checkbox/pseudo-checkbox-theme' as pseudo-checkbox-* show
63
- pseudo-checkbox-color, pseudo-checkbox-typography, pseudo-checkbox-theme, pseudo-checkbox-base;
63
+ pseudo-checkbox-color, pseudo-checkbox-typography, pseudo-checkbox-theme, pseudo-checkbox-density,
64
+ pseudo-checkbox-base;
64
65
  @forward './core/selection/pseudo-checkbox/pseudo-checkbox-common' as pseudo-checkbox-* show
65
66
  pseudo-checkbox-legacy-size;
66
67
  @forward './core/focus-indicators/focus-indicators-theme' as strong-focus-indicators-* show
@@ -145,9 +146,8 @@
145
146
  // MDC Helpers
146
147
  @forward './core/mdc-helpers/mdc-helpers' as private-* show
147
148
  private-disable-mdc-fallback-declarations, private-typography-config-level-from-mdc,
148
- private-if-touch-targets-unsupported, $private-mdc-base-styles-query,
149
- $private-mdc-base-styles-without-animation-query, $private-mdc-theme-styles-query,
150
- $private-mdc-typography-styles-query;
149
+ $private-mdc-base-styles-query, $private-mdc-base-styles-without-animation-query,
150
+ $private-mdc-theme-styles-query, $private-mdc-typography-styles-query;
151
151
 
152
152
  // New theming APIs:
153
153
  @forward './core/theming/inspection' show get-theme-version, get-theme-type, get-theme-color,
@@ -1,7 +1,4 @@
1
1
  @use 'sass:color';
2
- @use 'sass:map';
3
- @use 'sass:math';
4
- @use '@angular/cdk';
5
2
  @use '../core/theming/theming';
6
3
  @use '../core/theming/inspection';
7
4
  @use '../core/typography/typography';
@@ -9,171 +6,29 @@
9
6
  @use '../core/tokens/token-utils';
10
7
  @use '../core/style/sass-utils';
11
8
 
12
- // TODO(crisbeto): some of these variables aren't used anymore and should be deleted.
13
- $font-size: 12px;
14
- $font-weight: 600;
15
- $default-size: 22px !default;
16
- $small-size: $default-size - 6;
17
- $large-size: $default-size + 6;
18
- $_badge-structure-emitted: false !default;
19
-
20
- // Internally there are some builds that throw an error if they can't figure out the values
21
- // of CSS variables during compliation. This flag temporarily enables fallbacks for these builds.
22
- // Eventually we should clean them up.
23
- $_emit-fallback-vars: true;
24
-
25
- // Mixin for building offset given different sizes
26
- @mixin _badge-size($size, $font-size-token) {
27
- // This mixin isn't used in the context of a theme so we can disable the ampersand check.
28
- // stylelint-disable material/no-ampersand-beyond-selector-start
29
- .mat-badge-content {
30
- width: $size;
31
- height: $size;
32
- line-height: $size;
33
-
34
- @if ($font-size-token) {
35
- @include token-utils.use-tokens(tokens-mat-badge.$prefix,
36
- tokens-mat-badge.get-token-slots()) {
37
- @include token-utils.create-token-slot(font-size, $font-size-token, $_emit-fallback-vars);
38
- }
39
- }
40
- }
41
-
42
- &.mat-badge-above .mat-badge-content {
43
- top: math.div(-$size, 2);
44
- }
45
-
46
- &.mat-badge-below .mat-badge-content {
47
- bottom: math.div(-$size, 2);
48
- }
49
-
50
- &.mat-badge-before .mat-badge-content {
51
- left: -$size;
52
- }
53
-
54
- [dir='rtl'] &.mat-badge-before .mat-badge-content {
55
- left: auto;
56
- right: -$size;
57
- }
58
-
59
- &.mat-badge-after .mat-badge-content {
60
- right: -$size;
61
- }
62
-
63
- [dir='rtl'] &.mat-badge-after .mat-badge-content {
64
- right: auto;
65
- left: -$size;
66
- }
67
-
68
- &.mat-badge-overlap {
69
- &.mat-badge-before .mat-badge-content {
70
- left: math.div(-$size, 2);
71
- }
72
-
73
- [dir='rtl'] &.mat-badge-before .mat-badge-content {
74
- left: auto;
75
- right: math.div(-$size, 2);
76
- }
77
-
78
- &.mat-badge-after .mat-badge-content {
79
- right: math.div(-$size, 2);
80
- }
81
-
82
- [dir='rtl'] &.mat-badge-after .mat-badge-content {
83
- right: auto;
84
- left: math.div(-$size, 2);
85
- }
86
- }
87
- // stylelint-enable
88
- }
89
-
90
- // Structural styles for the badge. They have to be included as a part of the theme,
91
- // because the badge is a directive and we have no other way of attaching styles to it.
92
- @mixin _badge-structure {
93
- .mat-badge {
94
- position: relative;
95
-
96
- // The badge should make sure its host is overflow visible so that the badge content
97
- // can be rendered outside of the element. Some components such as <mat-icon> explicitly
98
- // style `overflow: hidden` so this requires extra specificity so that it does not
99
- // depend on style load order.
100
- &.mat-badge {
101
- overflow: visible;
102
- }
103
- }
104
-
105
- .mat-badge-content {
106
- position: absolute;
107
- text-align: center;
108
- display: inline-block;
109
- border-radius: 50%;
110
- transition: transform 200ms ease-in-out;
111
- transform: scale(0.6);
112
- overflow: hidden;
113
- white-space: nowrap;
114
- text-overflow: ellipsis;
115
- pointer-events: none;
116
-
117
- @include token-utils.use-tokens(tokens-mat-badge.$prefix, tokens-mat-badge.get-token-slots()) {
118
- @include token-utils.create-token-slot(background-color, background-color);
119
- @include token-utils.create-token-slot(color, text-color);
120
- @include token-utils.create-token-slot(font-family, text-font, $_emit-fallback-vars);
121
- @include token-utils.create-token-slot(font-size, text-size, $_emit-fallback-vars);
122
- @include token-utils.create-token-slot(font-weight, text-weight, $_emit-fallback-vars);
123
- }
124
-
125
- @include cdk.high-contrast(active, off) {
126
- outline: solid 1px;
127
- border-radius: 0;
128
- }
129
- }
130
-
131
- .mat-badge-disabled .mat-badge-content {
132
- @include token-utils.use-tokens(tokens-mat-badge.$prefix, tokens-mat-badge.get-token-slots()) {
133
- @include token-utils.create-token-slot(background-color, disabled-state-background-color);
134
- @include token-utils.create-token-slot(color, disabled-state-text-color);
135
- }
136
- }
137
-
138
- .mat-badge-hidden .mat-badge-content {
139
- display: none;
140
- }
141
-
142
- .ng-animate-disabled .mat-badge-content,
143
- .mat-badge-content._mat-animation-noopable {
144
- transition: none;
145
- }
146
-
147
- // The active class is added after the element is added
148
- // so it can animate scale to default
149
- .mat-badge-content.mat-badge-active {
150
- // Scale to `none` instead of `1` to avoid blurry text in some browsers.
151
- transform: none;
152
- }
153
-
154
- .mat-badge-small {
155
- @include _badge-size($small-size, small-size-text-size);
156
- }
157
-
158
- .mat-badge-medium {
159
- @include _badge-size($default-size, null);
160
- }
161
-
162
- .mat-badge-large {
163
- @include _badge-size($large-size, large-size-text-size);
164
- }
165
- }
166
-
9
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
10
+ /// for the mat-badge.
11
+ /// @param {Map} $theme The theme to generate base styles for.
167
12
  @mixin base($theme) {
168
13
  @if inspection.get-theme-version($theme) == 1 {
169
14
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
170
15
  }
171
- @else {}
16
+ @else {
17
+ @include sass-utils.current-selector-or-root() {
18
+ @include token-utils.create-token-values(tokens-mat-badge.$prefix,
19
+ tokens-mat-badge.get-unthemable-tokens());
20
+ }
21
+ }
172
22
  }
173
23
 
174
- @mixin color($theme) {
24
+ /// Outputs color theme styles for the mat-badge.
25
+ /// @param {Map} $theme The theme to generate color styles for.
26
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
27
+ /// $color-variant: The color variant to use for the badge: primary, secondary, tertiary,
28
+ /// or error (If not specified, default error color will be used).
29
+ @mixin color($theme, $options...) {
175
30
  @if inspection.get-theme-version($theme) == 1 {
176
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
31
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
177
32
  }
178
33
  @else {
179
34
  @include sass-utils.current-selector-or-root() {
@@ -193,6 +48,8 @@ $_emit-fallback-vars: true;
193
48
  }
194
49
  }
195
50
 
51
+ /// Outputs typography theme styles for the mat-badge.
52
+ /// @param {Map} $theme The theme to generate typography styles for.
196
53
  @mixin typography($theme) {
197
54
  @if inspection.get-theme-version($theme) == 1 {
198
55
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -205,6 +62,8 @@ $_emit-fallback-vars: true;
205
62
  }
206
63
  }
207
64
 
65
+ /// Outputs density theme styles for the mat-badge.
66
+ /// @param {Map} $theme The theme to generate density styles for.
208
67
  @mixin density($theme) {
209
68
  @if inspection.get-theme-version($theme) == 1 {
210
69
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -212,24 +71,17 @@ $_emit-fallback-vars: true;
212
71
  @else {}
213
72
  }
214
73
 
215
- @mixin theme($theme) {
74
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-badge.
75
+ /// @param {Map} $theme The theme to generate styles for.
76
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
77
+ /// $color-variant: The color variant to use for the badge: primary, secondary, tertiary,
78
+ /// or error (If not specified, default error color will be used).
79
+ @mixin theme($theme, $options...) {
216
80
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-badge') {
217
81
  @if inspection.get-theme-version($theme) == 1 {
218
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
82
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
219
83
  }
220
84
  @else {
221
- // Try to reduce the number of times that the structural styles are emitted.
222
- @if not $_badge-structure-emitted {
223
- @include _badge-structure;
224
-
225
- // Only flip the flag if the mixin is included at the top level. Otherwise the first
226
- // inclusion might be inside of a theme class which will exclude the structural styles
227
- // from all other themes.
228
- @if not & {
229
- $_badge-structure-emitted: true !global;
230
- }
231
- }
232
-
233
85
  @include base($theme);
234
86
  @if inspection.theme-has($theme, color) {
235
87
  @include color($theme);
@@ -244,9 +96,7 @@ $_emit-fallback-vars: true;
244
96
  }
245
97
  }
246
98
 
247
- @mixin _theme-from-tokens($tokens) {
248
- @if ($tokens != ()) {
249
- @include token-utils.create-token-values(
250
- tokens-mat-badge.$prefix, map.get($tokens, tokens-mat-badge.$prefix));
251
- }
99
+ @mixin _theme-from-tokens($tokens, $options...) {
100
+ $mat-badge-tokens: token-utils.get-tokens-for($tokens, tokens-mat-badge.$prefix, $options...);
101
+ @include token-utils.create-token-values(tokens-mat-badge.$prefix, $mat-badge-tokens);
252
102
  }
package/badge/index.d.ts CHANGED
@@ -13,6 +13,7 @@ declare namespace i3 {
13
13
  export {
14
14
  MatBadgePosition,
15
15
  MatBadgeSize,
16
+ _MatBadgeStyleLoader,
16
17
  MatBadge
17
18
  }
18
19
  }
@@ -95,7 +96,7 @@ export declare class MatBadge implements OnInit, OnDestroy {
95
96
 
96
97
  export declare class MatBadgeModule {
97
98
  static ɵfac: i0.ɵɵFactoryDeclaration<MatBadgeModule, never>;
98
- static ɵmod: i0.ɵɵNgModuleDeclaration<MatBadgeModule, never, [typeof i1.A11yModule, typeof i2.MatCommonModule, typeof i3.MatBadge], [typeof i3.MatBadge, typeof i2.MatCommonModule]>;
99
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MatBadgeModule, never, [typeof i1.A11yModule, typeof i2.MatCommonModule, typeof i3.MatBadge, typeof i3._MatBadgeStyleLoader], [typeof i3.MatBadge, typeof i2.MatCommonModule]>;
99
100
  static ɵinj: i0.ɵɵInjectorDeclaration<MatBadgeModule>;
100
101
  }
101
102
 
@@ -105,4 +106,13 @@ export declare type MatBadgePosition = 'above after' | 'above before' | 'below b
105
106
  /** Allowed size options for matBadgeSize */
106
107
  export declare type MatBadgeSize = 'small' | 'medium' | 'large';
107
108
 
109
+ /**
110
+ * Component used to load the structural styles of the badge.
111
+ * @docs-private
112
+ */
113
+ declare class _MatBadgeStyleLoader {
114
+ static ɵfac: i0.ɵɵFactoryDeclaration<_MatBadgeStyleLoader, never>;
115
+ static ɵcmp: i0.ɵɵComponentDeclaration<_MatBadgeStyleLoader, "ng-component", never, {}, {}, never, never, true, never>;
116
+ }
117
+
108
118
  export { }
@@ -110,22 +110,13 @@
110
110
  }
111
111
  }
112
112
 
113
- // Hides the touch target on lower densities.
114
- @mixin mat-private-button-touch-target-density($scale) {
115
- @include mdc-helpers.if-touch-targets-unsupported($scale) {
116
- .mat-mdc-button-touch-target {
117
- display: none;
118
- }
119
- }
120
- }
121
-
122
113
  // Adds an elevation shadow to a button.
123
114
  @mixin mat-private-button-elevation($token-name) {
124
115
  // MDC outputs a variable that is the same as the token name, but suffixed with `-shadow`.
125
116
  box-shadow: var(#{token-utils.get-token-variable($token-name) + '-shadow'});
126
117
  }
127
118
 
128
- @mixin mat-private-button-touch-target($is-square) {
119
+ @mixin mat-private-button-touch-target($is-square, $prefix, $slots) {
129
120
  // Element used to ensure that the button has a touch target that meets the required minimum.
130
121
  // Note that we use this, instead of MDC's built-in `mdc-button--touch` class, because the MDC
131
122
  // class is implemented as `margin-top: 6px; margin-bottom: 6px` on the host element which
@@ -136,5 +127,54 @@
136
127
  @include mdc-touch-target.touch-target(
137
128
  $set-width: $is-square,
138
129
  $query: mdc-helpers.$mdc-base-styles-query);
130
+
131
+ @include token-utils.use-tokens($prefix, $slots) {
132
+ @include token-utils.create-token-slot(display, touch-target-display);
133
+ }
134
+ }
135
+ }
136
+
137
+ @mixin mat-private-button-horizontal-layout($prefix, $slots, $has-with-icon-padding) {
138
+ @include token-utils.use-tokens($prefix, $slots) {
139
+ $icon-spacing: token-utils.get-token-variable-reference(icon-spacing, true);
140
+ $icon-offset: token-utils.get-token-variable-reference(icon-offset, true);
141
+ $horizontal-padding: token-utils.get-token-variable-reference(horizontal-padding, true);
142
+ padding: 0 $horizontal-padding;
143
+
144
+ @if ($has-with-icon-padding) {
145
+ $with-icon-horizontal-padding:
146
+ token-utils.get-token-variable-reference(with-icon-horizontal-padding, true);
147
+
148
+ // stylelint-disable-next-line selector-class-pattern
149
+ &:has(.material-icons, mat-icon, [matButtonIcon]) {
150
+ padding: 0 $with-icon-horizontal-padding;
151
+ }
152
+ }
153
+
154
+ // MDC expects button icons to contain this HTML content:
155
+ // ```html
156
+ // <span class="mdc-button__icon material-icons">favorite</span>
157
+ // ```
158
+ // However, Angular Material expects a `mat-icon` instead. The following
159
+ // styles will lay out the icons appropriately.
160
+ & > .mat-icon {
161
+ margin-right: $icon-spacing;
162
+ margin-left: $icon-offset;
163
+
164
+ [dir='rtl'] & {
165
+ margin-right: $icon-offset;
166
+ margin-left: $icon-spacing;
167
+ }
168
+ }
169
+
170
+ .mdc-button__label + .mat-icon {
171
+ margin-right: $icon-offset;
172
+ margin-left: $icon-spacing;
173
+
174
+ [dir='rtl'] & {
175
+ margin-right: $icon-spacing;
176
+ margin-left: $icon-offset;
177
+ }
178
+ }
139
179
  }
140
180
  }
@@ -1,10 +1,8 @@
1
- @use 'sass:map';
2
1
  @use '@material/button/button-text-theme' as mdc-button-text-theme;
3
2
  @use '@material/button/button-filled-theme' as mdc-button-filled-theme;
4
3
  @use '@material/button/button-protected-theme' as mdc-button-protected-theme;
5
4
  @use '@material/button/button-outlined-theme' as mdc-button-outlined-theme;
6
5
 
7
- @use './button-base';
8
6
  @use '../core/theming/theming';
9
7
  @use '../core/theming/inspection';
10
8
  @use '../core/tokens/token-utils';
@@ -79,25 +77,39 @@
79
77
  @include token-utils.create-token-values(tokens-mat-outlined-button.$prefix, $mat-tokens);
80
78
  }
81
79
 
82
- @mixin _theme-from-tokens($tokens) {
83
- @if ($tokens != ()) {
84
- @include mdc-button-text-theme.theme(map.get($tokens, tokens-mdc-text-button.$prefix));
85
- @include mdc-button-protected-theme.theme(
86
- map.get($tokens, tokens-mdc-protected-button.$prefix));
87
- @include mdc-button-filled-theme.theme(map.get($tokens, tokens-mdc-filled-button.$prefix));
88
- @include mdc-button-outlined-theme.theme(map.get($tokens, tokens-mdc-outlined-button.$prefix));
89
-
90
- @include token-utils.create-token-values(
91
- tokens-mat-text-button.$prefix, map.get($tokens, tokens-mat-text-button.$prefix));
92
- @include token-utils.create-token-values(
93
- tokens-mat-protected-button.$prefix, map.get($tokens, tokens-mat-protected-button.$prefix));
94
- @include token-utils.create-token-values(
95
- tokens-mat-filled-button.$prefix, map.get($tokens, tokens-mat-filled-button.$prefix));
96
- @include token-utils.create-token-values(
97
- tokens-mat-outlined-button.$prefix, map.get($tokens, tokens-mat-outlined-button.$prefix));
98
- }
80
+ @mixin _theme-from-tokens($tokens, $options...) {
81
+ $mdc-text-button-tokens:
82
+ token-utils.get-tokens-for($tokens, tokens-mdc-text-button.$prefix, $options...);
83
+ $mdc-protected-button-tokens:
84
+ token-utils.get-tokens-for($tokens, tokens-mdc-protected-button.$prefix, $options...);
85
+ $mdc-filled-button-tokens:
86
+ token-utils.get-tokens-for($tokens, tokens-mdc-filled-button.$prefix, $options...);
87
+ $mdc-outlined-button-tokens:
88
+ token-utils.get-tokens-for($tokens, tokens-mdc-outlined-button.$prefix, $options...);
89
+ $mat-text-button-tokens:
90
+ token-utils.get-tokens-for($tokens, tokens-mat-text-button.$prefix, $options...);
91
+ $mat-protected-button-tokens:
92
+ token-utils.get-tokens-for($tokens, tokens-mat-protected-button.$prefix, $options...);
93
+ $mat-filled-button-tokens:
94
+ token-utils.get-tokens-for($tokens, tokens-mat-filled-button.$prefix, $options...);
95
+ $mat-outlined-button-tokens:
96
+ token-utils.get-tokens-for($tokens, tokens-mat-outlined-button.$prefix, $options...);
97
+ @include mdc-button-text-theme.theme($mdc-text-button-tokens);
98
+ @include mdc-button-protected-theme.theme($mdc-protected-button-tokens);
99
+ @include mdc-button-filled-theme.theme($mdc-filled-button-tokens);
100
+ @include mdc-button-outlined-theme.theme($mdc-outlined-button-tokens);
101
+ @include token-utils.create-token-values(tokens-mat-text-button.$prefix, $mat-text-button-tokens);
102
+ @include token-utils.create-token-values(
103
+ tokens-mat-protected-button.$prefix, $mat-protected-button-tokens);
104
+ @include token-utils.create-token-values(
105
+ tokens-mat-filled-button.$prefix, $mat-filled-button-tokens);
106
+ @include token-utils.create-token-values(
107
+ tokens-mat-outlined-button.$prefix, $mat-outlined-button-tokens);
99
108
  }
100
109
 
110
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
111
+ /// for the mat-button.
112
+ /// @param {Map} $theme The theme to generate base styles for.
101
113
  @mixin base($theme) {
102
114
  @if inspection.get-theme-version($theme) == 1 {
103
115
  @include theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -112,13 +124,27 @@
112
124
  tokens-mdc-protected-button.get-unthemable-tokens());
113
125
  @include mdc-button-outlined-theme.theme(
114
126
  tokens-mdc-outlined-button.get-unthemable-tokens());
127
+
128
+ @include token-utils.create-token-values(tokens-mat-text-button.$prefix,
129
+ tokens-mat-text-button.get-unthemable-tokens());
130
+ @include token-utils.create-token-values(tokens-mat-filled-button.$prefix,
131
+ tokens-mat-filled-button.get-unthemable-tokens());
132
+ @include token-utils.create-token-values(tokens-mat-protected-button.$prefix,
133
+ tokens-mat-protected-button.get-unthemable-tokens());
134
+ @include token-utils.create-token-values(tokens-mat-outlined-button.$prefix,
135
+ tokens-mat-outlined-button.get-unthemable-tokens());
115
136
  }
116
137
  }
117
138
  }
118
139
 
119
- @mixin color($theme) {
140
+ /// Outputs color theme styles for the mat-button.
141
+ /// @param {Map} $theme The theme to generate color styles for.
142
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
143
+ /// $color-variant: The color variant to use for the button: primary, secondary, tertiary,
144
+ /// or error (If not specified, default primary color will be used).
145
+ @mixin color($theme, $options...) {
120
146
  @if inspection.get-theme-version($theme) == 1 {
121
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
147
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
122
148
  }
123
149
  @else {
124
150
  @include sass-utils.current-selector-or-root() {
@@ -186,58 +212,73 @@
186
212
  }
187
213
  }
188
214
 
215
+ /// Outputs typography theme styles for the mat-button.
216
+ /// @param {Map} $theme The theme to generate typography styles for.
189
217
  @mixin typography($theme) {
190
218
  @if inspection.get-theme-version($theme) == 1 {
191
219
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
192
220
  }
193
221
  @else {
194
222
  @include sass-utils.current-selector-or-root() {
195
- $text-typography-tokens: tokens-mdc-text-button.get-typography-tokens($theme);
196
- $filled-typography-tokens: tokens-mdc-filled-button.get-typography-tokens($theme);
197
- $outlined-typography-tokens: tokens-mdc-outlined-button.get-typography-tokens($theme);
198
- $protected-typography-tokens: tokens-mdc-protected-button.get-typography-tokens($theme);
199
-
200
- @include mdc-button-text-theme.theme($text-typography-tokens);
201
- @include mdc-button-filled-theme.theme($filled-typography-tokens);
202
- @include mdc-button-outlined-theme.theme($outlined-typography-tokens);
203
- @include mdc-button-protected-theme.theme($protected-typography-tokens);
223
+ @include mdc-button-text-theme.theme(
224
+ tokens-mdc-text-button.get-typography-tokens($theme));
225
+ @include mdc-button-filled-theme.theme(
226
+ tokens-mdc-filled-button.get-typography-tokens($theme));
227
+ @include mdc-button-outlined-theme.theme(
228
+ tokens-mdc-outlined-button.get-typography-tokens($theme));
229
+ @include mdc-button-protected-theme.theme(
230
+ tokens-mdc-protected-button.get-typography-tokens($theme));
231
+
232
+ @include token-utils.create-token-values(tokens-mat-text-button.$prefix,
233
+ tokens-mat-text-button.get-typography-tokens($theme));
234
+ @include token-utils.create-token-values(tokens-mat-filled-button.$prefix,
235
+ tokens-mat-filled-button.get-typography-tokens($theme));
236
+ @include token-utils.create-token-values(tokens-mat-protected-button.$prefix,
237
+ tokens-mat-protected-button.get-typography-tokens($theme));
238
+ @include token-utils.create-token-values(tokens-mat-outlined-button.$prefix,
239
+ tokens-mat-outlined-button.get-typography-tokens($theme));
204
240
  }
205
241
  }
206
242
  }
207
243
 
244
+ /// Outputs density theme styles for the mat-button.
245
+ /// @param {Map} $theme The theme to generate density styles for.
208
246
  @mixin density($theme) {
209
247
  @if inspection.get-theme-version($theme) == 1 {
210
248
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
211
249
  }
212
250
  @else {
213
- $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
214
-
215
251
  @include sass-utils.current-selector-or-root() {
216
- $text-density-tokens: tokens-mdc-text-button.get-density-tokens($theme);
217
- $filled-density-tokens: tokens-mdc-filled-button.get-density-tokens($theme);
218
- $outlined-density-tokens: tokens-mdc-outlined-button.get-density-tokens($theme);
219
- $protected-density-tokens: tokens-mdc-protected-button.get-density-tokens($theme);
220
-
221
- @include mdc-button-text-theme.theme($text-density-tokens);
222
- @include mdc-button-filled-theme.theme($filled-density-tokens);
223
- @include mdc-button-outlined-theme.theme($outlined-density-tokens);
224
- @include mdc-button-protected-theme.theme($protected-density-tokens);
225
- }
226
-
227
- .mat-mdc-button,
228
- .mat-mdc-raised-button,
229
- .mat-mdc-unelevated-button,
230
- .mat-mdc-outlined-button {
231
- // TODO: tokenize the touch target visibility.
232
- @include button-base.mat-private-button-touch-target-density($density-scale);
252
+ @include mdc-button-text-theme.theme(
253
+ tokens-mdc-text-button.get-density-tokens($theme));
254
+ @include mdc-button-filled-theme.theme(
255
+ tokens-mdc-filled-button.get-density-tokens($theme));
256
+ @include mdc-button-outlined-theme.theme(
257
+ tokens-mdc-outlined-button.get-density-tokens($theme));
258
+ @include mdc-button-protected-theme.theme(
259
+ tokens-mdc-protected-button.get-density-tokens($theme));
260
+
261
+ @include token-utils.create-token-values(tokens-mat-text-button.$prefix,
262
+ tokens-mat-text-button.get-density-tokens($theme));
263
+ @include token-utils.create-token-values(tokens-mat-filled-button.$prefix,
264
+ tokens-mat-filled-button.get-density-tokens($theme));
265
+ @include token-utils.create-token-values(tokens-mat-protected-button.$prefix,
266
+ tokens-mat-protected-button.get-density-tokens($theme));
267
+ @include token-utils.create-token-values(tokens-mat-outlined-button.$prefix,
268
+ tokens-mat-outlined-button.get-density-tokens($theme));
233
269
  }
234
270
  }
235
271
  }
236
272
 
237
- @mixin theme($theme) {
273
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-button.
274
+ /// @param {Map} $theme The theme to generate styles for.
275
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
276
+ /// $color-variant: The color variant to use for the button: primary, secondary, tertiary,
277
+ /// or error (If not specified, default primary color will be used).
278
+ @mixin theme($theme, $options...) {
238
279
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-button') {
239
280
  @if inspection.get-theme-version($theme) == 1 {
240
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
281
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
241
282
  }
242
283
  @else {
243
284
  @include base($theme);