@angular/material 17.1.2 → 17.2.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/_index.scss +4 -4
  2. package/badge/_badge-theme.scss +30 -11
  3. package/button/_button-base.scss +50 -10
  4. package/button/_button-theme.scss +92 -51
  5. package/button/_fab-theme.scss +82 -15
  6. package/button/_icon-button-theme.scss +11 -4
  7. package/button-toggle/_button-toggle-theme.scss +26 -11
  8. package/checkbox/_checkbox-theme.scss +41 -23
  9. package/chips/_chips-theme.scss +36 -9
  10. package/core/_core-theme.scss +85 -38
  11. package/core/mdc-helpers/_mdc-helpers.scss +0 -8
  12. package/core/option/_option-theme.scss +24 -10
  13. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +64 -24
  14. package/core/tokens/_token-utils.scss +22 -0
  15. package/core/tokens/m2/_index.scss +16 -0
  16. package/core/tokens/m2/mat/_badge.scss +27 -1
  17. package/core/tokens/m2/mat/_checkbox.scss +45 -0
  18. package/core/tokens/m2/mat/_chip.scss +39 -0
  19. package/core/tokens/m2/mat/_dialog.scss +49 -0
  20. package/core/tokens/m2/mat/_fab-small.scss +95 -0
  21. package/core/tokens/m2/mat/_fab.scss +6 -1
  22. package/core/tokens/m2/mat/_filled-button.scss +17 -2
  23. package/core/tokens/m2/mat/_icon-button.scss +6 -1
  24. package/core/tokens/m2/mat/_outlined-button.scss +17 -2
  25. package/core/tokens/m2/mat/_protected-button.scss +17 -2
  26. package/core/tokens/m2/mat/_radio.scss +6 -1
  27. package/core/tokens/m2/mat/_stepper.scss +6 -1
  28. package/core/tokens/m2/mat/_text-button.scss +20 -2
  29. package/core/tokens/m2/mdc/_chip.scss +8 -8
  30. package/core/tokens/m2/mdc/_extended-fab.scss +3 -2
  31. package/core/tokens/m2/mdc/_fab-small.scss +90 -0
  32. package/core/tokens/m2/mdc/_fab.scss +0 -11
  33. package/core/tokens/m2/mdc/_icon-button.scss +15 -7
  34. package/datepicker/_datepicker-theme.scss +25 -9
  35. package/dialog/_dialog-theme.scss +10 -0
  36. package/dialog/index.d.ts +28 -9
  37. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  38. package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
  39. package/esm2022/autocomplete/autocomplete.mjs +4 -4
  40. package/esm2022/autocomplete/module.mjs +5 -5
  41. package/esm2022/badge/badge-module.mjs +5 -5
  42. package/esm2022/badge/badge.mjs +8 -8
  43. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
  44. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  45. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  46. package/esm2022/button/button-base.mjs +7 -7
  47. package/esm2022/button/button.mjs +9 -9
  48. package/esm2022/button/fab.mjs +17 -17
  49. package/esm2022/button/icon-button.mjs +9 -9
  50. package/esm2022/button/module.mjs +5 -5
  51. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  52. package/esm2022/button-toggle/button-toggle.mjs +7 -7
  53. package/esm2022/card/card.mjs +43 -43
  54. package/esm2022/card/module.mjs +5 -5
  55. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  56. package/esm2022/checkbox/checkbox.mjs +6 -6
  57. package/esm2022/checkbox/module.mjs +9 -9
  58. package/esm2022/chips/chip-action.mjs +4 -4
  59. package/esm2022/chips/chip-edit-input.mjs +4 -4
  60. package/esm2022/chips/chip-grid.mjs +4 -4
  61. package/esm2022/chips/chip-icons.mjs +10 -10
  62. package/esm2022/chips/chip-input.mjs +4 -4
  63. package/esm2022/chips/chip-listbox.mjs +4 -4
  64. package/esm2022/chips/chip-option.mjs +6 -6
  65. package/esm2022/chips/chip-row.mjs +6 -6
  66. package/esm2022/chips/chip-set.mjs +4 -4
  67. package/esm2022/chips/chip.mjs +5 -5
  68. package/esm2022/chips/module.mjs +5 -5
  69. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  70. package/esm2022/core/datetime/index.mjs +9 -9
  71. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  72. package/esm2022/core/error/error-options.mjs +7 -7
  73. package/esm2022/core/internal-form-field/internal-form-field.mjs +4 -4
  74. package/esm2022/core/line/line.mjs +8 -8
  75. package/esm2022/core/option/index.mjs +5 -5
  76. package/esm2022/core/option/optgroup.mjs +4 -4
  77. package/esm2022/core/option/option.mjs +5 -5
  78. package/esm2022/core/private/ripple-loader.mjs +4 -4
  79. package/esm2022/core/ripple/index.mjs +5 -5
  80. package/esm2022/core/ripple/ripple.mjs +4 -4
  81. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  82. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  83. package/esm2022/core/version.mjs +1 -1
  84. package/esm2022/datepicker/calendar-body.mjs +4 -4
  85. package/esm2022/datepicker/calendar.mjs +7 -7
  86. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  87. package/esm2022/datepicker/date-range-input.mjs +4 -4
  88. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  89. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  90. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  91. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  92. package/esm2022/datepicker/datepicker-base.mjs +7 -7
  93. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  94. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  95. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  96. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  97. package/esm2022/datepicker/datepicker-toggle.mjs +7 -7
  98. package/esm2022/datepicker/datepicker.mjs +4 -4
  99. package/esm2022/datepicker/month-view.mjs +4 -4
  100. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  101. package/esm2022/datepicker/year-view.mjs +4 -4
  102. package/esm2022/dialog/dialog-config.mjs +1 -3
  103. package/esm2022/dialog/dialog-container.mjs +16 -5
  104. package/esm2022/dialog/dialog-content-directives.mjs +49 -31
  105. package/esm2022/dialog/dialog-ref.mjs +3 -1
  106. package/esm2022/dialog/dialog.mjs +4 -4
  107. package/esm2022/dialog/module.mjs +5 -5
  108. package/esm2022/dialog/public-api.mjs +2 -2
  109. package/esm2022/divider/divider-module.mjs +5 -5
  110. package/esm2022/divider/divider.mjs +4 -4
  111. package/esm2022/expansion/accordion.mjs +4 -4
  112. package/esm2022/expansion/expansion-module.mjs +5 -5
  113. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  114. package/esm2022/expansion/expansion-panel-header.mjs +10 -10
  115. package/esm2022/expansion/expansion-panel.mjs +7 -7
  116. package/esm2022/form-field/directives/error.mjs +4 -4
  117. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  118. package/esm2022/form-field/directives/hint.mjs +4 -4
  119. package/esm2022/form-field/directives/label.mjs +4 -4
  120. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  121. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  122. package/esm2022/form-field/directives/prefix.mjs +4 -4
  123. package/esm2022/form-field/directives/suffix.mjs +4 -4
  124. package/esm2022/form-field/form-field-control.mjs +4 -4
  125. package/esm2022/form-field/form-field.mjs +4 -4
  126. package/esm2022/form-field/module.mjs +5 -5
  127. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  128. package/esm2022/grid-list/grid-list.mjs +4 -4
  129. package/esm2022/grid-list/grid-tile.mjs +16 -16
  130. package/esm2022/icon/icon-module.mjs +5 -5
  131. package/esm2022/icon/icon-registry.mjs +4 -4
  132. package/esm2022/icon/icon.mjs +4 -4
  133. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  134. package/esm2022/input/input.mjs +4 -4
  135. package/esm2022/input/module.mjs +5 -5
  136. package/esm2022/list/action-list.mjs +4 -4
  137. package/esm2022/list/list-base.mjs +7 -7
  138. package/esm2022/list/list-item-sections.mjs +19 -19
  139. package/esm2022/list/list-module.mjs +5 -5
  140. package/esm2022/list/list-option.mjs +4 -4
  141. package/esm2022/list/list.mjs +7 -7
  142. package/esm2022/list/nav-list.mjs +4 -4
  143. package/esm2022/list/selection-list.mjs +4 -4
  144. package/esm2022/list/subheader.mjs +4 -4
  145. package/esm2022/menu/menu-content.mjs +4 -4
  146. package/esm2022/menu/menu-item.mjs +4 -4
  147. package/esm2022/menu/menu-trigger.mjs +4 -4
  148. package/esm2022/menu/menu.mjs +4 -4
  149. package/esm2022/menu/module.mjs +5 -5
  150. package/esm2022/paginator/module.mjs +5 -5
  151. package/esm2022/paginator/paginator-intl.mjs +4 -4
  152. package/esm2022/paginator/paginator.mjs +4 -4
  153. package/esm2022/progress-bar/module.mjs +5 -5
  154. package/esm2022/progress-bar/progress-bar.mjs +4 -4
  155. package/esm2022/progress-spinner/module.mjs +5 -5
  156. package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
  157. package/esm2022/radio/module.mjs +5 -5
  158. package/esm2022/radio/radio.mjs +8 -8
  159. package/esm2022/select/module.mjs +5 -5
  160. package/esm2022/select/select.mjs +7 -7
  161. package/esm2022/sidenav/drawer.mjs +10 -10
  162. package/esm2022/sidenav/sidenav-module.mjs +5 -5
  163. package/esm2022/sidenav/sidenav.mjs +10 -10
  164. package/esm2022/slide-toggle/module.mjs +9 -9
  165. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  166. package/esm2022/slide-toggle/slide-toggle.mjs +4 -4
  167. package/esm2022/slider/module.mjs +5 -5
  168. package/esm2022/slider/slider-input.mjs +7 -7
  169. package/esm2022/slider/slider-thumb.mjs +4 -4
  170. package/esm2022/slider/slider.mjs +4 -4
  171. package/esm2022/snack-bar/module.mjs +5 -5
  172. package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
  173. package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
  174. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  175. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  176. package/esm2022/sort/sort-header-intl.mjs +4 -4
  177. package/esm2022/sort/sort-header.mjs +4 -4
  178. package/esm2022/sort/sort-module.mjs +5 -5
  179. package/esm2022/sort/sort.mjs +4 -4
  180. package/esm2022/stepper/step-content.mjs +4 -4
  181. package/esm2022/stepper/step-header.mjs +5 -5
  182. package/esm2022/stepper/step-label.mjs +4 -4
  183. package/esm2022/stepper/stepper-button.mjs +7 -7
  184. package/esm2022/stepper/stepper-icon.mjs +4 -4
  185. package/esm2022/stepper/stepper-intl.mjs +4 -4
  186. package/esm2022/stepper/stepper-module.mjs +5 -5
  187. package/esm2022/stepper/stepper.mjs +7 -7
  188. package/esm2022/table/cell.mjs +22 -22
  189. package/esm2022/table/module.mjs +5 -5
  190. package/esm2022/table/row.mjs +22 -22
  191. package/esm2022/table/table.mjs +7 -7
  192. package/esm2022/table/text-column.mjs +4 -4
  193. package/esm2022/tabs/module.mjs +5 -5
  194. package/esm2022/tabs/paginated-tab-header.mjs +4 -4
  195. package/esm2022/tabs/tab-body.mjs +7 -7
  196. package/esm2022/tabs/tab-content.mjs +4 -4
  197. package/esm2022/tabs/tab-group.mjs +4 -4
  198. package/esm2022/tabs/tab-header.mjs +4 -4
  199. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  200. package/esm2022/tabs/tab-label.mjs +4 -4
  201. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
  202. package/esm2022/tabs/tab.mjs +4 -4
  203. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  204. package/esm2022/toolbar/toolbar.mjs +7 -7
  205. package/esm2022/tooltip/module.mjs +5 -5
  206. package/esm2022/tooltip/tooltip.mjs +7 -7
  207. package/esm2022/tree/node.mjs +10 -10
  208. package/esm2022/tree/outlet.mjs +4 -4
  209. package/esm2022/tree/padding.mjs +4 -4
  210. package/esm2022/tree/toggle.mjs +4 -4
  211. package/esm2022/tree/tree-module.mjs +5 -5
  212. package/esm2022/tree/tree.mjs +4 -4
  213. package/fesm2022/autocomplete.mjs +13 -13
  214. package/fesm2022/autocomplete.mjs.map +1 -1
  215. package/fesm2022/badge.mjs +11 -11
  216. package/fesm2022/badge.mjs.map +1 -1
  217. package/fesm2022/bottom-sheet.mjs +10 -10
  218. package/fesm2022/bottom-sheet.mjs.map +1 -1
  219. package/fesm2022/button-toggle.mjs +10 -10
  220. package/fesm2022/button-toggle.mjs.map +1 -1
  221. package/fesm2022/button.mjs +42 -42
  222. package/fesm2022/button.mjs.map +1 -1
  223. package/fesm2022/card.mjs +46 -46
  224. package/fesm2022/card.mjs.map +1 -1
  225. package/fesm2022/checkbox.mjs +16 -16
  226. package/fesm2022/checkbox.mjs.map +1 -1
  227. package/fesm2022/chips.mjs +45 -45
  228. package/fesm2022/chips.mjs.map +1 -1
  229. package/fesm2022/core.mjs +60 -60
  230. package/fesm2022/core.mjs.map +1 -1
  231. package/fesm2022/datepicker.mjs +82 -82
  232. package/fesm2022/datepicker.mjs.map +1 -1
  233. package/fesm2022/dialog.mjs +72 -43
  234. package/fesm2022/dialog.mjs.map +1 -1
  235. package/fesm2022/divider.mjs +7 -7
  236. package/fesm2022/divider.mjs.map +1 -1
  237. package/fesm2022/expansion.mjs +25 -25
  238. package/fesm2022/expansion.mjs.map +1 -1
  239. package/fesm2022/form-field.mjs +34 -34
  240. package/fesm2022/form-field.mjs.map +1 -1
  241. package/fesm2022/grid-list.mjs +22 -22
  242. package/fesm2022/grid-list.mjs.map +1 -1
  243. package/fesm2022/icon/testing.mjs +7 -7
  244. package/fesm2022/icon/testing.mjs.map +1 -1
  245. package/fesm2022/icon.mjs +10 -10
  246. package/fesm2022/icon.mjs.map +1 -1
  247. package/fesm2022/input.mjs +7 -7
  248. package/fesm2022/input.mjs.map +1 -1
  249. package/fesm2022/list.mjs +49 -49
  250. package/fesm2022/list.mjs.map +1 -1
  251. package/fesm2022/menu.mjs +16 -16
  252. package/fesm2022/menu.mjs.map +1 -1
  253. package/fesm2022/paginator.mjs +10 -10
  254. package/fesm2022/paginator.mjs.map +1 -1
  255. package/fesm2022/progress-bar.mjs +7 -7
  256. package/fesm2022/progress-bar.mjs.map +1 -1
  257. package/fesm2022/progress-spinner.mjs +7 -7
  258. package/fesm2022/progress-spinner.mjs.map +1 -1
  259. package/fesm2022/radio.mjs +11 -11
  260. package/fesm2022/radio.mjs.map +1 -1
  261. package/fesm2022/select.mjs +10 -10
  262. package/fesm2022/select.mjs.map +1 -1
  263. package/fesm2022/sidenav.mjs +22 -22
  264. package/fesm2022/sidenav.mjs.map +1 -1
  265. package/fesm2022/slide-toggle.mjs +14 -14
  266. package/fesm2022/slide-toggle.mjs.map +1 -1
  267. package/fesm2022/slider.mjs +16 -16
  268. package/fesm2022/slider.mjs.map +1 -1
  269. package/fesm2022/snack-bar.mjs +22 -22
  270. package/fesm2022/snack-bar.mjs.map +1 -1
  271. package/fesm2022/sort.mjs +13 -13
  272. package/fesm2022/sort.mjs.map +1 -1
  273. package/fesm2022/stepper.mjs +32 -32
  274. package/fesm2022/stepper.mjs.map +1 -1
  275. package/fesm2022/table.mjs +55 -55
  276. package/fesm2022/table.mjs.map +1 -1
  277. package/fesm2022/tabs.mjs +40 -40
  278. package/fesm2022/tabs.mjs.map +1 -1
  279. package/fesm2022/toolbar.mjs +10 -10
  280. package/fesm2022/toolbar.mjs.map +1 -1
  281. package/fesm2022/tooltip.mjs +10 -10
  282. package/fesm2022/tooltip.mjs.map +1 -1
  283. package/fesm2022/tree.mjs +25 -25
  284. package/fesm2022/tree.mjs.map +1 -1
  285. package/form-field/_form-field-theme.scss +31 -14
  286. package/icon/_icon-theme.scss +2 -2
  287. package/package.json +7 -7
  288. package/paginator/_paginator-theme.scss +10 -16
  289. package/prebuilt-themes/deeppurple-amber.css +1 -1
  290. package/prebuilt-themes/indigo-pink.css +1 -1
  291. package/prebuilt-themes/pink-bluegrey.css +1 -1
  292. package/prebuilt-themes/purple-green.css +1 -1
  293. package/progress-bar/_progress-bar-theme.scss +27 -9
  294. package/progress-spinner/_progress-spinner-theme.scss +38 -17
  295. package/radio/_radio-theme.scss +34 -18
  296. package/schematics/ng-add/index.js +2 -2
  297. package/schematics/ng-add/index.mjs +2 -2
  298. package/schematics/ng-generate/mdc-migration/index_bundled.js +163 -122
  299. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  300. package/select/_select-theme.scss +24 -10
  301. package/slide-toggle/_slide-toggle-theme.scss +29 -9
  302. package/slider/_slider-theme.scss +28 -11
  303. package/stepper/_stepper-theme.scss +28 -7
  304. package/tabs/_tabs-theme.scss +32 -14
