@angular/material 17.0.0-next.0 → 17.0.0-next.2

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 (204) hide show
  1. package/_index.scss +3 -4
  2. package/autocomplete/_autocomplete-theme.scss +12 -18
  3. package/autocomplete/index.d.ts +15 -24
  4. package/badge/_badge-theme.scss +15 -27
  5. package/badge/index.d.ts +9 -17
  6. package/bottom-sheet/_bottom-sheet-theme.scss +13 -22
  7. package/button/_button-base.scss +3 -3
  8. package/button/_button-theme-private.scss +3 -2
  9. package/button/_button-theme.scss +18 -25
  10. package/button/_fab-theme.scss +31 -49
  11. package/button/_icon-button-theme.scss +19 -26
  12. package/button/index.d.ts +22 -31
  13. package/button-toggle/_button-toggle-theme.scss +17 -28
  14. package/button-toggle/index.d.ts +15 -18
  15. package/card/_card-theme.scss +27 -38
  16. package/checkbox/_checkbox-theme.scss +28 -45
  17. package/checkbox/index.d.ts +21 -27
  18. package/chips/_chips-theme.scss +18 -56
  19. package/core/_core-theme.scss +24 -39
  20. package/core/color/_all-color.scss +7 -15
  21. package/core/density/private/_all-density.scss +34 -39
  22. package/core/focus-indicators/_focus-indicators-theme.scss +6 -8
  23. package/core/focus-indicators/_private.scss +22 -26
  24. package/core/index.d.ts +7 -11
  25. package/core/mdc-helpers/_mdc-helpers.scss +19 -22
  26. package/core/option/_optgroup-theme.scss +13 -23
  27. package/core/option/_option-theme.scss +23 -37
  28. package/core/ripple/_ripple-theme.scss +6 -10
  29. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +17 -24
  30. package/core/style/_form-common.scss +7 -7
  31. package/core/style/_private.scss +5 -7
  32. package/core/style/_sass-utils.scss +7 -0
  33. package/core/testing/index.d.ts +2 -1
  34. package/core/theming/_all-theme.scss +41 -41
  35. package/core/theming/_inspection.scss +133 -59
  36. package/core/theming/_m2-inspection.scss +268 -0
  37. package/core/theming/_theming.scss +59 -20
  38. package/core/tokens/m2/mat/_autocomplete.scss +5 -8
  39. package/core/tokens/m2/mat/_badge.scss +12 -15
  40. package/core/tokens/m2/mat/_bottom-sheet.scss +11 -17
  41. package/core/tokens/m2/mat/_card.scss +15 -21
  42. package/core/tokens/m2/mat/_datepicker.scss +28 -38
  43. package/core/tokens/m2/mat/_divider.scss +5 -8
  44. package/core/tokens/m2/mat/_expansion.scss +24 -28
  45. package/core/tokens/m2/mat/_form-field.scss +21 -25
  46. package/core/tokens/m2/mat/_grid-list.scss +8 -8
  47. package/core/tokens/m2/mat/_icon.scss +3 -3
  48. package/core/tokens/m2/mat/_legacy-button-toggle.scss +15 -19
  49. package/core/tokens/m2/mat/_menu.scss +12 -17
  50. package/core/tokens/m2/mat/_optgroup.scss +12 -17
  51. package/core/tokens/m2/mat/_option.scss +16 -28
  52. package/core/tokens/m2/mat/_paginator.scss +16 -18
  53. package/core/tokens/m2/mat/_radio.scss +7 -10
  54. package/core/tokens/m2/mat/_select.scss +15 -29
  55. package/core/tokens/m2/mat/_sidenav.scss +12 -14
  56. package/core/tokens/m2/mat/_slide-toggle.scss +9 -17
  57. package/core/tokens/m2/mat/_slider.scss +5 -5
  58. package/core/tokens/m2/mat/_snack-bar.scss +7 -8
  59. package/core/tokens/m2/mat/_standard-button-toggle.scss +23 -22
  60. package/core/tokens/m2/mat/_stepper.scss +30 -33
  61. package/core/tokens/m2/mat/_tab-header-with-background.scss +6 -8
  62. package/core/tokens/m2/mat/_tab-header.scss +13 -18
  63. package/core/tokens/m2/mat/_table.scss +19 -23
  64. package/core/tokens/m2/mat/_toolbar.scss +12 -16
  65. package/core/tokens/m2/mdc/_checkbox.scss +21 -20
  66. package/core/tokens/m2/mdc/_chip.scss +38 -24
  67. package/core/tokens/m2/mdc/_circular-progress.scss +5 -6
  68. package/core/tokens/m2/mdc/_dialog.scss +16 -30
  69. package/core/tokens/m2/mdc/_elevated-card.scss +6 -9
  70. package/core/tokens/m2/mdc/_extended-fab.scss +8 -17
  71. package/core/tokens/m2/mdc/_fab.scss +6 -7
  72. package/core/tokens/m2/mdc/_filled-text-field.scss +16 -22
  73. package/core/tokens/m2/mdc/_icon-button.scss +3 -3
  74. package/core/tokens/m2/mdc/_linear-progress.scss +9 -10
  75. package/core/tokens/m2/mdc/_list.scss +44 -42
  76. package/core/tokens/m2/mdc/_outlined-card.scss +7 -10
  77. package/core/tokens/m2/mdc/_outlined-text-field.scss +14 -20
  78. package/core/tokens/m2/mdc/_plain-tooltip.scss +9 -22
  79. package/core/tokens/m2/mdc/_radio.scss +11 -11
  80. package/core/tokens/m2/mdc/_slider.scss +16 -23
  81. package/core/tokens/m2/mdc/_snack-bar.scss +10 -23
  82. package/core/tokens/m2/mdc/_switch.scss +16 -19
  83. package/core/tokens/m2/mdc/_tab-indicator.scss +5 -8
  84. package/core/tokens/m2/mdc/_tab.scss +5 -4
  85. package/core/typography/_all-typography.scss +44 -47
  86. package/core/typography/_definition.scss +258 -0
  87. package/core/typography/_property-getters.scss +63 -0
  88. package/core/typography/_typography-utils.scss +9 -69
  89. package/core/typography/_typography.scss +38 -494
  90. package/core/typography/_versioning.scss +91 -0
  91. package/datepicker/_datepicker-theme.scss +20 -34
  92. package/datepicker/index.d.ts +3 -3
  93. package/dialog/_dialog-theme.scss +22 -23
  94. package/dialog/_mdc-dialog-structure-overrides.scss +12 -10
  95. package/dialog/index.d.ts +2 -0
  96. package/divider/_divider-theme.scss +12 -18
  97. package/esm2022/autocomplete/autocomplete-trigger.mjs +5 -17
  98. package/esm2022/autocomplete/autocomplete.mjs +23 -50
  99. package/esm2022/badge/badge.mjs +11 -29
  100. package/esm2022/button/button-base.mjs +32 -27
  101. package/esm2022/button/button.mjs +6 -6
  102. package/esm2022/button/fab.mjs +23 -31
  103. package/esm2022/button/icon-button.mjs +6 -6
  104. package/esm2022/button/testing/button-harness.mjs +3 -3
  105. package/esm2022/button-toggle/button-toggle.mjs +25 -33
  106. package/esm2022/checkbox/checkbox.mjs +32 -39
  107. package/esm2022/core/option/optgroup.mjs +10 -11
  108. package/esm2022/core/option/option.mjs +6 -6
  109. package/esm2022/core/testing/option-harness.mjs +3 -3
  110. package/esm2022/core/version.mjs +1 -1
  111. package/esm2022/datepicker/calendar.mjs +1 -1
  112. package/esm2022/datepicker/datepicker-base.mjs +2 -2
  113. package/esm2022/datepicker/datepicker-toggle.mjs +1 -1
  114. package/esm2022/datepicker/month-view.mjs +2 -2
  115. package/esm2022/datepicker/multi-year-view.mjs +2 -2
  116. package/esm2022/datepicker/year-view.mjs +2 -2
  117. package/esm2022/dialog/dialog-container.mjs +16 -3
  118. package/esm2022/form-field/form-field.mjs +3 -3
  119. package/esm2022/menu/menu-item.mjs +15 -11
  120. package/esm2022/menu/menu.mjs +9 -22
  121. package/esm2022/paginator/paginator.mjs +1 -1
  122. package/esm2022/select/select.mjs +3 -3
  123. package/esm2022/slide-toggle/slide-toggle.mjs +33 -37
  124. package/esm2022/slider/slider-input.mjs +19 -9
  125. package/esm2022/slider/slider.mjs +2 -2
  126. package/esm2022/snack-bar/simple-snack-bar.mjs +1 -1
  127. package/esm2022/tabs/tab-group.mjs +3 -3
  128. package/expansion/_expansion-theme.scss +16 -24
  129. package/fesm2022/autocomplete.mjs +25 -63
  130. package/fesm2022/autocomplete.mjs.map +1 -1
  131. package/fesm2022/badge.mjs +11 -28
  132. package/fesm2022/badge.mjs.map +1 -1
  133. package/fesm2022/button/testing.mjs +2 -2
  134. package/fesm2022/button/testing.mjs.map +1 -1
  135. package/fesm2022/button-toggle.mjs +25 -32
  136. package/fesm2022/button-toggle.mjs.map +1 -1
  137. package/fesm2022/button.mjs +59 -61
  138. package/fesm2022/button.mjs.map +1 -1
  139. package/fesm2022/checkbox.mjs +31 -38
  140. package/fesm2022/checkbox.mjs.map +1 -1
  141. package/fesm2022/core/testing.mjs +2 -2
  142. package/fesm2022/core/testing.mjs.map +1 -1
  143. package/fesm2022/core.mjs +14 -13
  144. package/fesm2022/core.mjs.map +1 -1
  145. package/fesm2022/datepicker.mjs +6 -6
  146. package/fesm2022/datepicker.mjs.map +1 -1
  147. package/fesm2022/dialog.mjs +15 -2
  148. package/fesm2022/dialog.mjs.map +1 -1
  149. package/fesm2022/form-field.mjs +2 -2
  150. package/fesm2022/form-field.mjs.map +1 -1
  151. package/fesm2022/menu.mjs +23 -31
  152. package/fesm2022/menu.mjs.map +1 -1
  153. package/fesm2022/paginator.mjs +1 -1
  154. package/fesm2022/paginator.mjs.map +1 -1
  155. package/fesm2022/select.mjs +2 -2
  156. package/fesm2022/select.mjs.map +1 -1
  157. package/fesm2022/slide-toggle.mjs +33 -36
  158. package/fesm2022/slide-toggle.mjs.map +1 -1
  159. package/fesm2022/slider.mjs +20 -10
  160. package/fesm2022/slider.mjs.map +1 -1
  161. package/fesm2022/snack-bar.mjs +1 -1
  162. package/fesm2022/snack-bar.mjs.map +1 -1
  163. package/fesm2022/tabs.mjs +2 -2
  164. package/fesm2022/tabs.mjs.map +1 -1
  165. package/form-field/_form-field-density.scss +3 -4
  166. package/form-field/_form-field-focus-overlay.scss +1 -1
  167. package/form-field/_form-field-sizing.scss +1 -1
  168. package/form-field/_form-field-theme.scss +24 -34
  169. package/grid-list/_grid-list-theme.scss +12 -19
  170. package/icon/_icon-theme.scss +17 -25
  171. package/input/_input-theme.scss +11 -23
  172. package/list/_list-theme.scss +27 -42
  173. package/menu/_menu-theme.scss +13 -22
  174. package/menu/index.d.ts +12 -18
  175. package/package.json +2 -2
  176. package/paginator/_paginator-theme.scss +15 -24
  177. package/prebuilt-themes/deeppurple-amber.css +1 -1
  178. package/prebuilt-themes/indigo-pink.css +1 -1
  179. package/prebuilt-themes/pink-bluegrey.css +1 -1
  180. package/prebuilt-themes/purple-green.css +1 -1
  181. package/progress-bar/_progress-bar-theme.scss +17 -24
  182. package/progress-spinner/_progress-spinner-theme.scss +18 -24
  183. package/radio/_radio-theme.scss +23 -38
  184. package/schematics/ng-add/index.js +1 -1
  185. package/schematics/ng-add/index.mjs +1 -1
  186. package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
  187. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +1 -1
  188. package/schematics/ng-update/index_bundled.js +25 -25
  189. package/select/_select-theme.scss +17 -31
  190. package/sidenav/_sidenav-theme.scss +12 -18
  191. package/slide-toggle/_slide-toggle-theme.scss +23 -40
  192. package/slide-toggle/index.d.ts +20 -23
  193. package/slider/_slider-theme.scss +25 -42
  194. package/snack-bar/_snack-bar-theme.scss +17 -26
  195. package/sort/_sort-theme.scss +13 -22
  196. package/stepper/_stepper-theme.scss +16 -34
  197. package/table/_table-theme.scss +14 -25
  198. package/tabs/_tabs-theme.scss +31 -45
  199. package/toolbar/_toolbar-theme.scss +22 -31
  200. package/tooltip/_tooltip-theme.scss +15 -23
  201. package/tree/_tree-theme.scss +20 -29
  202. package/button-toggle/_button-toggle-variables.scss +0 -16
  203. package/core/typography/_typography-deprecated.scss +0 -39
  204. package/paginator/_paginator-variables.scss +0 -15
