@angular/material 19.0.0-next.8 → 19.0.0-next.9

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 (146) hide show
  1. package/_index.scss +1 -2
  2. package/autocomplete/_autocomplete-theme.scss +30 -21
  3. package/badge/_badge-theme.scss +31 -21
  4. package/bottom-sheet/_bottom-sheet-theme.scss +25 -17
  5. package/button/_button-theme.scss +220 -100
  6. package/button/_fab-theme.scss +88 -41
  7. package/button/_icon-button-theme.scss +31 -22
  8. package/button/index.d.ts +2 -2
  9. package/button-toggle/_button-toggle-theme.scss +52 -32
  10. package/card/_card-theme.scss +72 -35
  11. package/checkbox/_checkbox-theme.scss +6 -4
  12. package/chips/_chips-theme.scss +57 -27
  13. package/core/_core-theme.scss +51 -30
  14. package/core/_core.scss +1 -1
  15. package/core/option/_optgroup-theme.scss +22 -15
  16. package/core/option/_option-theme.scss +27 -18
  17. package/core/ripple/_ripple-theme.scss +26 -18
  18. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +40 -18
  19. package/core/tokens/_m3-system.scss +34 -6
  20. package/core/tokens/_token-utils.scss +91 -34
  21. package/core/tokens/m2/mat/_badge.scss +12 -3
  22. package/core/tokens/m2/mdc/_radio.scss +1 -1
  23. package/core/tokens/m3/definitions/_md-comp-elevated-card.scss +1 -1
  24. package/core/tokens/m3/mat/_badge.scss +6 -3
  25. package/datepicker/_datepicker-theme.scss +46 -29
  26. package/datepicker/index.d.ts +1 -1
  27. package/dialog/_dialog-theme.scss +39 -20
  28. package/divider/_divider-theme.scss +21 -14
  29. package/expansion/_expansion-theme.scss +29 -21
  30. package/fesm2022/autocomplete.mjs +14 -16
  31. package/fesm2022/autocomplete.mjs.map +1 -1
  32. package/fesm2022/badge.mjs +11 -12
  33. package/fesm2022/badge.mjs.map +1 -1
  34. package/fesm2022/bottom-sheet.mjs +11 -11
  35. package/fesm2022/bottom-sheet.mjs.map +1 -1
  36. package/fesm2022/button-toggle.mjs +11 -12
  37. package/fesm2022/button-toggle.mjs.map +1 -1
  38. package/fesm2022/button.mjs +42 -42
  39. package/fesm2022/button.mjs.map +1 -1
  40. package/fesm2022/card.mjs +49 -60
  41. package/fesm2022/card.mjs.map +1 -1
  42. package/fesm2022/checkbox.mjs +16 -17
  43. package/fesm2022/checkbox.mjs.map +1 -1
  44. package/fesm2022/chips.mjs +48 -54
  45. package/fesm2022/chips.mjs.map +1 -1
  46. package/fesm2022/core.mjs +71 -73
  47. package/fesm2022/core.mjs.map +1 -1
  48. package/fesm2022/datepicker.mjs +95 -105
  49. package/fesm2022/datepicker.mjs.map +1 -1
  50. package/fesm2022/dialog/testing.mjs +0 -1
  51. package/fesm2022/dialog/testing.mjs.map +1 -1
  52. package/fesm2022/dialog.mjs +28 -33
  53. package/fesm2022/dialog.mjs.map +1 -1
  54. package/fesm2022/divider.mjs +8 -8
  55. package/fesm2022/divider.mjs.map +1 -1
  56. package/fesm2022/expansion.mjs +28 -33
  57. package/fesm2022/expansion.mjs.map +1 -1
  58. package/fesm2022/form-field.mjs +38 -45
  59. package/fesm2022/form-field.mjs.map +1 -1
  60. package/fesm2022/grid-list.mjs +26 -29
  61. package/fesm2022/grid-list.mjs.map +1 -1
  62. package/fesm2022/icon/testing.mjs +7 -7
  63. package/fesm2022/icon/testing.mjs.map +1 -1
  64. package/fesm2022/icon.mjs +11 -11
  65. package/fesm2022/icon.mjs.map +1 -1
  66. package/fesm2022/input.mjs +7 -8
  67. package/fesm2022/input.mjs.map +1 -1
  68. package/fesm2022/list.mjs +57 -66
  69. package/fesm2022/list.mjs.map +1 -1
  70. package/fesm2022/menu.mjs +18 -20
  71. package/fesm2022/menu.mjs.map +1 -1
  72. package/fesm2022/paginator.mjs +11 -11
  73. package/fesm2022/paginator.mjs.map +1 -1
  74. package/fesm2022/progress-bar.mjs +8 -8
  75. package/fesm2022/progress-bar.mjs.map +1 -1
  76. package/fesm2022/progress-spinner.mjs +8 -8
  77. package/fesm2022/progress-spinner.mjs.map +1 -1
  78. package/fesm2022/radio.mjs +11 -12
  79. package/fesm2022/radio.mjs.map +1 -1
  80. package/fesm2022/select.mjs +12 -13
  81. package/fesm2022/select.mjs.map +1 -1
  82. package/fesm2022/sidenav.mjs +28 -30
  83. package/fesm2022/sidenav.mjs.map +1 -1
  84. package/fesm2022/slide-toggle.mjs +16 -17
  85. package/fesm2022/slide-toggle.mjs.map +1 -1
  86. package/fesm2022/slider.mjs +18 -20
  87. package/fesm2022/slider.mjs.map +1 -1
  88. package/fesm2022/snack-bar.mjs +25 -28
  89. package/fesm2022/snack-bar.mjs.map +1 -1
  90. package/fesm2022/sort.mjs +14 -15
  91. package/fesm2022/sort.mjs.map +1 -1
  92. package/fesm2022/stepper.mjs +34 -39
  93. package/fesm2022/stepper.mjs.map +1 -1
  94. package/fesm2022/table.mjs +57 -73
  95. package/fesm2022/table.mjs.map +1 -1
  96. package/fesm2022/tabs.mjs +51 -56
  97. package/fesm2022/tabs.mjs.map +1 -1
  98. package/fesm2022/timepicker.mjs +17 -18
  99. package/fesm2022/timepicker.mjs.map +1 -1
  100. package/fesm2022/toolbar.mjs +11 -12
  101. package/fesm2022/toolbar.mjs.map +1 -1
  102. package/fesm2022/tooltip.mjs +11 -12
  103. package/fesm2022/tooltip.mjs.map +1 -1
  104. package/fesm2022/tree.mjs +26 -32
  105. package/fesm2022/tree.mjs.map +1 -1
  106. package/form-field/_form-field-theme.scss +105 -56
  107. package/form-field/index.d.ts +1 -1
  108. package/grid-list/_grid-list-theme.scss +18 -12
  109. package/icon/_icon-theme.scss +15 -11
  110. package/input/_input-theme.scss +11 -8
  111. package/list/_list-theme.scss +82 -44
  112. package/menu/_menu-theme.scss +26 -18
  113. package/package.json +2 -2
  114. package/paginator/_paginator-theme.scss +32 -20
  115. package/prebuilt-themes/azure-blue.css +1 -1
  116. package/prebuilt-themes/cyan-orange.css +1 -1
  117. package/prebuilt-themes/deeppurple-amber.css +1 -1
  118. package/prebuilt-themes/indigo-pink.css +1 -1
  119. package/prebuilt-themes/magenta-violet.css +1 -1
  120. package/prebuilt-themes/pink-bluegrey.css +1 -1
  121. package/prebuilt-themes/purple-green.css +1 -1
  122. package/prebuilt-themes/rose-red.css +1 -1
  123. package/progress-bar/_progress-bar-theme.scss +13 -11
  124. package/progress-spinner/_progress-spinner-theme.scss +34 -20
  125. package/radio/_radio-theme.scss +50 -26
  126. package/schematics/collection.json +3 -3
  127. package/schematics/ng-add/index.js +1 -1
  128. package/schematics/ng-add/index.mjs +1 -1
  129. package/schematics/ng-generate/{m3-theme → theme-color}/index_bundled.js +454 -288
  130. package/schematics/ng-generate/theme-color/index_bundled.js.map +7 -0
  131. package/schematics/ng-generate/{m3-theme → theme-color}/schema.json +7 -13
  132. package/select/_select-theme.scss +31 -22
  133. package/sidenav/_sidenav-theme.scss +21 -14
  134. package/slide-toggle/_slide-toggle-theme.scss +42 -22
  135. package/slider/_slider-theme.scss +55 -35
  136. package/snack-bar/_snack-bar-theme.scss +22 -14
  137. package/sort/_sort-theme.scss +26 -18
  138. package/stepper/_stepper-theme.scss +33 -24
  139. package/table/_table-theme.scss +29 -20
  140. package/tabs/_tabs-theme.scss +89 -46
  141. package/tabs/index.d.ts +2 -2
  142. package/timepicker/_timepicker-theme.scss +30 -21
  143. package/toolbar/_toolbar-theme.scss +28 -19
  144. package/tooltip/_tooltip-theme.scss +11 -12
  145. package/tree/_tree-theme.scss +26 -18
  146. package/schematics/ng-generate/m3-theme/index_bundled.js.map +0 -7
