@angular/material 20.0.0-next.9 → 20.0.0-rc.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.
- package/badge/_badge-theme.scss +27 -14
- package/badge/_m3-badge.scss +39 -67
- package/badge/index.d.ts +2 -2
- package/badge/testing/index.d.ts +1 -1
- package/{badge.d-D0iThVg0.d.ts → badge.d-Cn81aRz4.d.ts} +2 -2
- package/button/index.d.ts +4 -4
- package/button-toggle/_m3-button-toggle.scss +1 -1
- package/checkbox/index.d.ts +4 -4
- package/checkbox/testing/index.d.ts +1 -1
- package/chips/index.d.ts +2 -2
- package/chips/testing/index.d.ts +1 -1
- package/core/color/_all-color.scss +1 -1
- package/core/m2/_typography.scss +1 -1
- package/core/theming/_all-theme.scss +41 -0
- package/core/theming/_color-api-backwards-compatibility.scss +3 -6
- package/core/theming/_definition.scss +72 -72
- package/core/theming/_inspection.scss +24 -22
- package/core/theming/_theming.scss +2 -2
- package/core/tokens/_m3-system.scss +112 -69
- package/core/tokens/_m3-tokens.scss +30 -226
- package/core/tokens/_m3-utils.scss +35 -0
- package/core/tokens/_token-utils.scss +22 -1
- package/core/tokens/m3/_index.scss +6 -8
- package/core/tokens/m3/_md-sys-color.scss +125 -137
- package/core/tokens/m3/_md-sys-elevation.scss +7 -7
- package/core/tokens/m3/_md-sys-motion.scss +27 -38
- package/core/tokens/m3/_md-sys-shape.scss +13 -16
- package/core/tokens/m3/_md-sys-state.scss +5 -5
- package/core/tokens/m3/_md-sys-typescale.scss +107 -306
- package/datepicker/index.d.ts +6 -6
- package/dialog/index.d.ts +2 -2
- package/dialog/testing/index.d.ts +4 -4
- package/{dialog.d-DsYAn2Gk.d.ts → dialog.d-hlN3f-Hk.d.ts} +1 -1
- package/fesm2022/autocomplete.mjs +23 -23
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +14 -14
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +11 -11
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +16 -16
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +21 -21
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +47 -47
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +13 -13
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +49 -49
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/{common-module-DZl8g1kc.mjs → common-module-CF0eSYO4.mjs} +5 -5
- package/fesm2022/{common-module-DZl8g1kc.mjs.map → common-module-CF0eSYO4.mjs.map} +1 -1
- package/fesm2022/core.mjs +24 -24
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +94 -94
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +2 -2
- package/fesm2022/dialog.mjs +2 -2
- package/fesm2022/divider.mjs +8 -8
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/{error-options-BWOa3B4G.mjs → error-options-CbAHLQL5.mjs} +7 -7
- package/fesm2022/{error-options-BWOa3B4G.mjs.map → error-options-CbAHLQL5.mjs.map} +1 -1
- package/fesm2022/expansion.mjs +27 -27
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/{form-field-BZd6Vhww.mjs → form-field-sL9_TuE-.mjs} +70 -62
- package/fesm2022/form-field-sL9_TuE-.mjs.map +1 -0
- package/fesm2022/form-field.mjs +3 -3
- package/fesm2022/grid-list.mjs +24 -24
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +8 -8
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/{icon-button-4VvBKIK4.mjs → icon-button-BASP1JI8.mjs} +12 -12
- package/fesm2022/icon-button-BASP1JI8.mjs.map +1 -0
- package/fesm2022/{icon-registry-Bk5cM8Z5.mjs → icon-registry-DVLYRZv3.mjs} +4 -4
- package/fesm2022/{icon-registry-Bk5cM8Z5.mjs.map → icon-registry-DVLYRZv3.mjs.map} +1 -1
- package/fesm2022/icon.mjs +12 -12
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/index-BNtCg9r0.mjs +22 -0
- package/fesm2022/{index-BHJ4tVIe.mjs.map → index-BNtCg9r0.mjs.map} +1 -1
- package/fesm2022/index-DxCSjCL3.mjs +20 -0
- package/fesm2022/{index-D2rZ0V78.mjs.map → index-DxCSjCL3.mjs.map} +1 -1
- package/fesm2022/input.mjs +12 -12
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/{internal-form-field-DVvKYBKJ.mjs → internal-form-field-_OHaksOO.mjs} +4 -4
- package/fesm2022/{internal-form-field-DVvKYBKJ.mjs.map → internal-form-field-_OHaksOO.mjs.map} +1 -1
- package/fesm2022/{line-Dwrcg_t9.mjs → line-CtAKiRo6.mjs} +9 -9
- package/fesm2022/{line-Dwrcg_t9.mjs.map → line-CtAKiRo6.mjs.map} +1 -1
- package/fesm2022/list.mjs +59 -59
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +20 -20
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/{module-D-cNfopD.mjs → module-ChwDH6BC.mjs} +28 -28
- package/fesm2022/module-ChwDH6BC.mjs.map +1 -0
- package/fesm2022/{module-CTd5xD2i.mjs → module-DToxyW7l.mjs} +7 -7
- package/fesm2022/{module-CTd5xD2i.mjs.map → module-DToxyW7l.mjs.map} +1 -1
- package/fesm2022/{module-qRXgbi2L.mjs → module-DqTK2swA.mjs} +17 -17
- package/fesm2022/{module-qRXgbi2L.mjs.map → module-DqTK2swA.mjs.map} +1 -1
- package/fesm2022/{module-X29xYsIk.mjs → module-m5vWw9-5.mjs} +12 -12
- package/fesm2022/{module-X29xYsIk.mjs.map → module-m5vWw9-5.mjs.map} +1 -1
- package/fesm2022/{option-MOeehkAg.mjs → option-hkPAbXDN.mjs} +10 -10
- package/fesm2022/{option-MOeehkAg.mjs.map → option-hkPAbXDN.mjs.map} +1 -1
- package/fesm2022/paginator.mjs +27 -27
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +10 -10
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +10 -10
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/{pseudo-checkbox-BFGIaGxz.mjs → pseudo-checkbox-Ddidc23S.mjs} +4 -4
- package/fesm2022/{pseudo-checkbox-BFGIaGxz.mjs.map → pseudo-checkbox-Ddidc23S.mjs.map} +1 -1
- package/fesm2022/pseudo-checkbox-module--am9-RIA.mjs +20 -0
- package/fesm2022/{pseudo-checkbox-module-Dxth-mPi.mjs.map → pseudo-checkbox-module--am9-RIA.mjs.map} +1 -1
- package/fesm2022/radio.mjs +19 -19
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/{ripple-CuyVtN3V.mjs → ripple-DUGA2BAa.mjs} +7 -7
- package/fesm2022/{ripple-CuyVtN3V.mjs.map → ripple-DUGA2BAa.mjs.map} +1 -1
- package/fesm2022/{ripple-loader-pOctSZby.mjs → ripple-loader-Xy4bv6Xh.mjs} +5 -5
- package/fesm2022/{ripple-loader-pOctSZby.mjs.map → ripple-loader-Xy4bv6Xh.mjs.map} +1 -1
- package/fesm2022/select.mjs +12 -12
- package/fesm2022/sidenav.mjs +23 -23
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +13 -13
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +23 -23
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +28 -28
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort.mjs +15 -15
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper.mjs +43 -43
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/{structural-styles-CasigI3l.mjs → structural-styles-DA18Hchc.mjs} +4 -4
- package/fesm2022/{structural-styles-CasigI3l.mjs.map → structural-styles-DA18Hchc.mjs.map} +1 -1
- package/fesm2022/table.mjs +56 -56
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs.mjs +54 -54
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +20 -20
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +13 -13
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +2 -2
- package/fesm2022/tree.mjs +26 -26
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/index.d.ts +2 -2
- package/{form-field.d-b9aHrR4I.d.ts → form-field.d-C6p5uYjG.d.ts} +8 -6
- package/icon/index.d.ts +1 -1
- package/{icon-module.d-sA1hmRKS.d.ts → icon-module.d-COXCrhrh.d.ts} +4 -4
- package/input/index.d.ts +4 -4
- package/list/index.d.ts +4 -4
- package/{module.d-BGzxQfCs.d.ts → module.d-D1Ym5Wf2.d.ts} +1 -1
- package/{module.d-CH_8jCsD.d.ts → module.d-DMabQ4_c.d.ts} +2 -2
- package/package.json +2 -2
- package/paginator/index.d.ts +5 -5
- package/paginator/testing/index.d.ts +2 -2
- package/{paginator.d-3kymf0wo.d.ts → paginator.d-DuJ-oYgT.d.ts} +3 -3
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/progress-bar/index.d.ts +4 -4
- package/progress-spinner/index.d.ts +2 -2
- package/progress-spinner/testing/index.d.ts +1 -1
- package/{progress-spinner.d-DtYCWeYd.d.ts → progress-spinner.d-Lfz4Wh5x.d.ts} +4 -4
- package/radio/index.d.ts +6 -6
- package/radio/testing/index.d.ts +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/schema.json +4 -4
- package/schematics/ng-add/theming/create-custom-theme.js +1 -1
- package/schematics/ng-generate/theme-color/index_bundled.js +2 -2
- package/schematics/ng-generate/theme-color/index_bundled.js.map +1 -1
- package/schematics/ng-update/index_bundled.js +54 -2
- package/schematics/ng-update/index_bundled.js.map +1 -1
- package/select/index.d.ts +3 -3
- package/slide-toggle/index.d.ts +4 -4
- package/slide-toggle/testing/index.d.ts +1 -1
- package/slider/index.d.ts +3 -3
- package/stepper/index.d.ts +7 -7
- package/table/index.d.ts +2 -2
- package/tabs/index.d.ts +8 -8
- package/toolbar/index.d.ts +2 -2
- package/tree/testing/index.d.ts +1 -1
- package/core/tokens/m3/_md-ref-palette.scss +0 -100
- package/core/tokens/m3/_md-ref-typeface.scss +0 -14
- package/fesm2022/form-field-BZd6Vhww.mjs.map +0 -1
- package/fesm2022/icon-button-4VvBKIK4.mjs.map +0 -1
- package/fesm2022/index-BHJ4tVIe.mjs +0 -22
- package/fesm2022/index-D2rZ0V78.mjs +0 -20
- package/fesm2022/module-D-cNfopD.mjs.map +0 -1
- package/fesm2022/pseudo-checkbox-module-Dxth-mPi.mjs +0 -20
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@use '../../autocomplete/m3-autocomplete';
|
|
2
|
-
@use '../../badge/m3-badge';
|
|
3
2
|
@use '../../bottom-sheet/m3-bottom-sheet';
|
|
4
3
|
@use '../../button-toggle/m3-button-toggle';
|
|
5
4
|
@use '../../button/m3-button';
|
|
@@ -41,61 +40,10 @@
|
|
|
41
40
|
@use '../ripple/m3-ripple';
|
|
42
41
|
@use '../selection/pseudo-checkbox/m3-pseudo-checkbox';
|
|
43
42
|
@use '../style/sass-utils';
|
|
44
|
-
@use './format-tokens';
|
|
45
43
|
@use './m2-tokens';
|
|
46
44
|
@use './m3';
|
|
47
45
|
@use 'sass:map';
|
|
48
46
|
|
|
49
|
-
/// Generates tokens for the given palette with the given prefix.
|
|
50
|
-
/// @param {Map} $palette The palette to generate tokens for
|
|
51
|
-
/// @param {String} $prefix The key prefix used to name the tokens
|
|
52
|
-
/// @return {Map} A set of tokens for the given palette
|
|
53
|
-
@function _generate-palette-tokens($palette, $prefix) {
|
|
54
|
-
$palette: map.remove($palette, neutral, neutral-variant);
|
|
55
|
-
$result: ();
|
|
56
|
-
@each $hue, $value in $palette {
|
|
57
|
-
$result: map.set($result, '#{$prefix}#{$hue}', $value);
|
|
58
|
-
}
|
|
59
|
-
@return $result;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/// Creates a set of `md-ref-palette` tokens from the given palettes. (See
|
|
63
|
-
/// ./m3/definitions/_md-ref-palette.scss)
|
|
64
|
-
/// @param {Map} $primary The primary palette
|
|
65
|
-
/// @param {Map} $secondary The secondary palette
|
|
66
|
-
/// @param {Map} $tertiary The tertiary palette
|
|
67
|
-
/// @param {Map} $error The error palette
|
|
68
|
-
/// @return {Map} A set of `md-ref-palette` tokens
|
|
69
|
-
@function generate-ref-palette-tokens($primary, $tertiary, $error) {
|
|
70
|
-
@return sass-utils.merge-all(
|
|
71
|
-
(black: #000, white: #fff),
|
|
72
|
-
_generate-palette-tokens($primary, primary),
|
|
73
|
-
_generate-palette-tokens(map.get($primary, secondary), secondary),
|
|
74
|
-
_generate-palette-tokens($tertiary, tertiary),
|
|
75
|
-
_generate-palette-tokens(map.get($primary, neutral), neutral),
|
|
76
|
-
_generate-palette-tokens(map.get($primary, neutral-variant), neutral-variant),
|
|
77
|
-
_generate-palette-tokens($error, error),
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/// Creates a set of `md-ref-typeface` tokens from the given palettes. (See
|
|
82
|
-
/// ./m3/definitions/_md-ref-typeface.scss)
|
|
83
|
-
/// @param {List|String} $brand The font-family to use for brand text
|
|
84
|
-
/// @param {List|String} $plain The font-family to use for plain text
|
|
85
|
-
/// @param {String} $bold The font-weight to use for bold text
|
|
86
|
-
/// @param {String} $medium The font-weight to use for medium text
|
|
87
|
-
/// @param {String} $regular The font-weight to use for regular text
|
|
88
|
-
/// @return {Map} A set of `md-ref-typeface` tokens
|
|
89
|
-
@function generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular) {
|
|
90
|
-
@return (
|
|
91
|
-
brand: $brand,
|
|
92
|
-
plain: $plain,
|
|
93
|
-
weight-bold: $bold,
|
|
94
|
-
weight-medium: $medium,
|
|
95
|
-
weight-regular: $regular,
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
47
|
$_cached-token-slots: null;
|
|
100
48
|
|
|
101
49
|
/// Determines the token slots for all components.
|
|
@@ -138,9 +86,6 @@ $_cached-token-slots: null;
|
|
|
138
86
|
), $systems);
|
|
139
87
|
$exclude-hardcoded: not $include-non-systemized;
|
|
140
88
|
|
|
141
|
-
// DO NOT REMOVE
|
|
142
|
-
// This function is used internally.
|
|
143
|
-
$systems: format-tokens.private-format-tokens($systems);
|
|
144
89
|
$token-slots: _get-token-slots();
|
|
145
90
|
|
|
146
91
|
// TODO(mmalerba): Fill in remaining tokens.
|
|
@@ -164,170 +109,34 @@ $_cached-token-slots: null;
|
|
|
164
109
|
@return $result;
|
|
165
110
|
}
|
|
166
111
|
|
|
167
|
-
@function
|
|
168
|
-
$
|
|
169
|
-
m3.md-sys-color-values-dark($
|
|
170
|
-
m3.md-sys-color-values-light($
|
|
112
|
+
@function get-sys-color($type, $palettes, $prefix) {
|
|
113
|
+
$sys-color: if($type == dark,
|
|
114
|
+
m3.md-sys-color-values-dark($palettes),
|
|
115
|
+
m3.md-sys-color-values-light($palettes));
|
|
171
116
|
|
|
172
117
|
@if (sass-utils.$use-system-color-variables) {
|
|
173
|
-
$
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
'inverse-surface',
|
|
180
|
-
'on-background',
|
|
181
|
-
'on-error',
|
|
182
|
-
'on-error-container',
|
|
183
|
-
'on-primary',
|
|
184
|
-
'on-primary-container',
|
|
185
|
-
'on-primary-fixed',
|
|
186
|
-
'on-primary-fixed-variant',
|
|
187
|
-
'on-secondary',
|
|
188
|
-
'on-secondary-container',
|
|
189
|
-
'on-secondary-fixed',
|
|
190
|
-
'on-secondary-fixed-variant',
|
|
191
|
-
'on-surface',
|
|
192
|
-
'on-surface-variant',
|
|
193
|
-
'on-tertiary',
|
|
194
|
-
'on-tertiary-container',
|
|
195
|
-
'on-tertiary-fixed',
|
|
196
|
-
'on-tertiary-fixed-variant',
|
|
197
|
-
'outline',
|
|
198
|
-
'outline-variant',
|
|
199
|
-
'primary',
|
|
200
|
-
'primary-container',
|
|
201
|
-
'primary-fixed',
|
|
202
|
-
'primary-fixed-dim',
|
|
203
|
-
'scrim',
|
|
204
|
-
'secondary',
|
|
205
|
-
'secondary-container',
|
|
206
|
-
'secondary-fixed',
|
|
207
|
-
'secondary-fixed-dim',
|
|
208
|
-
'surface',
|
|
209
|
-
'surface-bright',
|
|
210
|
-
'surface-container',
|
|
211
|
-
'surface-container-high',
|
|
212
|
-
'surface-container-highest',
|
|
213
|
-
'surface-container-low',
|
|
214
|
-
'surface-container-lowest',
|
|
215
|
-
'surface-dim',
|
|
216
|
-
'surface-tint',
|
|
217
|
-
'surface-variant',
|
|
218
|
-
'tertiary',
|
|
219
|
-
'tertiary-container',
|
|
220
|
-
'tertiary-fixed',
|
|
221
|
-
'tertiary-fixed-dim'
|
|
222
|
-
);
|
|
223
|
-
@return map.merge(create-map($keys, $prefix), (
|
|
224
|
-
shadow: map.get($mdc-sys-color, shadow)
|
|
225
|
-
));
|
|
118
|
+
$var-values: ();
|
|
119
|
+
@each $key in map.keys($sys-color) {
|
|
120
|
+
$var-values: map.set($var-values, $key, var(--#{$prefix}-#{$key}));
|
|
121
|
+
}
|
|
122
|
+
$var-values: map.set($var-values, shadow, map.get($sys-color, shadow));
|
|
123
|
+
@return $var-values;
|
|
226
124
|
}
|
|
227
125
|
|
|
228
|
-
@return $
|
|
126
|
+
@return $sys-color;
|
|
229
127
|
}
|
|
230
128
|
|
|
231
|
-
@function
|
|
129
|
+
@function get-sys-typeface($typography, $prefix) {
|
|
130
|
+
$sys-typography: m3.md-sys-typescale-values($typography);
|
|
232
131
|
@if (sass-utils.$use-system-typography-variables) {
|
|
233
|
-
$
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
'body-large-tracking',
|
|
239
|
-
'body-large-weight',
|
|
240
|
-
'body-medium',
|
|
241
|
-
'body-medium-font',
|
|
242
|
-
'body-medium-line-height',
|
|
243
|
-
'body-medium-size',
|
|
244
|
-
'body-medium-tracking',
|
|
245
|
-
'body-medium-weight',
|
|
246
|
-
'body-small',
|
|
247
|
-
'body-small-font',
|
|
248
|
-
'body-small-line-height',
|
|
249
|
-
'body-small-size',
|
|
250
|
-
'body-small-tracking',
|
|
251
|
-
'body-small-weight',
|
|
252
|
-
'display-large',
|
|
253
|
-
'display-large-font',
|
|
254
|
-
'display-large-line-height',
|
|
255
|
-
'display-large-size',
|
|
256
|
-
'display-large-tracking',
|
|
257
|
-
'display-large-weight',
|
|
258
|
-
'display-medium',
|
|
259
|
-
'display-medium-font',
|
|
260
|
-
'display-medium-line-height',
|
|
261
|
-
'display-medium-size',
|
|
262
|
-
'display-medium-tracking',
|
|
263
|
-
'display-medium-weight',
|
|
264
|
-
'display-small',
|
|
265
|
-
'display-small-font',
|
|
266
|
-
'display-small-line-height',
|
|
267
|
-
'display-small-size',
|
|
268
|
-
'display-small-tracking',
|
|
269
|
-
'display-small-weight',
|
|
270
|
-
'headline-large',
|
|
271
|
-
'headline-large-font',
|
|
272
|
-
'headline-large-line-height',
|
|
273
|
-
'headline-large-size',
|
|
274
|
-
'headline-large-tracking',
|
|
275
|
-
'headline-large-weight',
|
|
276
|
-
'headline-medium',
|
|
277
|
-
'headline-medium-font',
|
|
278
|
-
'headline-medium-line-height',
|
|
279
|
-
'headline-medium-size',
|
|
280
|
-
'headline-medium-tracking',
|
|
281
|
-
'headline-medium-weight',
|
|
282
|
-
'headline-small',
|
|
283
|
-
'headline-small-font',
|
|
284
|
-
'headline-small-line-height',
|
|
285
|
-
'headline-small-size',
|
|
286
|
-
'headline-small-tracking',
|
|
287
|
-
'headline-small-weight',
|
|
288
|
-
'label-large',
|
|
289
|
-
'label-large-font',
|
|
290
|
-
'label-large-line-height',
|
|
291
|
-
'label-large-size',
|
|
292
|
-
'label-large-tracking',
|
|
293
|
-
'label-large-weight',
|
|
294
|
-
'label-large-weight-prominent',
|
|
295
|
-
'label-medium',
|
|
296
|
-
'label-medium-font',
|
|
297
|
-
'label-medium-line-height',
|
|
298
|
-
'label-medium-size',
|
|
299
|
-
'label-medium-tracking',
|
|
300
|
-
'label-medium-weight',
|
|
301
|
-
'label-medium-weight-prominent',
|
|
302
|
-
'label-small',
|
|
303
|
-
'label-small-font',
|
|
304
|
-
'label-small-line-height',
|
|
305
|
-
'label-small-size',
|
|
306
|
-
'label-small-tracking',
|
|
307
|
-
'label-small-weight',
|
|
308
|
-
'title-large',
|
|
309
|
-
'title-large-font',
|
|
310
|
-
'title-large-line-height',
|
|
311
|
-
'title-large-size',
|
|
312
|
-
'title-large-tracking',
|
|
313
|
-
'title-large-weight',
|
|
314
|
-
'title-medium',
|
|
315
|
-
'title-medium-font',
|
|
316
|
-
'title-medium-line-height',
|
|
317
|
-
'title-medium-size',
|
|
318
|
-
'title-medium-tracking',
|
|
319
|
-
'title-medium-weight',
|
|
320
|
-
'title-small',
|
|
321
|
-
'title-small-font',
|
|
322
|
-
'title-small-line-height',
|
|
323
|
-
'title-small-size',
|
|
324
|
-
'title-small-tracking',
|
|
325
|
-
'title-small-weight'
|
|
326
|
-
);
|
|
327
|
-
|
|
328
|
-
@return create-map($keys, $prefix);
|
|
132
|
+
$var-values: ();
|
|
133
|
+
@each $key in map.keys($sys-typography) {
|
|
134
|
+
$var-values: map.set($var-values, $key, var(--#{$prefix}-#{$key}));
|
|
135
|
+
}
|
|
136
|
+
@return $var-values;
|
|
329
137
|
}
|
|
330
|
-
|
|
138
|
+
|
|
139
|
+
@return $sys-typography;
|
|
331
140
|
}
|
|
332
141
|
|
|
333
142
|
/// Generates a set of namespaced color tokens for all components.
|
|
@@ -337,15 +146,15 @@ $_cached-token-slots: null;
|
|
|
337
146
|
/// @param {Map} $error The error palette
|
|
338
147
|
/// @param {String} $system-variables-prefix The prefix of system tokens
|
|
339
148
|
/// @return {Map} A map of namespaced color tokens
|
|
340
|
-
@function generate-color-tokens($type, $
|
|
341
|
-
$
|
|
342
|
-
md-ref-palette: generate-ref-palette-tokens($primary, $tertiary, $error)
|
|
343
|
-
);
|
|
149
|
+
@function generate-color-tokens($type, $palettes, $system-variables-prefix) {
|
|
150
|
+
$sys-color: get-sys-color($type, $palettes, $system-variables-prefix);
|
|
344
151
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
@return generate-tokens(map.merge($ref, (
|
|
152
|
+
@return generate-tokens((
|
|
348
153
|
md-sys-color: $sys-color,
|
|
154
|
+
md-ref-palette: (
|
|
155
|
+
neutral-10: map.get($palettes, neutral, 10),
|
|
156
|
+
neutral-variant20: map.get($palettes, neutral-variant, 20),
|
|
157
|
+
),
|
|
349
158
|
// Because the elevation values are always combined with color values to create the box shadow,
|
|
350
159
|
// elevation needs to be part of the color dimension.
|
|
351
160
|
md-sys-elevation: m3.md-sys-elevation-values(),
|
|
@@ -354,7 +163,7 @@ $_cached-token-slots: null;
|
|
|
354
163
|
// TODO(mmalerba): If at some point we remove the need for these combined values, we can move
|
|
355
164
|
// state to the base dimension.
|
|
356
165
|
md-sys-state: m3.md-sys-state-values(),
|
|
357
|
-
))
|
|
166
|
+
));
|
|
358
167
|
}
|
|
359
168
|
|
|
360
169
|
/// Generates a set of namespaced color tokens for all components.
|
|
@@ -365,12 +174,8 @@ $_cached-token-slots: null;
|
|
|
365
174
|
/// @param {String|Number} $regular The regular font-weight
|
|
366
175
|
/// @param {String} $system-variables-prefix The prefix of system tokens
|
|
367
176
|
/// @return {Map} A map of namespaced typography tokens
|
|
368
|
-
@function generate-typography-tokens($
|
|
369
|
-
$system-variables-prefix)
|
|
370
|
-
$ref: (
|
|
371
|
-
md-ref-typeface: generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
|
|
372
|
-
);
|
|
373
|
-
$sys-typeface: _get-sys-typeface($ref, $system-variables-prefix);
|
|
177
|
+
@function generate-typography-tokens($typography, $system-variables-prefix) {
|
|
178
|
+
$sys-typeface: get-sys-typeface($typography, $system-variables-prefix);
|
|
374
179
|
@return generate-tokens((
|
|
375
180
|
md-sys-typescale: $sys-typeface
|
|
376
181
|
));
|
|
@@ -396,7 +201,6 @@ $system-variables-prefix) {
|
|
|
396
201
|
$tokens-list: (
|
|
397
202
|
m3-app.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
398
203
|
m3-autocomplete.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
399
|
-
m3-badge.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
400
204
|
m3-bottom-sheet.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
401
205
|
m3-button-toggle.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
402
206
|
m3-button.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use 'sass:list';
|
|
3
3
|
@use 'sass:meta';
|
|
4
|
+
@use 'sass:string';
|
|
4
5
|
|
|
5
6
|
/// Gets the MDC tokens for the given prefix, M3 token values, and supported token slots.
|
|
6
7
|
/// @param {List} $prefix The token prefix for the given tokens.
|
|
@@ -83,3 +84,37 @@
|
|
|
83
84
|
}
|
|
84
85
|
@return $result;
|
|
85
86
|
}
|
|
87
|
+
|
|
88
|
+
// Replaces color tokens in the map with those defined as the variant color.
|
|
89
|
+
@function replace-colors-with-variant($system, $color, $variant) {
|
|
90
|
+
$system: map.set($system, on-#{$color}, map.get($system, on-#{$variant}));
|
|
91
|
+
$system: map.set($system, on-#{$color}-container, map.get($system, on-#{$variant}-container));
|
|
92
|
+
$system: map.set($system, #{$color}, map.get($system, #{$variant}));
|
|
93
|
+
$system: map.set($system, #{$color}-container, map.get($system, #{$variant}-container));
|
|
94
|
+
@return $system;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Gets the theme's system values as a flat map.
|
|
98
|
+
@function get-system($theme) {
|
|
99
|
+
$system: ();
|
|
100
|
+
$system: map.merge($system,
|
|
101
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-color));
|
|
102
|
+
$system: map.merge($system,
|
|
103
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-elevation));
|
|
104
|
+
$system: map.merge($system,
|
|
105
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-shape));
|
|
106
|
+
$system: map.merge($system,
|
|
107
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-state));
|
|
108
|
+
$system: map.merge($system,
|
|
109
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-typescale));
|
|
110
|
+
@return $system;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Returns the color with an opacity value using color-mix. If the color is a variable name, it
|
|
114
|
+
// will wrap it with `var()`.
|
|
115
|
+
@function color-with-opacity($color, $opacity) {
|
|
116
|
+
@if (meta.type-of($color) == string and string.index($color, '--') == 1) {
|
|
117
|
+
$color: var($color);
|
|
118
|
+
}
|
|
119
|
+
@return color-mix(in srgb, #{$color} #{$opacity}, transparent);
|
|
120
|
+
}
|
|
@@ -9,16 +9,29 @@
|
|
|
9
9
|
$_tokens: null;
|
|
10
10
|
$_component-prefix: null;
|
|
11
11
|
$_system-fallbacks: m3-system.create-system-fallbacks();
|
|
12
|
+
$_direct-system-fallbacks: ();
|
|
12
13
|
|
|
13
14
|
// Sets the token prefix and map to use when creating token slots.
|
|
14
|
-
@mixin use-tokens($prefix, $tokens) {
|
|
15
|
+
@mixin use-tokens($prefix, $tokens, $direct-system-fallbacks: null) {
|
|
15
16
|
$_component-prefix: $prefix !global;
|
|
16
17
|
$_tokens: $tokens !global;
|
|
17
18
|
|
|
19
|
+
// Direct system fallbacks are a map of base, color, typography, and density tokens. To simplify
|
|
20
|
+
// lookup, flatten these token groups into a single map.
|
|
21
|
+
@if $direct-system-fallbacks {
|
|
22
|
+
$_direct-system-fallbacks: () !global;
|
|
23
|
+
@each $tokens in map.values($direct-system-fallbacks) {
|
|
24
|
+
@each $token, $value in $tokens {
|
|
25
|
+
$_direct-system-fallbacks: map.set($_direct-system-fallbacks, $token, $value) !global;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
@content;
|
|
19
31
|
|
|
20
32
|
$_component-prefix: null !global;
|
|
21
33
|
$_tokens: null !global;
|
|
34
|
+
$_direct-system-fallbacks: () !global;
|
|
22
35
|
}
|
|
23
36
|
|
|
24
37
|
// Combines a prefix and a string to generate a CSS variable name for a token.
|
|
@@ -90,6 +103,14 @@ $_system-fallbacks: m3-system.create-system-fallbacks();
|
|
|
90
103
|
$fallback: map.get($_tokens, $token);
|
|
91
104
|
}
|
|
92
105
|
|
|
106
|
+
$direct-sys-fallback: map.get($_direct-system-fallbacks, $token);
|
|
107
|
+
@if ($direct-sys-fallback) {
|
|
108
|
+
@if (sass-utils.is-css-var-name($direct-sys-fallback)) {
|
|
109
|
+
@return _create-var($direct-sys-fallback, $fallback);
|
|
110
|
+
}
|
|
111
|
+
@return $direct-sys-fallback;
|
|
112
|
+
}
|
|
113
|
+
|
|
93
114
|
// Check whether there's a system-level fallback. If not, return the optional
|
|
94
115
|
// provided fallback (otherwise null).
|
|
95
116
|
$sys-fallback: map.get($_system-fallbacks, $_component-prefix, $token);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
@forward './md-
|
|
2
|
-
@forward './md-
|
|
3
|
-
@forward './md-sys-
|
|
4
|
-
@forward './md-sys-
|
|
5
|
-
@forward './md-sys-
|
|
6
|
-
@forward './md-sys-
|
|
7
|
-
@forward './md-sys-state' as md-sys-state-*;
|
|
8
|
-
@forward './md-sys-typescale' as md-sys-typescale-*;
|
|
1
|
+
@forward './md-sys-color';
|
|
2
|
+
@forward './md-sys-elevation';
|
|
3
|
+
@forward './md-sys-motion';
|
|
4
|
+
@forward './md-sys-shape';
|
|
5
|
+
@forward './md-sys-state';
|
|
6
|
+
@forward './md-sys-typescale';
|