@@ -1,57 +1,48 @@
1
1
  @use '@material/snackbar/snackbar-theme' as mdc-snackbar-theme;
2
2
  @use '../core/theming/theming';
3
+ @use '../core/theming/inspection';
3
4
  @use '../core/style/sass-utils';
4
5
  @use '../core/typography/typography';
5
6
  @use '../core/tokens/token-utils';
6
7
  @use '../core/tokens/m2/mdc/snack-bar' as tokens-mdc-snack-bar;
7
8
  @use '../core/tokens/m2/mat/snack-bar' as tokens-mat-snack-bar;
8
9
 
9
- @mixin base($config-or-theme) {
10
+ @mixin base($theme) {
10
11
  // Add default values for tokens not related to color, typography, or density.
11
12
  @include sass-utils.current-selector-or-root() {
12
13
  @include mdc-snackbar-theme.theme(tokens-mdc-snack-bar.get-unthemable-tokens());
13
14
  }
14
15
  }
15
16
 
16
- @mixin color($config-or-theme) {
17
- $config: theming.get-color-config($config-or-theme);
18
-
19
- .mat-mdc-snack-bar-container {
20
- @include mdc-snackbar-theme.theme(tokens-mdc-snack-bar.get-color-tokens($config));
17
+ @mixin color($theme) {
18
+ @include sass-utils.current-selector-or-root() {
19
+ @include mdc-snackbar-theme.theme(tokens-mdc-snack-bar.get-color-tokens($theme));
21
20
  @include token-utils.create-token-values(
22
21
  tokens-mat-snack-bar.$prefix,
23
- tokens-mat-snack-bar.get-color-tokens($config)
22
+ tokens-mat-snack-bar.get-color-tokens($theme)
24
23
  );
25
24
  }
26
25
  }
27
26
 
28
- @mixin typography($config-or-theme) {
29
- $config: typography.private-typography-to-2018-config(
30
- theming.get-typography-config($config-or-theme));
31
-
32
- .mat-mdc-snack-bar-container {
33
- @include mdc-snackbar-theme.theme(tokens-mdc-snack-bar.get-typography-tokens($config));
27
+ @mixin typography($theme) {
28
+ @include sass-utils.current-selector-or-root() {
29
+ @include mdc-snackbar-theme.theme(tokens-mdc-snack-bar.get-typography-tokens($theme));
34
30
  }
35
31
  }
36
32
 
37
- @mixin density($config-or-theme) {}
33
+ @mixin density($theme) {}
38
34
 
39
- @mixin theme($theme-or-color-config) {
40
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
35
+ @mixin theme($theme) {
41
36
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-snack-bar') {
42
- $color: theming.get-color-config($theme);
43
- $density: theming.get-density-config($theme);
44
- $typography: theming.get-typography-config($theme);
45
-
46
37
  @include base($theme);
47
- @if $color != null {
48
- @include color($color);
38
+ @if inspection.theme-has($theme, color) {
39
+ @include color($theme);
49
40
  }
50
- @if $density != null {
51
- @include density($density);
41
+ @if inspection.theme-has($theme, density) {
42
+ @include density($theme);
52
43
  }
53
- @if $typography != null {
54
- @include typography($typography);
44
+ @if inspection.theme-has($theme, typography) {
45
+ @include typography($theme);
55
46
  }
56
47
  }
57
48
  }
@@ -1,16 +1,12 @@
1
1
  @use 'sass:color';
2
- @use 'sass:map';
3
2
  @use 'sass:meta';
4
3
  @use '../core/theming/theming';
4
+ @use '../core/theming/inspection';
5
5
 
6
- @mixin color($config-or-theme) {
7
- $config: theming.get-color-config($config-or-theme);
8
- $background: map.get($config, background);
9
- $foreground: map.get($config, foreground);
10
-
6
+ @mixin color($theme) {
11
7
  .mat-sort-header-arrow {
12
- $table-background: theming.get-color-from-palette($background, 'card');
13
- $text-color: theming.get-color-from-palette($foreground, secondary-text);
8
+ $table-background: inspection.get-theme-color($theme, background, card);
9
+ $text-color: inspection.get-theme-color($theme, foreground, secondary-text);
14
10
 
15
11
  // Because the arrow is made up of multiple elements that are stacked on top of each other,
16
12
  // we can't use the semi-transparent color from the theme directly. If the value is a color
@@ -28,25 +24,20 @@
28
24
  }
29
25
  }
30
26
 
31
- @mixin typography($config-or-theme) {}
27
+ @mixin typography($theme) {}
32
28
 
33
- @mixin density($config-or-theme) {}
29
+ @mixin density($theme) {}
34
30
 
35
- @mixin theme($theme-or-color-config) {
36
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
31
+ @mixin theme($theme) {
37
32
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-sort') {
38
- $color: theming.get-color-config($theme);
39
- $density: theming.get-density-config($theme);
40
- $typography: theming.get-typography-config($theme);
41
-
42
- @if $color != null {
43
- @include color($color);
33
+ @if inspection.theme-has($theme, color) {
34
+ @include color($theme);
44
35
  }
45
- @if $density != null {
46
- @include density($density);
36
+ @if inspection.theme-has($theme, density) {
37
+ @include density($theme);
47
38
  }
48
- @if $typography != null {
49
- @include typography($typography);
39
+ @if inspection.theme-has($theme, typography) {
40
+ @include typography($theme);
50
41
  }
51
42
  }
52
43
  }
@@ -1,69 +1,51 @@
1
- @use 'sass:map';
2
- @use 'sass:math';
3
1
  @use '../core/theming/theming';
2
+ @use '../core/theming/inspection';
4
3
  @use '../core/typography/typography';
5
- @use '../core/density/private/compatibility';
6
4
  @use '../core/style/sass-utils';
7
5
  @use '../core/tokens/token-utils';
8
6
  @use '../core/tokens/m2/mat/stepper' as tokens-mat-stepper;
9
- @use './stepper-variables';
10
-
11
- @mixin color($config-or-theme) {
12
- $config: theming.get-color-config($config-or-theme);
13
7
 
8
+ @mixin color($theme) {
14
9
  @include sass-utils.current-selector-or-root() {
15
10
  @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
16
- tokens-mat-stepper.get-color-tokens($config));
11
+ tokens-mat-stepper.get-color-tokens($theme));
17
12
 
18
13
  .mat-step-header.mat-accent {
19
14
  @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
20
- tokens-mat-stepper.private-get-color-palette-color-tokens(map.get($config, accent)));
15
+ tokens-mat-stepper.private-get-color-palette-color-tokens($theme, accent));
21
16
  }
22
17
 
23
18
  .mat-step-header.mat-warn {
24
19
  @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
25
- tokens-mat-stepper.private-get-color-palette-color-tokens(map.get($config, warn)));
20
+ tokens-mat-stepper.private-get-color-palette-color-tokens($theme, warn));
26
21
  }
27
22
  }
28
23
  }
29
24
 
30
- @mixin typography($config-or-theme) {
31
- $config: typography.private-typography-to-2014-config(
32
- theming.get-typography-config($config-or-theme));
33
-
25
+ @mixin typography($theme) {
34
26
  @include sass-utils.current-selector-or-root() {
35
27
  @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
36
- tokens-mat-stepper.get-typography-tokens($config));
28
+ tokens-mat-stepper.get-typography-tokens($theme));
37
29
  }
38
30
  }
39
31
 
40
- @mixin density($config-or-theme) {
41
- $density-scale: theming.get-density-config($config-or-theme);
42
- $height: compatibility.private-density-prop-value(stepper-variables.$density-config,
43
- $density-scale, height);
44
- $vertical-padding: math.div($height - stepper-variables.$label-header-height, 2);
45
-
32
+ @mixin density($theme) {
46
33
  @include sass-utils.current-selector-or-root() {
47
34
  @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
48
- tokens-mat-stepper.get-density-tokens($density-scale));
35
+ tokens-mat-stepper.get-density-tokens($theme));
49
36
  }
50
37
  }
51
38
 
52
- @mixin theme($theme-or-color-config) {
53
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
39
+ @mixin theme($theme) {
54
40
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-stepper') {
55
- $color: theming.get-color-config($theme);
56
- $density: theming.get-density-config($theme);
57
- $typography: theming.get-typography-config($theme);
58
-
59
- @if $color != null {
60
- @include color($color);
41
+ @if inspection.theme-has($theme, color) {
42
+ @include color($theme);
61
43
  }
62
- @if $density != null {
63
- @include density($density);
44
+ @if inspection.theme-has($theme, density) {
45
+ @include density($theme);
64
46
  }
65
- @if $typography != null {
66
- @include typography($typography);
47
+ @if inspection.theme-has($theme, typography) {
48
+ @include typography($theme);
67
49
  }
68
50
  }
69
51
  }
@@ -1,5 +1,6 @@
1
1
  @use '../core/tokens/m2/mat/table' as tokens-mat-table;
2
2
  @use '../core/theming/theming';
3
+ @use '../core/theming/inspection';
3
4
  @use '../core/typography/typography';
4
5
  @use '../core/tokens/token-utils';
5
6
 
@@ -14,49 +15,37 @@
14
15
  }
15
16
  }
16
17
 
17
- @mixin color($config-or-theme) {
18
- $config: theming.get-color-config($config-or-theme);
19
-
18
+ @mixin color($theme) {
20
19
  @include _output-tokens {
21
20
  @include token-utils.create-token-values(tokens-mat-table.$prefix,
22
- tokens-mat-table.get-color-tokens($config));
21
+ tokens-mat-table.get-color-tokens($theme));
23
22
  }
24
23
  }
25
24
 
26
- @mixin typography($config-or-theme) {
27
- $config: typography.private-typography-to-2018-config(
28
- theming.get-typography-config($config-or-theme));
29
-
25
+ @mixin typography($theme) {
30
26
  @include _output-tokens {
31
27
  @include token-utils.create-token-values(tokens-mat-table.$prefix,
32
- tokens-mat-table.get-typography-tokens($config));
28
+ tokens-mat-table.get-typography-tokens($theme));
33
29
  }
34
30
  }
35
31
 
36
- @mixin density($config-or-theme) {
37
- $density-scale: theming.get-density-config($config-or-theme);
38
-
32
+ @mixin density($theme) {
39
33
  @include _output-tokens {
40
34
  @include token-utils.create-token-values(tokens-mat-table.$prefix,
41
- tokens-mat-table.get-density-tokens($density-scale));
35
+ tokens-mat-table.get-density-tokens($theme));
42
36
  }
43
37
  }
44
38
 
45
- @mixin theme($theme-or-color-config) {
46
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
39
+ @mixin theme($theme) {
47
40
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-table') {
48
- $color: theming.get-color-config($theme);
49
- $density: theming.get-density-config($theme);
50
- $typography: theming.get-typography-config($theme);
51
-
52
- @if $color != null {
53
- @include color($color);
41
+ @if inspection.theme-has($theme, color) {
42
+ @include color($theme);
54
43
  }
55
- @if $density != null {
56
- @include density($density);
44
+ @if inspection.theme-has($theme, density) {
45
+ @include density($theme);
57
46
  }
58
- @if $typography != null {
59
- @include typography($typography);
47
+ @if inspection.theme-has($theme, typography) {
48
+ @include typography($theme);
60
49
  }
61
50
  }
62
51
  }
@@ -1,4 +1,3 @@
1
- @use 'sass:map';
2
1
  @use '@material/tab-indicator/tab-indicator-theme' as mdc-tab-indicator-theme;
3
2
  @use '@material/tab/tab-theme' as mdc-tab-theme;
4
3
  @use '../core/tokens/m2/mdc/tab' as tokens-mdc-tab;
@@ -6,99 +5,86 @@
6
5
  @use '../core/tokens/m2/mat/tab-header' as tokens-mat-tab-header;
7
6
  @use '../core/tokens/m2/mat/tab-header-with-background' as tokens-mat-tab-header-with-background;
8
7
  @use '../core/theming/theming';
8
+ @use '../core/theming/inspection';
9
9
  @use '../core/typography/typography';
10
10
  @use '../core/tokens/token-utils';
11
11
 
12
-
13
- @mixin color($config-or-theme) {
14
- $config: theming.get-color-config($config-or-theme);
15
-
12
+ @mixin color($theme) {
16
13
  .mat-mdc-tab-group, .mat-mdc-tab-nav-bar {
17
- @include _palette-styles($config, primary);
14
+ @include _palette-styles($theme, primary);
18
15
 
19
16
  &.mat-accent {
20
- @include _palette-styles($config, accent);
17
+ @include _palette-styles($theme, accent);
21
18
  }
22
19
 
23
20
  &.mat-warn {
24
- @include _palette-styles($config, warn);
21
+ @include _palette-styles($theme, warn);
25
22
  }
26
23
 
27
24
  &.mat-background-primary {
28
- @include _background-styles($config, primary);
25
+ @include _background-styles($theme, primary);
29
26
  }
30
27
 
31
28
  &.mat-background-accent {
32
- @include _background-styles($config, accent);
29
+ @include _background-styles($theme, accent);
33
30
  }
34
31
 
35
32
  &.mat-background-warn {
36
- @include _background-styles($config, warn);
33
+ @include _background-styles($theme, warn);
37
34
  }
38
35
  }
39
36
  }
40
37
 
41
- @mixin _background-styles($initial-config, $palette) {
42
- $config: map.merge($initial-config, (primary: map.get($initial-config, $palette)));
38
+ @mixin _background-styles($theme, $palette-name) {
43
39
  @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
44
- tokens-mat-tab-header-with-background.get-color-tokens($config));
40
+ tokens-mat-tab-header-with-background.get-color-tokens($theme, $palette-name));
45
41
  }
46
42
 
47
- @mixin _palette-styles($initial-config, $palette) {
48
- $config: map.merge($initial-config, (primary: map.get($initial-config, $palette)));
43
+ @mixin _palette-styles($theme, $palette-name) {
49
44
  @include mdc-tab-theme.secondary-navigation-tab-theme(
50
- tokens-mdc-tab.get-color-tokens($config));
45
+ tokens-mdc-tab.get-color-tokens($theme, $palette-name));
51
46
  @include mdc-tab-indicator-theme.theme(
52
- tokens-mdc-tab-indicator.get-color-tokens($config));
47
+ tokens-mdc-tab-indicator.get-color-tokens($theme, $palette-name));
53
48
  @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
54
- tokens-mat-tab-header.get-color-tokens($config));
49
+ tokens-mat-tab-header.get-color-tokens($theme, $palette-name));
55
50
  }
56
51
 
57
- @mixin typography($config-or-theme) {
58
- $config: typography.private-typography-to-2018-config(
59
- theming.get-typography-config($config-or-theme));
60
-
52
+ @mixin typography($theme) {
61
53
  .mat-mdc-tab-header {
62
54
  @include mdc-tab-theme.secondary-navigation-tab-theme(
63
- tokens-mdc-tab.get-typography-tokens($config));
55
+ tokens-mdc-tab.get-typography-tokens($theme));
64
56
  @include mdc-tab-indicator-theme.theme(
65
- tokens-mdc-tab-indicator.get-typography-tokens($config));
57
+ tokens-mdc-tab-indicator.get-typography-tokens($theme));
66
58
  @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
67
- tokens-mat-tab-header.get-typography-tokens($config));
59
+ tokens-mat-tab-header.get-typography-tokens($theme));
68
60
  @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
69
- tokens-mat-tab-header-with-background.get-typography-tokens($config));
61
+ tokens-mat-tab-header-with-background.get-typography-tokens($theme));
70
62
  }
71
63
  }
72
64
 
73
- @mixin density($config-or-theme) {
74
- $density-scale: theming.get-density-config($config-or-theme);
65
+ @mixin density($theme) {
75
66
  .mat-mdc-tab-header {
76
67
  @include mdc-tab-theme.secondary-navigation-tab-theme(
77
- tokens-mdc-tab.get-density-tokens($density-scale));
68
+ tokens-mdc-tab.get-density-tokens($theme));
78
69
  @include mdc-tab-indicator-theme.theme(
79
- tokens-mdc-tab-indicator.get-density-tokens($density-scale));
70
+ tokens-mdc-tab-indicator.get-density-tokens($theme));
80
71
  @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
81
- tokens-mat-tab-header.get-density-tokens($density-scale));
72
+ tokens-mat-tab-header.get-density-tokens($theme));
82
73
  @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