@@ -18,15 +18,16 @@
18
18
  @mixin base($theme) {
19
19
  @if inspection.get-theme-version($theme) == 1 {
20
20
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
21
- }
22
- @else {
21
+ } @else {
23
22
  @include ripple-theme.base($theme);
24
23
  @include option-theme.base($theme);
25
24
  @include optgroup-theme.base($theme);
26
25
  @include pseudo-checkbox-theme.base($theme);
27
26
  @include sass-utils.current-selector-or-root() {
28
- @include token-utils.create-token-values(tokens-mat-app.$prefix,
29
- tokens-mat-app.get-unthemable-tokens());
27
+ @include token-utils.create-token-values(
28
+ tokens-mat-app.$prefix,
29
+ tokens-mat-app.get-unthemable-tokens()
30
+ );
30
31
  }
31
32
  }
32
33
  }
@@ -34,15 +35,16 @@
34
35
  @mixin color($theme) {
35
36
  @if inspection.get-theme-version($theme) == 1 {
36
37
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
37
- }
38
- @else {
38
+ } @else {
39
39
  @include ripple-theme.color($theme);
40
40
  @include option-theme.color($theme);
41
41
  @include optgroup-theme.color($theme);
42
42
  @include pseudo-checkbox-theme.color($theme);
43
43
  @include sass-utils.current-selector-or-root() {
44
- @include token-utils.create-token-values(tokens-mat-app.$prefix,
45
- tokens-mat-app.get-color-tokens($theme));
44
+ @include token-utils.create-token-values(
45
+ tokens-mat-app.$prefix,
46
+ tokens-mat-app.get-color-tokens($theme)
47
+ );
46
48
  }
47
49
  }
48
50
  }
