@angular/material 17.0.0-next.1 → 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.
- package/_index.scss +1 -2
- package/autocomplete/_autocomplete-theme.scss +12 -18
- package/autocomplete/index.d.ts +15 -24
- package/badge/_badge-theme.scss +15 -27
- package/badge/index.d.ts +9 -17
- package/bottom-sheet/_bottom-sheet-theme.scss +13 -22
- package/button-toggle/_button-toggle-theme.scss +17 -28
- package/button-toggle/index.d.ts +15 -18
- package/checkbox/index.d.ts +21 -27
- package/chips/_chips-theme.scss +18 -56
- package/core/color/_all-color.scss +7 -15
- package/core/density/private/_all-density.scss +34 -39
- package/core/focus-indicators/_focus-indicators-theme.scss +6 -8
- package/core/focus-indicators/_private.scss +22 -26
- package/core/index.d.ts +7 -11
- package/core/style/_form-common.scss +7 -7
- package/core/style/_private.scss +2 -4
- package/core/testing/index.d.ts +2 -1
- package/core/theming/_all-theme.scss +41 -41
- package/core/theming/_inspection.scss +47 -0
- package/core/theming/_m2-inspection.scss +57 -0
- package/core/theming/_theming.scss +0 -14
- package/core/tokens/m2/mat/_autocomplete.scss +5 -8
- package/core/tokens/m2/mat/_badge.scss +12 -15
- package/core/tokens/m2/mat/_bottom-sheet.scss +11 -17
- package/core/tokens/m2/mat/_datepicker.scss +28 -38
- package/core/tokens/m2/mat/_divider.scss +5 -8
- package/core/tokens/m2/mat/_expansion.scss +24 -28
- package/core/tokens/m2/mat/_grid-list.scss +8 -8
- package/core/tokens/m2/mat/_icon.scss +3 -3
- package/core/tokens/m2/mat/_legacy-button-toggle.scss +15 -19
- package/core/tokens/m2/mat/_menu.scss +12 -17
- package/core/tokens/m2/mat/_select.scss +15 -29
- package/core/tokens/m2/mat/_sidenav.scss +12 -14
- package/core/tokens/m2/mat/_snack-bar.scss +7 -8
- package/core/tokens/m2/mat/_standard-button-toggle.scss +23 -22
- package/core/tokens/m2/mat/_stepper.scss +30 -33
- package/core/tokens/m2/mat/_tab-header-with-background.scss +6 -8
- package/core/tokens/m2/mat/_tab-header.scss +13 -18
- package/core/tokens/m2/mat/_table.scss +19 -23
- package/core/tokens/m2/mat/_toolbar.scss +12 -16
- package/core/tokens/m2/mdc/_chip.scss +38 -24
- package/core/tokens/m2/mdc/_circular-progress.scss +5 -6
- package/core/tokens/m2/mdc/_dialog.scss +16 -30
- package/core/tokens/m2/mdc/_icon-button.scss +2 -2
- package/core/tokens/m2/mdc/_plain-tooltip.scss +9 -22
- package/core/tokens/m2/mdc/_snack-bar.scss +10 -23
- package/core/tokens/m2/mdc/_tab-indicator.scss +5 -8
- package/core/tokens/m2/mdc/_tab.scss +5 -4
- package/core/typography/_all-typography.scss +44 -47
- package/core/typography/_typography.scss +32 -155
- package/core/typography/_versioning.scss +7 -2
- package/datepicker/_datepicker-theme.scss +20 -34
- package/dialog/_dialog-theme.scss +14 -25
- package/dialog/_mdc-dialog-structure-overrides.scss +12 -10
- package/dialog/index.d.ts +2 -0
- package/divider/_divider-theme.scss +12 -18
- package/esm2022/autocomplete/autocomplete-trigger.mjs +5 -17
- package/esm2022/autocomplete/autocomplete.mjs +23 -50
- package/esm2022/badge/badge.mjs +11 -29
- package/esm2022/button-toggle/button-toggle.mjs +25 -33
- package/esm2022/checkbox/checkbox.mjs +32 -39
- package/esm2022/core/option/optgroup.mjs +10 -11
- package/esm2022/core/option/option.mjs +6 -6
- package/esm2022/core/testing/option-harness.mjs +3 -3
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/dialog/dialog-container.mjs +16 -3
- package/esm2022/menu/menu-item.mjs +15 -11
- package/esm2022/menu/menu.mjs +9 -22
- package/esm2022/slide-toggle/slide-toggle.mjs +33 -37
- package/esm2022/tabs/tab-group.mjs +3 -3
- package/expansion/_expansion-theme.scss +16 -24
- package/fesm2022/autocomplete.mjs +25 -63
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +11 -28
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +25 -32
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +31 -38
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/core/testing.mjs +2 -2
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +14 -13
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/dialog.mjs +15 -2
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/menu.mjs +23 -31
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +33 -36
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/tabs.mjs +2 -2
- package/fesm2022/tabs.mjs.map +1 -1
- package/form-field/_form-field-sizing.scss +1 -1
- package/grid-list/_grid-list-theme.scss +12 -19
- package/icon/_icon-theme.scss +17 -25
- package/list/_list-theme.scss +1 -1
- package/menu/_menu-theme.scss +13 -22
- package/menu/index.d.ts +12 -18
- package/package.json +2 -2
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress-spinner/_progress-spinner-theme.scss +16 -22
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
- package/schematics/ng-generate/mdc-migration/index_bundled.js.map +1 -1
- package/schematics/ng-update/index_bundled.js +25 -25
- package/select/_select-theme.scss +17 -31
- package/sidenav/_sidenav-theme.scss +12 -18
- package/slide-toggle/index.d.ts +20 -23
- package/snack-bar/_snack-bar-theme.scss +15 -24
- package/sort/_sort-theme.scss +13 -22
- package/stepper/_stepper-theme.scss +16 -34
- package/table/_table-theme.scss +14 -25
- package/tabs/_tabs-theme.scss +31 -45
- package/toolbar/_toolbar-theme.scss +22 -31
- package/tooltip/_tooltip-theme.scss +15 -23
- package/tree/_tree-theme.scss +20 -29
- package/core/typography/_typography-deprecated.scss +0 -39
|
@@ -39,50 +39,50 @@
|
|
|
39
39
|
@use './theming';
|
|
40
40
|
|
|
41
41
|
// Create a theme.
|
|
42
|
-
@mixin all-component-themes($theme
|
|
42
|
+
@mixin all-component-themes($theme) {
|
|
43
43
|
$dedupe-key: 'angular-material-theme';
|
|
44
|
-
@include theming.private-check-duplicate-theme-styles($theme
|
|
45
|
-
@include core-theme.theme($theme
|
|
46
|
-
@include card-theme.theme($theme
|
|
47
|
-
@include progress-bar-theme.theme($theme
|
|
48
|
-
@include tooltip-theme.theme($theme
|
|
49
|
-
@include form-field-theme.theme($theme
|
|
50
|
-
@include input-theme.theme($theme
|
|
51
|
-
@include select-theme.theme($theme
|
|
52
|
-
@include autocomplete-theme.theme($theme
|
|
53
|
-
@include dialog-theme.theme($theme
|
|
54
|
-
@include chips-theme.theme($theme
|
|
55
|
-
@include slide-toggle-theme.theme($theme
|
|
56
|
-
@include radio-theme.theme($theme
|
|
57
|
-
@include slider-theme.theme($theme
|
|
58
|
-
@include menu-theme.theme($theme
|
|
59
|
-
@include list-theme.theme($theme
|
|
60
|
-
@include paginator-theme.theme($theme
|
|
61
|
-
@include tabs-theme.theme($theme
|
|
62
|
-
@include checkbox-theme.theme($theme
|
|
63
|
-
@include button-theme.theme($theme
|
|
64
|
-
@include icon-button-theme.theme($theme
|
|
65
|
-
@include fab-theme.theme($theme
|
|
66
|
-
@include snack-bar-theme.theme($theme
|
|
67
|
-
@include table-theme.theme($theme
|
|
68
|
-
@include progress-spinner-theme.theme($theme
|
|
69
|
-
@include badge-theme.theme($theme
|
|
70
|
-
@include bottom-sheet-theme.theme($theme
|
|
71
|
-
@include button-toggle-theme.theme($theme
|
|
72
|
-
@include datepicker-theme.theme($theme
|
|
73
|
-
@include divider-theme.theme($theme
|
|
74
|
-
@include expansion-theme.theme($theme
|
|
75
|
-
@include grid-list-theme.theme($theme
|
|
76
|
-
@include icon-theme.theme($theme
|
|
77
|
-
@include sidenav-theme.theme($theme
|
|
78
|
-
@include stepper-theme.theme($theme
|
|
79
|
-
@include sort-theme.theme($theme
|
|
80
|
-
@include toolbar-theme.theme($theme
|
|
81
|
-
@include tree-theme.theme($theme
|
|
44
|
+
@include theming.private-check-duplicate-theme-styles($theme, $dedupe-key) {
|
|
45
|
+
@include core-theme.theme($theme);
|
|
46
|
+
@include card-theme.theme($theme);
|
|
47
|
+
@include progress-bar-theme.theme($theme);
|
|
48
|
+
@include tooltip-theme.theme($theme);
|
|
49
|
+
@include form-field-theme.theme($theme);
|
|
50
|
+
@include input-theme.theme($theme);
|
|
51
|
+
@include select-theme.theme($theme);
|
|
52
|
+
@include autocomplete-theme.theme($theme);
|
|
53
|
+
@include dialog-theme.theme($theme);
|
|
54
|
+
@include chips-theme.theme($theme);
|
|
55
|
+
@include slide-toggle-theme.theme($theme);
|
|
56
|
+
@include radio-theme.theme($theme);
|
|
57
|
+
@include slider-theme.theme($theme);
|
|
58
|
+
@include menu-theme.theme($theme);
|
|
59
|
+
@include list-theme.theme($theme);
|
|
60
|
+
@include paginator-theme.theme($theme);
|
|
61
|
+
@include tabs-theme.theme($theme);
|
|
62
|
+
@include checkbox-theme.theme($theme);
|
|
63
|
+
@include button-theme.theme($theme);
|
|
64
|
+
@include icon-button-theme.theme($theme);
|
|
65
|
+
@include fab-theme.theme($theme);
|
|
66
|
+
@include snack-bar-theme.theme($theme);
|
|
67
|
+
@include table-theme.theme($theme);
|
|
68
|
+
@include progress-spinner-theme.theme($theme);
|
|
69
|
+
@include badge-theme.theme($theme);
|
|
70
|
+
@include bottom-sheet-theme.theme($theme);
|
|
71
|
+
@include button-toggle-theme.theme($theme);
|
|
72
|
+
@include datepicker-theme.theme($theme);
|
|
73
|
+
@include divider-theme.theme($theme);
|
|
74
|
+
@include expansion-theme.theme($theme);
|
|
75
|
+
@include grid-list-theme.theme($theme);
|
|
76
|
+
@include icon-theme.theme($theme);
|
|
77
|
+
@include sidenav-theme.theme($theme);
|
|
78
|
+
@include stepper-theme.theme($theme);
|
|
79
|
+
@include sort-theme.theme($theme);
|
|
80
|
+
@include toolbar-theme.theme($theme);
|
|
81
|
+
@include tree-theme.theme($theme);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// @deprecated Use `all-component-themes`.
|
|
86
|
-
@mixin angular-material-theme($theme
|
|
87
|
-
@include all-component-themes($theme
|
|
86
|
+
@mixin angular-material-theme($theme) {
|
|
87
|
+
@include all-component-themes($theme);
|
|
88
88
|
}
|
|
@@ -231,6 +231,41 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
/// Removes the information about the given theming system(s) from the given theme.
|
|
235
|
+
/// @param {Map} $theme The theme to remove information from
|
|
236
|
+
/// @param {String...} $systems The systems to remove
|
|
237
|
+
/// @return {Map} A version of the theme without the removed theming systems.
|
|
238
|
+
@function theme-remove($theme, $systems...) {
|
|
239
|
+
$err: validation.validate-allowed-values($systems, color, typography, density, base);
|
|
240
|
+
@if $err {
|
|
241
|
+
@error #{'Expected $systems to contain valid system names (color, typography, density, or'}
|
|
242
|
+
#{'base). Got invalid system names:'} $err;
|
|
243
|
+
}
|
|
244
|
+
$version: get-theme-version($theme);
|
|
245
|
+
@if $version == 0 {
|
|
246
|
+
@return m2-inspection.theme-remove($theme, $systems...);
|
|
247
|
+
}
|
|
248
|
+
@else if $version == 1 {
|
|
249
|
+
@each $system in $systems {
|
|
250
|
+
@if $system == base {
|
|
251
|
+
$theme: map.deep-remove($theme, $_internals, base-tokens);
|
|
252
|
+
}
|
|
253
|
+
@else if $system == color {
|
|
254
|
+
$theme: map.deep-remove($theme, $_internals, color-tokens);
|
|
255
|
+
$theme: map.deep-remove($theme, $_internals, theme-type);
|
|
256
|
+
$theme: map.deep-remove($theme, $_internals, palettes);
|
|
257
|
+
}
|
|
258
|
+
@else if $system == typography {
|
|
259
|
+
$theme: map.deep-remove($theme, $_internals, typography-tokens);
|
|
260
|
+
}
|
|
261
|
+
@else if $system == density {
|
|
262
|
+
$theme: map.deep-remove($theme, $_internals, density-scale);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
@return $theme;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
234
269
|
/// Gets the set of tokens from the given theme, limited to those affected by the requested theming
|
|
235
270
|
/// systems.
|
|
236
271
|
/// @param {Map} $theme The theme to get tokens from.
|
|
@@ -254,3 +289,15 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
254
289
|
}
|
|
255
290
|
@return $result;
|
|
256
291
|
}
|
|
292
|
+
|
|
293
|
+
/// Gets a version of the theme with a modified typography config that preserves old behavior in
|
|
294
|
+
/// some components that previously used `private-typography-to-2014-config`.
|
|
295
|
+
/// Do not introduce new usages of this, it should be cleaned up and removed.
|
|
296
|
+
/// @deprecated
|
|
297
|
+
@function private-get-typography-back-compat-theme($theme) {
|
|
298
|
+
@return if(
|
|
299
|
+
get-theme-version($theme) == 0,
|
|
300
|
+
m2-inspection.private-get-typography-back-compat-theme($theme),
|
|
301
|
+
$theme
|
|
302
|
+
);
|
|
303
|
+
}
|
|
@@ -209,3 +209,60 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
209
209
|
}
|
|
210
210
|
@error 'Valid systems are: base, color, typography, density. Got:' $system;
|
|
211
211
|
}
|
|
212
|
+
|
|
213
|
+
/// Removes the information about the given theming system(s) from the given theme.
|
|
214
|
+
/// @param {Map} $theme The theme to remove information from
|
|
215
|
+
/// @param {String...} $systems The systems to remove
|
|
216
|
+
/// @return {Map} A version of the theme without the removed theming systems.
|
|
217
|
+
@function theme-remove($theme, $systems...) {
|
|
218
|
+
$internal: map.get($theme, $_internals, m2-config);
|
|
219
|
+
@each $system in $systems {
|
|
220
|
+
@if $system == color {
|
|
221
|
+
$theme: map.set($theme, color, null);
|
|
222
|
+
}
|
|
223
|
+
@else if $system == typography {
|
|
224
|
+
$theme: map.set($theme, typography, null);
|
|
225
|
+
}
|
|
226
|
+
@else if $system == density {
|
|
227
|
+
$theme: map.set($theme, density, null);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
@if $internal {
|
|
231
|
+
$internal: theme-remove($internal, $systems...);
|
|
232
|
+
$theme: map.set($theme, $_internals, m2-config, $internal);
|
|
233
|
+
}
|
|
234
|
+
@return $theme;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/// Gets a version of the theme with a modified typography config that preserves old behavior in
|
|
238
|
+
/// some components that previously used `private-typography-to-2014-config`.
|
|
239
|
+
/// Do not introduce new usages of this, it should be cleaned up and removed.
|
|
240
|
+
/// @deprecated
|
|
241
|
+
@function private-get-typography-back-compat-theme($theme) {
|
|
242
|
+
// It is possible for a user to pass a "density theme" that is just a number.
|
|
243
|
+
@if meta.type-of($theme) != 'map' {
|
|
244
|
+
@return $theme;
|
|
245
|
+
}
|
|
246
|
+
$internal: map.get($theme, $_internals, m2-config);
|
|
247
|
+
$theme: map.remove($theme, $_internals);
|
|
248
|
+
@if theme-has($theme, typography) {
|
|
249
|
+
$typography-config: theming.get-typography-config($theme);
|
|
250
|
+
// gmat configs have both 2018 and 2014 keys.
|
|
251
|
+
@if (not typography-versioning.private-typography-is-2014-config($typography-config)) or
|
|
252
|
+
(not typography-versioning.private-typography-is-2018-config($typography-config)) {
|
|
253
|
+
@return $theme;
|
|
254
|
+
}
|
|
255
|
+
$new-typography-config: typography-versioning.private-typography-to-2018-config(
|
|
256
|
+
$typography-config, true);
|
|
257
|
+
// subtitle-2 is mapped differently by `private-typography-to-2014-config`.
|
|
258
|
+
$new-typography-config: map.set(
|
|
259
|
+
$new-typography-config, subtitle-2, map.get($new-typography-config, body-1));
|
|
260
|
+
$theme: if($theme == $typography-config, $new-typography-config,
|
|
261
|
+
map.set($theme, typography, $new-typography-config));
|
|
262
|
+
}
|
|
263
|
+
@if $internal {
|
|
264
|
+
$internal: private-get-typography-back-compat-theme($internal);
|
|
265
|
+
$theme: map.set($theme, $_internals, m2-config, $internal);
|
|
266
|
+
}
|
|
267
|
+
@return $theme;
|
|
268
|
+
}
|
|
@@ -24,11 +24,6 @@ $_legacy-theme-warning: 'Angular Material themes should be created from a map co
|
|
|
24
24
|
'palette values for "primary", "accent", and "warn". ' +
|
|
25
25
|
'See https://material.angular.io/guide/theming for more information.';
|
|
26
26
|
|
|
27
|
-
// Flag whether theme config getter functions should warn if a key is expected to exist but not
|
|
28
|
-
// present in the config. This can be transformed internally in Google to ensure all clients have
|
|
29
|
-
// comprehensive theme configurations.
|
|
30
|
-
$_enable-strict-theme-config: false;
|
|
31
|
-
|
|
32
27
|
// Flag whether to disable theme definitions copying color values to the top-level theme config.
|
|
33
28
|
// This copy is to preserve backwards compatibility.
|
|
34
29
|
$_disable-color-backwards-compatibility: false;
|
|
@@ -270,9 +265,6 @@ $_emitted-base: () !default;
|
|
|
270
265
|
@if map.has-key($theme, color) {
|
|
271
266
|
@return map.get($theme, color);
|
|
272
267
|
}
|
|
273
|
-
@else if ($_enable-strict-theme-config) {
|
|
274
|
-
@error 'Angular Material theme configuration is missing a "color" value';
|
|
275
|
-
}
|
|
276
268
|
@return $default;
|
|
277
269
|
}
|
|
278
270
|
|
|
@@ -292,9 +284,6 @@ $_emitted-base: () !default;
|
|
|
292
284
|
@if map.has-key($theme-or-config, density) {
|
|
293
285
|
@return map.get($theme-or-config, density);
|
|
294
286
|
}
|
|
295
|
-
@else if ($_enable-strict-theme-config) {
|
|
296
|
-
@error 'Angular Material theme configuration is missing a "density" value';
|
|
297
|
-
}
|
|
298
287
|
@return $default;
|
|
299
288
|
}
|
|
300
289
|
|
|
@@ -315,9 +304,6 @@ $_emitted-base: () !default;
|
|
|
315
304
|
@if (map.has-key($theme-or-config, typography)) {
|
|
316
305
|
@return map.get($theme-or-config, typography);
|
|
317
306
|
}
|
|
318
|
-
@else if ($_enable-strict-theme-config) {
|
|
319
|
-
@error 'Angular Material theme configuration is missing a "typography" value';
|
|
320
|
-
}
|
|
321
307
|
@return $default;
|
|
322
308
|
}
|
|
323
309
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../theming/
|
|
2
|
+
@use '../../../theming/inspection';
|
|
4
3
|
@use '../../../style/sass-utils';
|
|
5
4
|
|
|
6
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -13,21 +12,19 @@ $prefix: (mat, autocomplete);
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
16
|
-
@function get-color-tokens($
|
|
17
|
-
$background: map.get($config, background);
|
|
18
|
-
|
|
15
|
+
@function get-color-tokens($theme) {
|
|
19
16
|
@return (
|
|
20
|
-
background-color:
|
|
17
|
+
background-color: inspection.get-theme-color($theme, background, card)
|
|
21
18
|
);
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
25
|
-
@function get-typography-tokens($
|
|
22
|
+
@function get-typography-tokens($theme) {
|
|
26
23
|
@return ();
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
30
|
-
@function get-density-tokens($
|
|
27
|
+
@function get-density-tokens($theme) {
|
|
31
28
|
@return ();
|
|
32
29
|
}
|
|
33
30
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
@use 'sass:color';
|
|
4
4
|
@use '../../token-utils';
|
|
5
|
-
@use '../../../
|
|
6
|
-
@use '../../../theming/theming';
|
|
5
|
+
@use '../../../theming/inspection';
|
|
7
6
|
@use '../../../style/sass-utils';
|
|
8
7
|
|
|
9
8
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -16,12 +15,10 @@ $prefix: (mat, badge);
|
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
19
|
-
@function get-color-tokens($
|
|
20
|
-
$
|
|
21
|
-
$background:
|
|
22
|
-
$
|
|
23
|
-
$app-background: theming.get-color-from-palette($background, 'background');
|
|
24
|
-
$disabled-background: theming.get-color-from-palette($foreground, disabled-button);
|
|
18
|
+
@function get-color-tokens($theme) {
|
|
19
|
+
$primary-color-tokens: private-get-color-palette-color-tokens($theme, primary);
|
|
20
|
+
$app-background: inspection.get-theme-color($theme, background, background);
|
|
21
|
+
$disabled-background: inspection.get-theme-color($theme, foreground, disabled-button);
|
|
25
22
|
|
|
26
23
|
// The disabled color usually has some kind of opacity, but because the badge is overlayed
|
|
27
24
|
// on top of something else, it won't look good if it's opaque. If it is a color *type*,
|
|
@@ -36,24 +33,24 @@ $prefix: (mat, badge);
|
|
|
36
33
|
|
|
37
34
|
@return map.merge($primary-color-tokens, (
|
|
38
35
|
disabled-state-background-color: $disabled-background,
|
|
39
|
-
disabled-state-text-color:
|
|
36
|
+
disabled-state-text-color: inspection.get-theme-color($theme, foreground, disabled-text),
|
|
40
37
|
));
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
// Generates the tokens used to theme the badge based on a palette.
|
|
44
|
-
@function private-get-color-palette-color-tokens($palette) {
|
|
41
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name: primary) {
|
|
45
42
|
@return (
|
|
46
|
-
background-color:
|
|
47
|
-
text-color:
|
|
43
|
+
background-color: inspection.get-theme-color($theme, $palette-name),
|
|
44
|
+
text-color: inspection.get-theme-color($theme, $palette-name, default-contrast),
|
|
48
45
|
);
|
|
49
46
|
}
|
|
50
47
|
|
|
51
48
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
52
|
-
@function get-typography-tokens($
|
|
49
|
+
@function get-typography-tokens($theme) {
|
|
53
50
|
$base-size: 12px;
|
|
54
51
|
|
|
55
52
|
@return (
|
|
56
|
-
text-font: typography-
|
|
53
|
+
text-font: inspection.get-theme-typography($theme, body-2, font-family),
|
|
57
54
|
text-size: $base-size,
|
|
58
55
|
text-weight: 600,
|
|
59
56
|
small-size-text-size: $base-size * 0.75,
|
|
@@ -62,7 +59,7 @@ $prefix: (mat, badge);
|
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
65
|
-
@function get-density-tokens($
|
|
62
|
+
@function get-density-tokens($theme) {
|
|
66
63
|
@return ();
|
|
67
64
|
}
|
|
68
65
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../
|
|
4
|
-
@use '../../../theming/theming';
|
|
2
|
+
@use '../../../theming/inspection';
|
|
5
3
|
@use '../../../style/sass-utils';
|
|
6
4
|
|
|
7
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -17,30 +15,26 @@ $prefix: (mat, bottom-sheet);
|
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
20
|
-
@function get-color-tokens($
|
|
21
|
-
$foreground: map.get($config, foreground);
|
|
22
|
-
$background: map.get($config, background);
|
|
23
|
-
|
|
18
|
+
@function get-color-tokens($theme) {
|
|
24
19
|
@return (
|
|
25
|
-
container-text-color:
|
|
26
|
-
container-background-color:
|
|
20
|
+
container-text-color: inspection.get-theme-color($theme, foreground, text),
|
|
21
|
+
container-background-color: inspection.get-theme-color($theme, background, dialog),
|
|
27
22
|
);
|
|
28
23
|
}
|
|
29
24
|
|
|
30
25
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
31
|
-
@function get-typography-tokens($
|
|
26
|
+
@function get-typography-tokens($theme) {
|
|
32
27
|
@return (
|
|
33
|
-
container-text-font:
|
|
34
|
-
|
|
35
|
-
container-text-
|
|
36
|
-
container-text-
|
|
37
|
-
container-text-
|
|
38
|
-
container-text-weight: typography-utils.font-weight($config, body-1),
|
|
28
|
+
container-text-font: inspection.get-theme-typography($theme, body-2, font-family),
|
|
29
|
+
container-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
|
|
30
|
+
container-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
31
|
+
container-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
|
|
32
|
+
container-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
|
|
39
33
|
);
|
|
40
34
|
}
|
|
41
35
|
|
|
42
36
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
43
|
-
@function get-density-tokens($
|
|
37
|
+
@function get-density-tokens($theme) {
|
|
44
38
|
@return ();
|
|
45
39
|
}
|
|
46
40
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
@use 'sass:color';
|
|
2
|
-
@use 'sass:map';
|
|
3
2
|
@use 'sass:meta';
|
|
4
3
|
@use 'sass:math';
|
|
5
4
|
@use '../../token-utils';
|
|
6
|
-
@use '../../../theming/
|
|
7
|
-
@use '../../../typography/typography-utils';
|
|
5
|
+
@use '../../../theming/inspection';
|
|
8
6
|
@use '../../../style/sass-utils';
|
|
9
7
|
|
|
10
8
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -36,23 +34,20 @@ $private-default-overlap-color: #a8dab5;
|
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
39
|
-
@function get-color-tokens($
|
|
40
|
-
$
|
|
41
|
-
$
|
|
42
|
-
$
|
|
43
|
-
$
|
|
44
|
-
$
|
|
45
|
-
$
|
|
46
|
-
$disabled-text-color: theming.get-color-from-palette($foreground, disabled-text);
|
|
47
|
-
$divider-color: theming.get-color-from-palette($foreground, divider);
|
|
48
|
-
$hint-text-color: theming.get-color-from-palette($foreground, hint-text);
|
|
37
|
+
@function get-color-tokens($theme) {
|
|
38
|
+
$inactive-icon-color: inspection.get-theme-color($theme, foreground, icon);
|
|
39
|
+
$text-color: inspection.get-theme-color($theme, foreground, text);
|
|
40
|
+
$secondary-text-color: inspection.get-theme-color($theme, foreground, secondary-text);
|
|
41
|
+
$disabled-text-color: inspection.get-theme-color($theme, foreground, disabled-text);
|
|
42
|
+
$divider-color: inspection.get-theme-color($theme, foreground, divider);
|
|
43
|
+
$hint-text-color: inspection.get-theme-color($theme, foreground, hint-text);
|
|
49
44
|
$preview-outline-color: $divider-color;
|
|
50
45
|
$today-disabled-outline-color: null;
|
|
51
46
|
|
|
52
|
-
$primary-color:
|
|
47
|
+
$primary-color: inspection.get-theme-color($theme, primary);
|
|
53
48
|
$range-tokens: get-range-color-tokens(private-get-range-background-color($primary-color));
|
|
54
|
-
$calendar-tokens: private-get-calendar-color-palette-color-tokens($
|
|
55
|
-
$toggle-tokens: private-get-toggle-color-palette-color-tokens($
|
|
49
|
+
$calendar-tokens: private-get-calendar-color-palette-color-tokens($theme, primary);
|
|
50
|
+
$toggle-tokens: private-get-toggle-color-palette-color-tokens($theme, primary);
|
|
56
51
|
|
|
57
52
|
// The divider color is set under the assumption that it'll be used
|
|
58
53
|
// for a solid border, but because we're using a dashed border for the
|
|
@@ -90,31 +85,30 @@ $private-default-overlap-color: #a8dab5;
|
|
|
90
85
|
range-input-disabled-state-separator-color: $disabled-text-color,
|
|
91
86
|
range-input-disabled-state-text-color: $disabled-text-color,
|
|
92
87
|
|
|
93
|
-
calendar-container-background-color:
|
|
88
|
+
calendar-container-background-color: inspection.get-theme-color($theme, background, card),
|
|
94
89
|
calendar-container-text-color: $text-color,
|
|
95
90
|
));
|
|
96
91
|
}
|
|
97
92
|
|
|
98
93
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
99
|
-
@function get-typography-tokens($
|
|
100
|
-
$fallback-font: typography-utils.font-family($config);
|
|
101
|
-
|
|
94
|
+
@function get-typography-tokens($theme) {
|
|
102
95
|
@return (
|
|
103
96
|
// TODO(crisbeto): the typography tokens for other components set every typography dimension of
|
|
104
97
|
// an element (e.g. size, weight, line height, letter spacing). These tokens only set the values
|
|
105
98
|
// that were set in the previous theming API to reduce the amount of subtle screenshot
|
|
106
99
|
// differences. We should look into introducing the other tokens in a follow-up.
|
|
107
|
-
calendar-text-font: $
|
|
100
|
+
calendar-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
108
101
|
calendar-text-size: 13px, // TODO(crisbeto): this doesn't appear to affect anything
|
|
109
102
|
|
|
110
|
-
calendar-body-label-text-size:
|
|
111
|
-
calendar-body-label-text-weight:
|
|
103
|
+
calendar-body-label-text-size: inspection.get-theme-typography($theme, button, font-size),
|
|
104
|
+
calendar-body-label-text-weight: inspection.get-theme-typography($theme, button, font-weight),
|
|
112
105
|
|
|
113
|
-
calendar-period-button-text-size:
|
|
114
|
-
calendar-period-button-text-weight:
|
|
106
|
+
calendar-period-button-text-size: inspection.get-theme-typography($theme, button, font-size),
|
|
107
|
+
calendar-period-button-text-weight: inspection.get-theme-typography(
|
|
108
|
+
$theme, button, font-weight),
|
|
115
109
|
|
|
116
110
|
calendar-header-text-size: 11px,
|
|
117
|
-
calendar-header-text-weight:
|
|
111
|
+
calendar-header-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
|
|
118
112
|
);
|
|
119
113
|
}
|
|
120
114
|
|
|
@@ -133,19 +127,17 @@ $private-default-overlap-color: #a8dab5;
|
|
|
133
127
|
);
|
|
134
128
|
}
|
|
135
129
|
|
|
136
|
-
@function private-get-calendar-color-palette-color-tokens($
|
|
137
|
-
$
|
|
138
|
-
$
|
|
139
|
-
$
|
|
140
|
-
$default-contrast: theming.get-color-from-palette($palette, default-contrast);
|
|
141
|
-
$active-background-color: theming.get-color-from-palette($palette, 0.3);
|
|
130
|
+
@function private-get-calendar-color-palette-color-tokens($theme, $palette-name) {
|
|
131
|
+
$palette-color: inspection.get-theme-color($theme, $palette-name);
|
|
132
|
+
$default-contrast: inspection.get-theme-color($theme, $palette-name, default-contrast);
|
|
133
|
+
$active-background-color: sass-utils.safe-color-change($palette-color, $alpha: 0.3);
|
|
142
134
|
$active-disabled-color: null;
|
|
143
135
|
|
|
144
136
|
@if (meta.type-of($palette-color) == color) {
|
|
145
137
|
$active-disabled-color: color.adjust($palette-color, $alpha: -$_selected-fade-amount);
|
|
146
138
|
}
|
|
147
139
|
@else {
|
|
148
|
-
$active-disabled-color:
|
|
140
|
+
$active-disabled-color: inspection.get-theme-color($theme, foreground, disabled-button);
|
|
149
141
|
}
|
|
150
142
|
|
|
151
143
|
@return (
|
|
@@ -158,17 +150,15 @@ $private-default-overlap-color: #a8dab5;
|
|
|
158
150
|
);
|
|
159
151
|
}
|
|
160
152
|
|
|
161
|
-
@function private-get-toggle-color-palette-color-tokens($
|
|
162
|
-
$palette: map.get($config, $palette-name);
|
|
163
|
-
|
|
153
|
+
@function private-get-toggle-color-palette-color-tokens($theme, $palette-name) {
|
|
164
154
|
@return (
|
|
165
|
-
toggle-active-state-icon-color:
|
|
155
|
+
toggle-active-state-icon-color: inspection.get-theme-color($theme, $palette-name, text),
|
|
166
156
|
);
|
|
167
157
|
}
|
|
168
158
|
|
|
169
159
|
|
|
170
160
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
171
|
-
@function get-density-tokens($
|
|
161
|
+
@function get-density-tokens($theme) {
|
|
172
162
|
@return ();
|
|
173
163
|
}
|
|
174
164
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../theming/
|
|
2
|
+
@use '../../../theming/inspection';
|
|
4
3
|
@use '../../../style/sass-utils';
|
|
5
4
|
|
|
6
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -15,21 +14,19 @@ $prefix: (mat, divider);
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
-
@function get-color-tokens($
|
|
19
|
-
$foreground: map.get($config, foreground);
|
|
20
|
-
|
|
17
|
+
@function get-color-tokens($theme) {
|
|
21
18
|
@return (
|
|
22
|
-
color:
|
|
19
|
+
color: inspection.get-theme-color($theme, foreground, divider)
|
|
23
20
|
);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
27
|
-
@function get-typography-tokens($
|
|
24
|
+
@function get-typography-tokens($theme) {
|
|
28
25
|
@return ();
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
32
|
-
@function get-density-tokens($
|
|
29
|
+
@function get-density-tokens($theme) {
|
|
33
30
|
@return ();
|
|
34
31
|
}
|
|
35
32
|
|