83
- tokens-mat-tab-header-with-background.get-density-tokens($density-scale));
74
+ tokens-mat-tab-header-with-background.get-density-tokens($theme));
84
75
  }
85
76
  }
86
77
 
87
- @mixin theme($theme-or-color-config) {
88
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
78
+ @mixin theme($theme) {
89
79
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-tabs') {
90
- $color: theming.get-color-config($theme);
91
- $density: theming.get-density-config($theme);
92
- $typography: theming.get-typography-config($theme);
93
-
94
- @if $color != null {
95
- @include color($color);
80
+ @if inspection.theme-has($theme, color) {
81
+ @include color($theme);
96
82
  }
97
- @if $density != null {
98
- @include density($density);
83
+ @if inspection.theme-has($theme, density) {
84
+ @include density($theme);
99
85
  }
100
- @if $typography != null {
101
- @include typography($typography);
86
+ @if inspection.theme-has($theme, typography) {
87
+ @include typography($theme);
102
88
  }
103
89
  }
104
90
  }
@@ -1,77 +1,68 @@
1
- @use 'sass:map';
2
1
  @use '../core/theming/theming';
2
+ @use '../core/theming/inspection';
3
3
  @use '../core/typography/typography';
4
4
  @use '../core/tokens/m2/mat/toolbar' as tokens-mat-toolbar;
5
5
  @use '../core/tokens/token-utils';
6
6
  @use '../core/style/sass-utils';
7
7
 
8
- @mixin _palette-styles($palette) {
8
+ @mixin _palette-styles($theme, $palette-name) {
9
9
  @include token-utils.create-token-values(
10
10
  tokens-mat-toolbar.$prefix,
11
11
  tokens-mat-toolbar.private-get-color-palette-color-tokens(
12
- $background-color: theming.get-color-from-palette($palette),
13
- $text-color: theming.get-color-from-palette($palette, default-contrast)
12
+ $background-color: inspection.get-theme-color($theme, $palette-name),
13
+ $text-color: inspection.get-theme-color($theme, $palette-name, default-contrast)
14
14
  )
15
15
  );
16
16
  }
17
17
 
18
- @mixin color($config-or-theme) {
19
- $config: theming.get-color-config($config-or-theme);
20
-
18
+ @mixin color($theme) {
21
19
  @include sass-utils.current-selector-or-root() {
22
20
  @include token-utils.create-token-values(tokens-mat-toolbar.$prefix,
23
- tokens-mat-toolbar.get-color-tokens($config));
21
+ tokens-mat-toolbar.get-color-tokens($theme));
24
22
  }
25
23
 
26
24
  .mat-toolbar {
27
25
  &.mat-primary {
28
- @include _palette-styles(map.get($config, primary));
26
+ @include _palette-styles($theme, primary);
29
27
  }
30
28
 
31
29
  &.mat-accent {
32
- @include _palette-styles(map.get($config, accent));
30
+ @include _palette-styles($theme, accent);
33
31
  }
34
32
 
35
33
  &.mat-warn {
36
- @include _palette-styles(map.get($config, warn));
34
+ @include _palette-styles($theme, warn);
37
35
  }
38
36
  }
39
37
  }
40
38
 
41
- @mixin typography($config-or-theme) {
42
- $config: typography.private-typography-to-2014-config(
43
- theming.get-typography-config($config-or-theme));
39
+ @mixin typography($theme) {
40
+ // TODO(mmalerba): Stop calling this and resolve resulting screen diffs.
41
+ $theme: inspection.private-get-typography-back-compat-theme($theme);
44
42
 
45
43
  @include sass-utils.current-selector-or-root() {
46
44
  @include token-utils.create-token-values(tokens-mat-toolbar.$prefix,
47
- tokens-mat-toolbar.get-typography-tokens($config));
45
+ tokens-mat-toolbar.get-typography-tokens($theme));
48
46
  }
49
47
  }
50
48
 
51
- @mixin density($config-or-theme) {
52
- $density-scale: theming.get-density-config($config-or-theme);
53
-
49
+ @mixin density($theme) {
54
50
  @include sass-utils.current-selector-or-root() {
55
51
  @include token-utils.create-token-values(tokens-mat-toolbar.$prefix,
56
- tokens-mat-toolbar.get-density-tokens($density-scale));
52
+ tokens-mat-toolbar.get-density-tokens($theme));
57
53
  }
58
54
  }
59
55
 
60
- @mixin theme($theme-or-color-config) {
61
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
56
+ @mixin theme($theme) {
62
57
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-toolbar') {
63
- $color: theming.get-color-config($theme);
64
- $density: theming.get-density-config($theme);
65
- $typography: theming.get-typography-config($theme);
66
-
67
- @if $color != null {
68
- @include color($color);
58
+ @if inspection.theme-has($theme, color) {
59
+ @include color($theme);
69
60
  }
70
- @if $density != null {
71
- @include density($density);
61
+ @if inspection.theme-has($theme, density) {
62
+ @include density($theme);
72
63
  }
73
- @if $typography != null {
74
- @include typography($typography);
64
+ @if inspection.theme-has($theme, typography) {
65
+ @include typography($theme);
75
66
  }
76
67
  }
77
68
  }
@@ -1,19 +1,19 @@
1
1
  @use '@material/tooltip/plain-tooltip-theme' as mdc-plain-tooltip-theme;
2
2
  @use '../core/style/sass-utils';
3
3
  @use '../core/theming/theming';
4
+ @use '../core/theming/inspection';
4
5
  @use '../core/typography/typography';
5
6
  @use '../core/tokens/m2/mdc/plain-tooltip' as m2-mdc-plain-tooltip;
6
7
 
7
- @mixin base($config-or-theme) {
8
+ @mixin base($theme) {
8
9
  // Add default values for tokens not related to color, typography, or density.
9
10
  @include sass-utils.current-selector-or-root() {
10
11
  @include mdc-plain-tooltip-theme.theme(m2-mdc-plain-tooltip.get-unthemable-tokens());
11
12
  }
12
13
  }
13
14
 
14
- @mixin color($config-or-theme) {
15
- $config: theming.get-color-config($config-or-theme);
16
- $mdc-tooltip-color-tokens: m2-mdc-plain-tooltip.get-color-tokens($config);
15
+ @mixin color($theme) {
16
+ $mdc-tooltip-color-tokens: m2-mdc-plain-tooltip.get-color-tokens($theme);
17
17
 
18
18
  // Add values for MDC tooltip tokens.
19
19
  @include sass-utils.current-selector-or-root() {
@@ -21,10 +21,8 @@
21
21
  }
22
22
  }
23
23
 
24
- @mixin typography($config-or-theme) {
25
- $config: typography.private-typography-to-2018-config(
26
- theming.get-typography-config($config-or-theme));
27
- $mdc-tooltip-typography-tokens: m2-mdc-plain-tooltip.get-typography-tokens($config);
24
+ @mixin typography($theme) {
25
+ $mdc-tooltip-typography-tokens: m2-mdc-plain-tooltip.get-typography-tokens($theme);
28
26
 
29
27
  // Add values for MDC tooltip tokens.
30
28
  @include sass-utils.current-selector-or-root() {
@@ -32,9 +30,8 @@
32
30
  }
33
31
  }
34
32
 
35
- @mixin density($config-or-theme) {
36
- $density-scale: theming.get-density-config($config-or-theme);
37
- $mdc-tooltip-density-tokens: m2-mdc-plain-tooltip.get-density-tokens($density-scale);
33
+ @mixin density($theme) {
34
+ $mdc-tooltip-density-tokens: m2-mdc-plain-tooltip.get-density-tokens($theme);
38
35
 
39
36
  // Add values for MDC tooltip tokens.
40
37
  @include sass-utils.current-selector-or-root() {
@@ -42,22 +39,17 @@
42
39
  }
43
40
  }
44
41
 
45
- @mixin theme($theme-or-color-config) {
46
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
42
+ @mixin theme($theme) {
47
43
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-tooltip') {
48
- $color: theming.get-color-config($theme);
49
- $density: theming.get-density-config($theme);
50
- $typography: theming.get-typography-config($theme);
51
-
52
44
  @include base($theme);
53
- @if $color != null {
54
- @include color($color);
45
+ @if inspection.theme-has($theme, color) {
46
+ @include color($theme);
55
47
  }
56
- @if $density != null {
57
- @include density($density);
48
+ @if inspection.theme-has($theme, density) {
49
+ @include density($theme);
58
50
  }
59
- @if $typography != null {
60
- @include typography($typography);
51
+ @if inspection.theme-has($theme, typography) {
52
+ @include typography($theme);
61
53
  }
62
54
  }
63
55
  }