@@ -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,39 @@
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, chip);
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
+ disabled-container-opacity: 0.4,
12
+ );
13
+ }
14
+
15
+ // Tokens that can be configured through Angular Material's color theming API.
16
+ @function get-color-tokens($theme) {
17
+ @return ();
18
+ }
19
+
20
+ // Tokens that can be configured through Angular Material's typography theming API.
21
+ @function get-typography-tokens($theme) {
22
+ @return ();
23
+ }
24
+
25
+ // Tokens that can be configured through Angular Material's density theming API.
26
+ @function get-density-tokens($theme) {
27
+ @return ();
28
+ }
29
+
30
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
31
+ // This is used to create token slots.
32
+ @function get-token-slots() {
33
+ @return sass-utils.deep-merge-all(
34
+ get-unthemable-tokens(),
35
+ get-color-tokens(token-utils.$placeholder-color-config),
36
+ get-typography-tokens(token-utils.$placeholder-typography-config),
37
+ get-density-tokens(token-utils.$placeholder-density-config)
38
+ );
39
+ }
@@ -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.
@@ -2,6 +2,7 @@
2
2
  @use 'sass:meta';
3
3
  @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
4
  @use '../../token-utils';
5
+ @use '../../../theming/theming';
5
6
  @use '../../../theming/inspection';