@@ -50,8 +52,7 @@
50
52
  @mixin typography($theme) {
51
53
  @if inspection.get-theme-version($theme) == 1 {
52
54
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
53
- }
54
- @else {
55
+ } @else {
55
56
  @include option-theme.typography($theme);
56
57
  @include optgroup-theme.typography($theme);
57
58
  @include pseudo-checkbox-theme.typography($theme);
@@ -62,8 +63,7 @@
62
63
  @mixin density($theme) {
63
64
  @if inspection.get-theme-version($theme) == 1 {
64
65
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
65
- }
66
- @else {
66
+ } @else {
67
67
  @include option-theme.density($theme);
68
68
  @include optgroup-theme.density($theme);
69
69
  @include pseudo-checkbox-theme.density($theme);
@@ -84,11 +84,19 @@
84
84
  $minimal-pseudo-checkbox-tokens: tokens-mat-minimal-pseudo-checkbox.get-token-slots();
85
85
 
86
86
  @return (
87
- (prefix: tokens-mat-app.$prefix, tokens: $app-tokens),
88
- (prefix: tokens-mat-ripple.$prefix, tokens: $ripple-tokens),
89
- (prefix: tokens-mat-option.$prefix, tokens: $option-tokens),
90
- (prefix: tokens-mat-full-pseudo-checkbox.$prefix, tokens: $full-pseudo-checkbox-tokens),
91
- (prefix: tokens-mat-minimal-pseudo-checkbox.$prefix, tokens: $minimal-pseudo-checkbox-tokens),
87
+ (namespace: tokens-mat-app.$prefix, tokens: $app-tokens, prefix: 'app-'),
88
+ (namespace: tokens-mat-ripple.$prefix, tokens: $ripple-tokens, prefix: 'ripple-'),
89
+ (namespace: tokens-mat-option.$prefix, tokens: $option-tokens, prefix: 'option-'),
90
+ (
91
+ namespace: tokens-mat-full-pseudo-checkbox.$prefix,
92
+ tokens: $full-pseudo-checkbox-tokens,
93
+ prefix: 'pseudo-checkbox-full-'
94
+ ),
95
+ (
96
+ namespace: tokens-mat-minimal-pseudo-checkbox.$prefix,
97
+ tokens: $minimal-pseudo-checkbox-tokens,
98
+ prefix: 'pseudo-checkbox-minimal-'
99
+ )
92
100
  );
93
101
  }
94
102
 
@@ -104,8 +112,7 @@
104
112
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-core') {
105
113
  @if inspection.get-theme-version($theme) == 1 {
106
114
  @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
107
- }
108
- @else {
115
+ } @else {
109
116
  @include base($theme);
110
117
  @if inspection.theme-has($theme, color) {
111
118
  @include color($theme);
@@ -122,23 +129,37 @@
122
129
 
123
130
  @mixin _theme-from-tokens($tokens, $options...) {
124
131
  @include validation.selector-defined(
125
- 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector');
132
+ 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector'
133
+ );
126
134
  $mat-app-tokens: token-utils.get-tokens-for($tokens, tokens-mat-app.$prefix, $options...);
127
135
  $mat-ripple-tokens: token-utils.get-tokens-for($tokens, tokens-mat-ripple.$prefix, $options...);
128
136
  $mat-option-tokens: token-utils.get-tokens-for($tokens, tokens-mat-option.$prefix, $options...);
129
- $mat-optgroup-tokens:
130
- token-utils.get-tokens-for($tokens, tokens-mat-optgroup.$prefix, $options...);
131
- $mat-full-pseudo-checkbox-tokens: token-utils.get-tokens-for($tokens,
132
- tokens-mat-full-pseudo-checkbox.$prefix, $options...);
133
- $mat-minimal-pseudo-checkbox-tokens: token-utils.get-tokens-for($tokens,
134
- tokens-mat-minimal-pseudo-checkbox.$prefix, $options...);
137
+ $mat-optgroup-tokens: token-utils.get-tokens-for(
138
+ $tokens,
139
+ tokens-mat-optgroup.$prefix,
140
+ $options...
141
+ );
142
+ $mat-full-pseudo-checkbox-tokens: token-utils.get-tokens-for(
143
+ $tokens,
144
+ tokens-mat-full-pseudo-checkbox.$prefix,
145
+ $options...
146
+ );
147
+ $mat-minimal-pseudo-checkbox-tokens: token-utils.get-tokens-for(
148
+ $tokens,
149
+ tokens-mat-minimal-pseudo-checkbox.$prefix,
150
+ $options...
151
+ );
135
152
 
136
153
  @include token-utils.create-token-values(tokens-mat-app.$prefix, $mat-app-tokens);
137
154
  @include token-utils.create-token-values(tokens-mat-ripple.$prefix, $mat-ripple-tokens);
138
155
  @include token-utils.create-token-values(tokens-mat-option.$prefix, $mat-option-tokens);
139
156
  @include token-utils.create-token-values(tokens-mat-optgroup.$prefix, $mat-optgroup-tokens);
140
- @include token-utils.create-token-values(tokens-mat-full-pseudo-checkbox.$prefix,
141
- $mat-full-pseudo-checkbox-tokens);
142
- @include token-utils.create-token-values(tokens-mat-minimal-pseudo-checkbox.$prefix,
143
- $mat-minimal-pseudo-checkbox-tokens);
157
+ @include token-utils.create-token-values(
158
+ tokens-mat-full-pseudo-checkbox.$prefix,
159
+ $mat-full-pseudo-checkbox-tokens
160
+ );
161
+ @include token-utils.create-token-values(
162
+ tokens-mat-minimal-pseudo-checkbox.$prefix,
163
+ $mat-minimal-pseudo-checkbox-tokens
164
+ );
144
165
  }
package/core/_core.scss CHANGED
@@ -16,7 +16,7 @@
16
16
  // background color. However, if it isn't defined anywhere, then MSS
17
17
  // complains in its verification stage.
18
18
  html {
19
- --mat-app-on-surface: initial;
19
+ --mat-sys-on-surface: initial;
20
20
  }
21
21
 
22
22
  // Wrapper element that provides the theme background when the
@@ -10,18 +10,19 @@
10
10
  @mixin base($theme) {
11
11
  @if inspection.get-theme-version($theme) == 1 {
12
12
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
13
+ } @else {
13
14
  }
14
- @else {}
15
15
  }
16
16
 
17
17
  @mixin color($theme) {
18
18
  @if inspection.get-theme-version($theme) == 1 {
19
19
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
20
- }
21
- @else {
20
+ } @else {
22
21
  @include sass-utils.current-selector-or-root() {
23
- @include token-utils.create-token-values(tokens-mat-optgroup.$prefix,
24
- tokens-mat-optgroup.get-color-tokens($theme));
22
+ @include token-utils.create-token-values(
23
+ tokens-mat-optgroup.$prefix,
24
+ tokens-mat-optgroup.get-color-tokens($theme)
25
+ );
25
26
  }
26
27
  }
27
28
  }
@@ -29,11 +30,12 @@
29
30
  @mixin typography($theme) {
30
31
  @if inspection.get-theme-version($theme) == 1 {
31
32
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
32
- }
33
- @else {
33
+ } @else {
34
34
  @include sass-utils.current-selector-or-root() {
35
- @include token-utils.create-token-values(tokens-mat-optgroup.$prefix,
36
- tokens-mat-optgroup.get-typography-tokens($theme));
35
+ @include token-utils.create-token-values(
36
+ tokens-mat-optgroup.$prefix,
37
+ tokens-mat-optgroup.get-typography-tokens($theme)
38
+ );
37
39
  }
38
40
  }
39
41
  }
@@ -41,14 +43,17 @@
41
43
  @mixin density($theme) {
42
44
  @if inspection.get-theme-version($theme) == 1 {
43
45
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
46
+ } @else {
44
47
  }
45
- @else {}
46
48
  }
47
49
 
48
50
  @mixin overrides($tokens: ()) {
49
51
  @include token-utils.batch-create-token-values(
50
52
  $tokens,
51
- (prefix: tokens-mat-optgroup.$prefix, tokens: tokens-mat-optgroup.get-token-slots()),
53
+ (
54
+ namespace: tokens-mat-optgroup.$prefix,
55
+ tokens: tokens-mat-optgroup.get-token-slots(),
56
+ )
52
57
  );
53
58
  }
54
59
 
@@ -56,8 +61,7 @@
56
61
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-optgroup') {
57
62
  @if inspection.get-theme-version($theme) == 1 {
58
63
  @include _theme-from-tokens(inspection.get-theme-tokens($theme));
59
- }
60
- @else {
64
+ } @else {
61
65
  @include base($theme);
62
66
  @if inspection.theme-has($theme, color) {
63
67
  @include color($theme);
@@ -74,9 +78,12 @@
74
78
 
75
79
  @mixin _theme-from-tokens($tokens) {
76
80
  @include validation.selector-defined(
77
- 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector');
81
+ 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector'
82
+ );
78
83
  @if ($tokens != ()) {
79
84
  @include token-utils.create-token-values(
80
- tokens-mat-optgroup.$prefix, map.get($tokens, tokens-mat-optgroup.$prefix));
85
+ tokens-mat-optgroup.$prefix,
86
+ map.get($tokens, tokens-mat-optgroup.$prefix)
87
+ );
81
88
  }
82
89
  }
@@ -12,8 +12,8 @@
12
12
  @mixin base($theme) {
13
13
  @if inspection.get-theme-version($theme) == 1 {
14
14
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
15
+ } @else {
15
16
  }
16
- @else {}
17
17
  }
18
18
 
19
19
  /// Outputs color theme styles for the mat-option.
@@ -24,21 +24,26 @@
24
24
  @mixin color($theme, $options...) {
25
25
  @if inspection.get-theme-version($theme) == 1 {
26
26
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
27
- }
28
- @else {
27
+ } @else {
29
28
  @include sass-utils.current-selector-or-root() {
30
- @include token-utils.create-token-values(tokens-mat-option.$prefix,
31
- tokens-mat-option.get-color-tokens($theme));
29
+ @include token-utils.create-token-values(
30
+ tokens-mat-option.$prefix,
31
+ tokens-mat-option.get-color-tokens($theme)
32
+ );
32
33
  }
33
34
 
34
35
  .mat-accent {
35
- @include token-utils.create-token-values(tokens-mat-option.$prefix,
36
- tokens-mat-option.get-color-tokens($theme, accent));
36
+ @include token-utils.create-token-values(
37
+ tokens-mat-option.$prefix,
38
+ tokens-mat-option.get-color-tokens($theme, accent)
39
+ );
37
40
  }
38
41
 
39
42
  .mat-warn {
40
- @include token-utils.create-token-values(tokens-mat-option.$prefix,
41
- tokens-mat-option.get-color-tokens($theme, warn));
43
+ @include token-utils.create-token-values(
44
+ tokens-mat-option.$prefix,
45
+ tokens-mat-option.get-color-tokens($theme, warn)
46
+ );
42
47
  }
43
48
  }
44
49
  }
@@ -48,11 +53,12 @@
48
53
  @mixin typography($theme) {
49
54
  @if inspection.get-theme-version($theme) == 1 {
50
55
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
51
- }
52
- @else {
56
+ } @else {
53
57
  @include sass-utils.current-selector-or-root() {
54
- @include token-utils.create-token-values(tokens-mat-option.$prefix,
55
- tokens-mat-option.get-typography-tokens($theme));
58
+ @include token-utils.create-token-values(
59
+ tokens-mat-option.$prefix,
60
+ tokens-mat-option.get-typography-tokens($theme)
61
+ );
56
62
  }
57
63
  }
58
64
  }
@@ -62,8 +68,8 @@
62
68
  @mixin density($theme) {
63
69
  @if inspection.get-theme-version($theme) == 1 {
64
70
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
71
+ } @else {
65
72
  }
66
- @else {}
67
73
  }
68
74
 
69
75
  /// Outputs the CSS variable values for the given tokens.
@@ -71,7 +77,10 @@
71
77
  @mixin overrides($tokens: ()) {
72
78
  @include token-utils.batch-create-token-values(
73
79
  $tokens,
74
- (prefix: tokens-mat-option.$prefix, tokens: tokens-mat-option.get-token-slots()),
80
+ (
81
+ namespace: tokens-mat-option.$prefix,
82
+ tokens: tokens-mat-option.get-token-slots(),
83
+ )
75
84
  );
76
85
  }
77
86
 
@@ -84,8 +93,7 @@
84
93
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-option') {
85
94
  @if inspection.get-theme-version($theme) == 1 {
86
95
  @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
87
- }
88
- @else {
96
+ } @else {
89
97
  @include base($theme);
90
98
  @if inspection.theme-has($theme, color) {
91
99
  @include color($theme);
@@ -102,7 +110,8 @@
102
110
 
103
111
  @mixin _theme-from-tokens($tokens, $options...) {
104
112
  @include validation.selector-defined(
105
- 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector');
113
+ 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector'
114
+ );
106
115
  $mat-option-tokens: token-utils.get-tokens-for($tokens, tokens-mat-option.$prefix, $options...);
107
116
  @include token-utils.create-token-values(tokens-mat-option.$prefix, $mat-option-tokens);
108
117
  }
@@ -9,18 +9,19 @@
9
9
  @mixin base($theme) {
10
10
  @if inspection.get-theme-version($theme) == 1 {
11
11
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
12
+ } @else {
12
13
  }
13
- @else {}
14
14
  }
15
15
 
16
16
  @mixin color($theme) {
17
17
  @if inspection.get-theme-version($theme) == 1 {
18
18
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
19
- }
20
- @else {
19
+ } @else {
21
20
  @include sass-utils.current-selector-or-root() {
22
- @include token-utils.create-token-values(tokens-mat-ripple.$prefix,
23
- tokens-mat-ripple.get-color-tokens($theme));
21
+ @include token-utils.create-token-values(
22
+ tokens-mat-ripple.$prefix,
23
+ tokens-mat-ripple.get-color-tokens($theme)
24
+ );
24
25
  }
25
26
  }
26
27
  }
@@ -28,11 +29,12 @@
28
29
  @mixin typography($theme) {
29
30
  @if inspection.get-theme-version($theme) == 1 {
30
31
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
31
- }
32
- @else {
32
+ } @else {
33
33
  @include sass-utils.current-selector-or-root() {
34
- @include token-utils.create-token-values(tokens-mat-ripple.$prefix,
35
- tokens-mat-ripple.get-typography-tokens($theme));
34
+ @include token-utils.create-token-values(
35
+ tokens-mat-ripple.$prefix,
36
+ tokens-mat-ripple.get-typography-tokens($theme)
37
+ );
36
38
  }
37
39
  }
38
40
  }
@@ -40,11 +42,12 @@
40
42
  @mixin density($theme) {
41
43
  @if inspection.get-theme-version($theme) == 1 {
42
44
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
43
- }
44
- @else {
45
+ } @else {
45
46
  @include sass-utils.current-selector-or-root() {
46
- @include token-utils.create-token-values(tokens-mat-ripple.$prefix,
47
- tokens-mat-ripple.get-density-tokens($theme));
47
+ @include token-utils.create-token-values(
48
+ tokens-mat-ripple.$prefix,
49
+ tokens-mat-ripple.get-density-tokens($theme)
50
+ );
48
51
  }
49
52
  }
50
53
  }
@@ -52,7 +55,10 @@
52
55
  @mixin overrides($tokens: ()) {
53
56
  @include token-utils.batch-create-token-values(
54
57
  $tokens,
55
- (prefix: tokens-mat-ripple.$prefix, tokens: tokens-mat-ripple.get-token-slots()),
58
+ (
59
+ namespace: tokens-mat-ripple.$prefix,
60
+ tokens: tokens-mat-ripple.get-token-slots(),
61
+ )
56
62
  );
57
63
  }
58
64
 
@@ -60,8 +66,7 @@
60
66
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-ripple') {
61
67
  @if inspection.get-theme-version($theme) == 1 {
62
68
  @include _theme-from-tokens(inspection.get-theme-tokens($theme));
63
- }
64
- @else {
69
+ } @else {
65
70
  @include base($theme);
66
71
  @if inspection.theme-has($theme, color) {
67
72
  @include color($theme);
@@ -78,9 +83,12 @@
78
83
 
79
84
  @mixin _theme-from-tokens($tokens) {
80
85
  @include validation.selector-defined(
81
- 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector');
86
+ 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector'
87
+ );
82
88
  @if ($tokens != ()) {
83
89
  @include token-utils.create-token-values(
84
- tokens-mat-ripple.$prefix, map.get($tokens, tokens-mat-ripple.$prefix));
90
+ tokens-mat-ripple.$prefix,
91
+ map.get($tokens, tokens-mat-ripple.$prefix)
92
+ );
85
93
  }
86
94
  }
@@ -8,30 +8,46 @@
8
8
 
9
9
  @mixin _palette-styles($theme, $palette-name) {
10
10
  @include sass-utils.current-selector-or-root() {
11
- @include token-utils.create-token-values(tokens-mat-full-pseudo-checkbox.$prefix,
12
- tokens-mat-full-pseudo-checkbox.get-color-tokens($theme, $palette-name));
13
- @include token-utils.create-token-values(tokens-mat-minimal-pseudo-checkbox.$prefix,
14
- tokens-mat-minimal-pseudo-checkbox.get-color-tokens($theme, $palette-name));
11
+ @include token-utils.create-token-values(
12
+ tokens-mat-full-pseudo-checkbox.$prefix,
13
+ tokens-mat-full-pseudo-checkbox.get-color-tokens($theme, $palette-name)
14
+ );
15
+ @include token-utils.create-token-values(
16
+ tokens-mat-minimal-pseudo-checkbox.$prefix,
17
+ tokens-mat-minimal-pseudo-checkbox.get-color-tokens($theme, $palette-name)
18
+ );
15
19
  }
16
20
  }
17
21
 
18
22
  @mixin _theme-from-tokens($tokens, $options...) {
19
23
  @include validation.selector-defined(
20
- 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector');
21
- $mat-full-pseudo-checkbox-tokens:
22
- token-utils.get-tokens-for($tokens, tokens-mat-full-pseudo-checkbox.$prefix, $options...);
23
- $mat-minimal-pseudo-checkbox-tokens:
24
- token-utils.get-tokens-for($tokens, tokens-mat-minimal-pseudo-checkbox.$prefix, $options...);
24
+ 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector'
25
+ );
26
+ $mat-full-pseudo-checkbox-tokens: token-utils.get-tokens-for(
27
+ $tokens,
28
+ tokens-mat-full-pseudo-checkbox.$prefix,
29
+ $options...
30
+ );
31
+ $mat-minimal-pseudo-checkbox-tokens: token-utils.get-tokens-for(
32
+ $tokens,
33
+ tokens-mat-minimal-pseudo-checkbox.$prefix,
34
+ $options...
35
+ );
25
36
  @include token-utils.create-token-values(
26
- tokens-mat-full-pseudo-checkbox.$prefix, $mat-full-pseudo-checkbox-tokens);
37
+ tokens-mat-full-pseudo-checkbox.$prefix,
38
+ $mat-full-pseudo-checkbox-tokens
39
+ );
27
40
  @include token-utils.create-token-values(
28
- tokens-mat-minimal-pseudo-checkbox.$prefix, $mat-minimal-pseudo-checkbox-tokens);
41
+ tokens-mat-minimal-pseudo-checkbox.$prefix,
42
+ $mat-minimal-pseudo-checkbox-tokens
43
+ );
29
44
  }
30
45
 
31
46
  /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
32
47
  /// for the mat-pseudo-checkbox.
33
48
  /// @param {Map} $theme The theme to generate base styles for.
34
- @mixin base($theme) {}
49
+ @mixin base($theme) {
50
+ }
35
51
 
36
52
  /// Outputs the CSS variable values for the given tokens.
37
53
  /// @param {Map} $tokens The token values to emit.
@@ -41,8 +57,16 @@
41
57
 
42
58
  @include token-utils.batch-create-token-values(
43
59
  $tokens,
44
- (prefix: tokens-mat-full-pseudo-checkbox.$prefix, tokens: $full-pseudo-checkbox-tokens),
45
- (prefix: tokens-mat-minimal-pseudo-checkbox.$prefix, tokens: $minimal-pseudo-checkbox-tokens),
60
+ (
61
+ namespace: tokens-mat-full-pseudo-checkbox.$prefix,
62
+ tokens: $full-pseudo-checkbox-tokens,
63
+ prefix: 'full-',
64
+ ),
65
+ (
66
+ namespace: tokens-mat-minimal-pseudo-checkbox.$prefix,
67
+ tokens: $minimal-pseudo-checkbox-tokens,
68
+ prefix: 'minimal-',
69
+ )
46
70
  );
47
71
  }
48
72
 
@@ -54,8 +78,7 @@
54
78
  @mixin color($theme, $options...) {
55
79
  @if inspection.get-theme-version($theme) == 1 {
56
80
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
57
- }
58
- @else {
81
+ } @else {
59
82
  // Default to the accent color. Note that the pseudo checkboxes are meant to inherit the
60
83
  // theme from their parent, rather than implementing their own theming, which is why we
61
84
  // don't attach to the `mat-*` classes. Also note that this needs to be below `.mat-primary`
@@ -96,8 +119,7 @@
96
119
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-pseudo-checkbox') {
97
120
  @if inspection.get-theme-version($theme) == 1 {
98
121
  @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
99
- }
100
- @else {
122
+ } @else {
101
123
  @include base($theme);
102
124
  @if inspection.theme-has($theme, color) {
103
125
  @include color($theme);
@@ -8,8 +8,8 @@
8
8
  @use './m3-tokens';
9
9
 
10
10
  // Prefix used for component token fallback variables, e.g.
11
- // `color: var(--mdc-text-button-label-text-color, var(--mat-app-primary));`
12
- $_system-fallback-prefix: mat-app;
11
+ // `color: var(--mdc-text-button-label-text-color, var(--mat-sys-primary));`
12
+ $_system-fallback-prefix: mat-sys;
13
13
 
14
14
  // Default system level prefix to use when directly calling the `system-level-*` mixins
15
15
  $_system-level-prefix: sys;
@@ -36,8 +36,8 @@ $_system-level-prefix: sys;
36
36
  /// if the density value is a map, it must have a `scale` value. Density variable definitions will
37
37
  /// not be emitted if there are no density values in the config.
38
38
  ///
39
- /// The application variables emitted use the namespace prefix "--mat-app".
40
- /// e.g. --mat-app-surface: #E5E5E5
39
+ /// The application variables emitted use the namespace prefix "--mat-sys".
40
+ /// e.g. --mat-sys-surface: #E5E5E5
41
41
  ///
42
42
  /// @param {Map} $config The color configuration with optional keys color, typography, or density.
43
43
  @mixin theme($config, $overrides: ()) {
@@ -84,6 +84,25 @@ $_system-level-prefix: sys;
84
84
  @include system-level-state($overrides: $overrides, $prefix: $_system-fallback-prefix);
85
85
  }
86
86
 
87
+ /// Emits the system-level CSS variables for each of the provided override values. E.g. to
88
+ /// change the primary color to red, use `mat.theme-overrides((primary: red));`
89
+ @mixin theme-overrides($overrides, $prefix: $_system-fallback-prefix) {
90
+ $sys-names: map-merge-all(
91
+ definitions.md-sys-color-values-light(),
92
+ definitions.md-sys-typescale-values(),
93
+ definitions.md-sys-elevation-values(),
94
+ definitions.md-sys-shape-values(),
95
+ definitions.md-sys-state-values());
96
+
97
+ & {
98
+ @each $name, $value in $overrides {
99
+ @if (map.has-key($sys-names, $name)) {
100
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name)};
101
+ }
102
+ }
103
+ }
104
+ }
105
+
87
106
  @mixin system-level-colors($theme, $overrides: (), $prefix: null) {
88
107
  $palettes: map.get($theme, _mat-theming-internals-do-not-access, palettes);
89
108
  $base-palettes: (
@@ -186,8 +205,8 @@ $_system-level-prefix: sys;
186
205
  }
187
206
 
188
207
  // Return a new map where the values are the same as the provided map's
189
- // keys, prefixed with "--mat-app-". For example:
190
- // (key1: '', key2: '') --> (key1: --mat-app-key1, key2: --mat-app-key2)
208
+ // keys, prefixed with "--mat-sys-". For example:
209
+ // (key1: '', key2: '') --> (key1: --mat-sys-key1, key2: --mat-sys-key2)
191
210
  @function _create-system-app-vars-map($map) {
192
211
  $new-map: ();
193
212
  @each $key, $value in $map {
@@ -226,3 +245,12 @@ $_system-level-prefix: sys;
226
245
  m3-tokens.generate-density-tokens(0)
227
246
  );
228
247
  }
248
+
249
+ /// Creates a single merged map from the provided variable-length map arguments
250
+ @function map-merge-all($maps...) {
251
+ $result: ();
252
+ @each $map in $maps {
253
+ $result: map.merge($result, $map);
254
+ }
255
+ @return $result;
256
+ }