6
7
  @use '../../../style/sass-utils';
7
8
 
@@ -61,7 +62,11 @@ $prefix: (mat, icon-button);
61
62
 
62
63
  // Tokens that can be configured through Angular Material's density theming API.
63
64
  @function get-density-tokens($theme) {
64
- @return ();
65
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
66
+
67
+ @return (
68
+ touch-target-display: if($density-scale < -1, none, block),
69
+ );
65
70
  }
66
71
 
67
72
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -2,6 +2,7 @@
2
2
  @use 'sass:meta';
3
3
  @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
4
  @use '../../token-utils';
5
+ @use '../../../theming/theming';
5
6
  @use '../../../theming/inspection';
6
7
  @use '../../../style/sass-utils';
7
8
 
@@ -11,7 +12,17 @@ $prefix: (mat, outlined-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: 15px, // Normally it's 16px, but -1px for the outline.
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.
@@ -61,7 +72,11 @@ $prefix: (mat, outlined-button);
61
72
 
62
73
  // Tokens that can be configured through Angular Material's density theming API.
63
74
  @function get-density-tokens($theme) {
64
- @return ();
75
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
76
+
77
+ @return (
78
+ touch-target-display: if($density-scale < -1, none, block),
79
+ );
65
80
  }
66
81
 
67
82
  // 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, protected-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, protected-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.
@@ -1,4 +1,5 @@
1
1
  @use '../../token-utils';
2
+ @use '../../../theming/theming';
2
3
  @use '../../../theming/inspection';
3
4
  @use '../../../style/sass-utils';
4
5
 
@@ -29,7 +30,11 @@ $prefix: (mat, radio);
29
30
 
30
31
  // Tokens that can be configured through Angular Material's density theming API.
31
32
  @function get-density-tokens($theme) {
32
- @return ();
33
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
34
+
35
+ @return (
36
+ touch-target-display: if($density-scale < -1, none, block),
37
+ );
33
38
  }
34
39
 
35
40
  // Combines the tokens generated by the above functions into a single map with placeholder values.