@angular/material 16.0.0-next.2 → 16.0.0-next.4
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 +0 -2
- package/autocomplete/index.d.ts +7 -2
- package/card/_card-theme.scss +11 -14
- package/checkbox/_checkbox-theme.scss +31 -70
- package/core/option/_option-theme.scss +3 -2
- package/core/tokens/_token-utils.scss +33 -20
- package/core/tokens/m2/mdc/_checkbox.scss +131 -0
- package/core/tokens/m2/mdc/_elevated-card.scss +33 -28
- package/core/tokens/m2/mdc/_outlined-card.scss +38 -34
- package/core/tokens/m2/mdc/_table.scss +46 -0
- package/datepicker/index.d.ts +2 -0
- package/esm2020/autocomplete/autocomplete-trigger.mjs +18 -6
- package/esm2020/autocomplete/autocomplete.mjs +24 -2
- package/esm2020/card/card.mjs +2 -2
- package/esm2020/checkbox/checkbox.mjs +3 -3
- package/esm2020/core/option/option.mjs +4 -4
- package/esm2020/core/version.mjs +1 -1
- package/esm2020/datepicker/calendar-body.mjs +3 -3
- package/esm2020/datepicker/date-range-input.mjs +11 -3
- package/esm2020/list/list-option.mjs +2 -2
- package/esm2020/radio/radio.mjs +3 -3
- package/esm2020/select/select.mjs +43 -4
- package/esm2020/slide-toggle/slide-toggle.mjs +3 -3
- package/esm2020/sort/sort.mjs +2 -3
- package/esm2020/tooltip/tooltip.mjs +2 -2
- package/fesm2015/autocomplete.mjs +40 -6
- package/fesm2015/autocomplete.mjs.map +1 -1
- package/fesm2015/card.mjs +2 -2
- package/fesm2015/card.mjs.map +1 -1
- package/fesm2015/checkbox.mjs +2 -2
- package/fesm2015/checkbox.mjs.map +1 -1
- package/fesm2015/core.mjs +4 -4
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/datepicker.mjs +11 -3
- package/fesm2015/datepicker.mjs.map +1 -1
- package/fesm2015/list.mjs +2 -2
- package/fesm2015/list.mjs.map +1 -1
- package/fesm2015/radio.mjs +2 -2
- package/fesm2015/radio.mjs.map +1 -1
- package/fesm2015/select.mjs +42 -3
- package/fesm2015/select.mjs.map +1 -1
- package/fesm2015/slide-toggle.mjs +2 -2
- package/fesm2015/slide-toggle.mjs.map +1 -1
- package/fesm2015/sort.mjs +1 -2
- package/fesm2015/sort.mjs.map +1 -1
- package/fesm2015/tooltip.mjs +2 -2
- package/fesm2015/tooltip.mjs.map +1 -1
- package/fesm2020/autocomplete.mjs +40 -6
- package/fesm2020/autocomplete.mjs.map +1 -1
- package/fesm2020/card.mjs +2 -2
- package/fesm2020/card.mjs.map +1 -1
- package/fesm2020/checkbox.mjs +2 -2
- package/fesm2020/checkbox.mjs.map +1 -1
- package/fesm2020/core.mjs +4 -4
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/datepicker.mjs +11 -3
- package/fesm2020/datepicker.mjs.map +1 -1
- package/fesm2020/list.mjs +2 -2
- package/fesm2020/list.mjs.map +1 -1
- package/fesm2020/radio.mjs +2 -2
- package/fesm2020/radio.mjs.map +1 -1
- package/fesm2020/select.mjs +42 -3
- package/fesm2020/select.mjs.map +1 -1
- package/fesm2020/slide-toggle.mjs +2 -2
- package/fesm2020/slide-toggle.mjs.map +1 -1
- package/fesm2020/sort.mjs +1 -2
- package/fesm2020/sort.mjs.map +1 -1
- package/fesm2020/tooltip.mjs +2 -2
- package/fesm2020/tooltip.mjs.map +1 -1
- package/list/_list-theme.import.scss +0 -3
- package/list/_list-theme.scss +40 -16
- 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/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-update/index_bundled.js +25 -25
- package/select/index.d.ts +3 -1
- package/checkbox/_checkbox-private.scss +0 -54
- package/list/_list-option-theme.import.scss +0 -2
- package/list/_list-option-theme.scss +0 -13
package/_index.scss
CHANGED
|
@@ -31,8 +31,6 @@
|
|
|
31
31
|
$private-ease-in-out-curve-function, $private-swift-ease-out-duration, $private-xsmall;
|
|
32
32
|
@forward './core/typography/typography' show private-typography-to-2014-config,
|
|
33
33
|
private-typography-to-2018-config;
|
|
34
|
-
@forward './checkbox/checkbox-private' show private-checkbox-styles-with-color,
|
|
35
|
-
$private-checkbox-theme-config;
|
|
36
34
|
@forward './table/table-flex-styles' show private-table-flex-styles;
|
|
37
35
|
@forward './core/style/menu-common' as private-menu-common-*;
|
|
38
36
|
@forward './core/style/button-common' as private-button-common-*;
|
package/autocomplete/index.d.ts
CHANGED
|
@@ -111,6 +111,7 @@ export declare class MatAutocomplete extends _MatAutocompleteBase {
|
|
|
111
111
|
private _hideSingleSelectionIndicator;
|
|
112
112
|
/** Syncs the parent state with the individual options. */
|
|
113
113
|
_syncParentProperties(): void;
|
|
114
|
+
protected _skipPredicate(_option: _MatOptionBase): boolean;
|
|
114
115
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatAutocomplete, never>;
|
|
115
116
|
static ɵcmp: i0.ɵɵComponentDeclaration<MatAutocomplete, "mat-autocomplete", ["matAutocomplete"], { "disableRipple": "disableRipple"; "hideSingleSelectionIndicator": "hideSingleSelectionIndicator"; }, {}, ["optionGroups", "options"], ["*"], false, never>;
|
|
116
117
|
}
|
|
@@ -217,6 +218,7 @@ export declare abstract class _MatAutocompleteBase extends _MatAutocompleteMixin
|
|
|
217
218
|
private _setVisibilityClasses;
|
|
218
219
|
/** Sets the theming classes on a classlist based on the theme of the panel. */
|
|
219
220
|
private _setThemeClasses;
|
|
221
|
+
protected _skipPredicate(option: _MatOptionBase): boolean;
|
|
220
222
|
static ɵfac: i0.ɵɵFactoryDeclaration<_MatAutocompleteBase, never>;
|
|
221
223
|
static ɵdir: i0.ɵɵDirectiveDeclaration<_MatAutocompleteBase, never, never, { "ariaLabel": "aria-label"; "ariaLabelledby": "aria-labelledby"; "displayWith": "displayWith"; "autoActiveFirstOption": "autoActiveFirstOption"; "autoSelectActiveOption": "autoSelectActiveOption"; "panelWidth": "panelWidth"; "classList": "class"; }, { "optionSelected": "optionSelected"; "opened": "opened"; "closed": "closed"; "optionActivated": "optionActivated"; }, never, never, false, never>;
|
|
222
224
|
}
|
|
@@ -435,8 +437,11 @@ export declare abstract class _MatAutocompleteTriggerBase implements ControlValu
|
|
|
435
437
|
/** Returns the width of the input element, so the panel width can match it. */
|
|
436
438
|
private _getHostWidth;
|
|
437
439
|
/**
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
+
* Reset the active item to -1. This is so that pressing arrow keys will activate the correct
|
|
441
|
+
* option.
|
|
442
|
+
*
|
|
443
|
+
* If the consumer opted-in to automatically activatating the first option, activate the first
|
|
444
|
+
* *enabled* option.
|
|
440
445
|
*/
|
|
441
446
|
private _resetActiveItem;
|
|
442
447
|
/** Determines whether the panel can be opened. */
|
package/card/_card-theme.scss
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@use '../core/theming/theming';
|
|
2
|
-
@use '../core/style/private';
|
|
3
2
|
@use '../core/typography/typography';
|
|
4
3
|
@use '../core/tokens/token-utils';
|
|
5
4
|
@use '../core/tokens/m2/mat/card' as tokens-mat-card;
|
|
@@ -10,8 +9,16 @@
|
|
|
10
9
|
|
|
11
10
|
@mixin color($config-or-theme) {
|
|
12
11
|
$config: theming.get-color-config($config-or-theme);
|
|
13
|
-
$mdc-elevated-card-color-tokens:
|
|
14
|
-
|
|
12
|
+
$mdc-elevated-card-color-tokens: token-utils.resolve-elevation(
|
|
13
|
+
tokens-mdc-elevated-card.get-color-tokens($config),
|
|
14
|
+
container-elevation,
|
|
15
|
+
container-shadow-color
|
|
16
|
+
);
|
|
17
|
+
$mdc-outlined-card-color-tokens: token-utils.resolve-elevation(
|
|
18
|
+
tokens-mdc-outlined-card.get-color-tokens($config),
|
|
19
|
+
container-elevation,
|
|
20
|
+
container-shadow-color,
|
|
21
|
+
);
|
|
15
22
|
$mat-card-color-tokens: tokens-mat-card.get-color-tokens($config);
|
|
16
23
|
|
|
17
24
|
// Add values for card tokens.
|
|
@@ -19,22 +26,12 @@
|
|
|
19
26
|
@include mdc-elevated-card-theme.theme($mdc-elevated-card-color-tokens);
|
|
20
27
|
@include mdc-outlined-card-theme.theme($mdc-outlined-card-color-tokens);
|
|
21
28
|
@include token-utils.create-token-values(tokens-mat-card.$prefix, $mat-card-color-tokens);
|
|
22
|
-
|
|
23
|
-
// TODO(mmalerba): This should be based on tokens, but the elevation tokens don't seem to be
|
|
24
|
-
// working currently. They wind up setting values like `box-shadow: var(--e); --e: 1`
|
|
25
|
-
@include private.private-theme-elevation(1, $config);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.mat-mdc-card-outlined {
|
|
29
|
-
// TODO(mmalerba): This should be based on tokens, but the elevation tokens don't seem to be
|
|
30
|
-
// working currently. They wind up setting values like `box-shadow: var(--e); --e: 1`
|
|
31
|
-
@include private.private-theme-elevation(0, $config);
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
@mixin typography($config-or-theme) {
|
|
36
33
|
$config: typography.private-typography-to-2018-config(
|
|
37
|
-
|
|
34
|
+
theming.get-typography-config($config-or-theme));
|
|
38
35
|
$mdc-elevated-card-typography-tokens: tokens-mdc-elevated-card.get-typography-tokens($config);
|
|
39
36
|
$mdc-outlined-card-typography-tokens: tokens-mdc-outlined-card.get-typography-tokens($config);
|
|
40
37
|
$mat-card-typography-tokens: tokens-mat-card.get-typography-tokens($config);
|
|
@@ -1,74 +1,36 @@
|
|
|
1
|
-
@use '
|
|
1
|
+
@use 'sass:map';
|
|
2
2
|
@use '@material/checkbox/checkbox-theme' as mdc-checkbox-theme;
|
|
3
3
|
@use '@material/form-field' as mdc-form-field;
|
|
4
|
-
@use '@material/theme/theme-color' as mdc-theme-color;
|
|
5
|
-
@use '@material/theme/theme';
|
|
6
|
-
@use 'sass:map';
|
|
7
|
-
@use 'sass:color';
|
|
8
|
-
@use '../core/ripple/ripple-theme';
|
|
9
4
|
@use '../core/theming/theming';
|
|
10
5
|
@use '../core/typography/typography';
|
|
11
6
|
@use '../core/mdc-helpers/mdc-helpers';
|
|
12
|
-
@use '
|
|
13
|
-
|
|
14
|
-
// Apply ripple colors to the MatRipple element and the MDC ripple element when the
|
|
15
|
-
// checkbox is selected.
|
|
16
|
-
@mixin _selected-ripple-colors($theme, $mdc-color) {
|
|
17
|
-
.mdc-checkbox--selected ~ {
|
|
18
|
-
.mat-mdc-checkbox-ripple {
|
|
19
|
-
@include ripple-theme.color((
|
|
20
|
-
foreground: (
|
|
21
|
-
base: mdc-theme-color.prop-value($mdc-color)
|
|
22
|
-
),
|
|
23
|
-
));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.mdc-checkbox__ripple {
|
|
27
|
-
background: $theme;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
7
|
+
@use '../core/tokens/m2/mdc/checkbox' as tokens-mdc-checkbox;
|
|
31
8
|
|
|
32
9
|
@mixin color($config-or-theme) {
|
|
33
10
|
$config: theming.get-color-config($config-or-theme);
|
|
34
|
-
$primary:
|
|
35
|
-
$
|
|
36
|
-
$warn: theming.get-color-from-palette(map.get($config, warn));
|
|
11
|
+
$primary: map.get($config, primary);
|
|
12
|
+
$warn: map.get($config, warn);
|
|
37
13
|
$foreground: map.get($config, foreground);
|
|
38
14
|
|
|
39
|
-
|
|
40
|
-
.
|
|
41
|
-
@include mdc-form-field.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
|
|
42
|
-
@include ripple-theme.color((
|
|
43
|
-
foreground: (
|
|
44
|
-
base: mdc-theme-color.prop-value(on-surface)
|
|
45
|
-
),
|
|
46
|
-
));
|
|
15
|
+
.mat-mdc-checkbox {
|
|
16
|
+
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($config));
|
|
47
17
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// MDC's checkbox doesn't support a `color` property. We add support for it by adding a CSS
|
|
53
|
-
// class for accent and warn style, and applying the appropriate overrides below. Since we
|
|
54
|
-
// don't use MDC's ripple, we also need to set the color for our replacement ripple.
|
|
55
|
-
&.mat-primary {
|
|
56
|
-
@include checkbox-private.private-checkbox-styles-with-color($config, $primary, primary);
|
|
57
|
-
@include _selected-ripple-colors($primary, primary);
|
|
58
|
-
}
|
|
18
|
+
&.mat-primary {
|
|
19
|
+
$primary-config: map.merge($config, (accent: $primary));
|
|
20
|
+
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($primary-config));
|
|
21
|
+
}
|
|
59
22
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
23
|
+
&.mat-warn {
|
|
24
|
+
$warn-config: map.merge($config, (accent: $warn));
|
|
25
|
+
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($warn-config));
|
|
26
|
+
}
|
|
64
27
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
28
|
+
@include mdc-helpers.using-mdc-theme($config) {
|
|
29
|
+
// TODO(mmalerba): Switch to static-styles, theme-styles, and theme once they're available.
|
|
30
|
+
@include mdc-form-field.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
|
|
69
31
|
}
|
|
70
32
|
|
|
71
|
-
|
|
33
|
+
&.mat-mdc-checkbox-disabled label {
|
|
72
34
|
// MDC should set the disabled color on the label, but doesn't, so we do it here instead.
|
|
73
35
|
color: theming.get-color-from-palette($foreground, disabled-text);
|
|
74
36
|
}
|
|
@@ -78,27 +40,26 @@
|
|
|
78
40
|
@mixin typography($config-or-theme) {
|
|
79
41
|
$config: typography.private-typography-to-2018-config(
|
|
80
42
|
theming.get-typography-config($config-or-theme));
|
|
81
|
-
|
|
82
|
-
@include mdc-checkbox.
|
|
83
|
-
|
|
43
|
+
.mat-mdc-checkbox {
|
|
44
|
+
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-typography-tokens($config));
|
|
45
|
+
|
|
46
|
+
@include mdc-helpers.using-mdc-typography($config) {
|
|
47
|
+
// TODO(mmalerba): Switch to static-styles, theme-styles, and theme once they're available.
|
|
48
|
+
@include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
|
|
49
|
+
}
|
|
84
50
|
}
|
|
85
51
|
}
|
|
86
52
|
|
|
87
53
|
@mixin density($config-or-theme) {
|
|
88
54
|
$density-scale: theming.get-density-config($config-or-theme);
|
|
89
55
|
|
|
90
|
-
|
|
91
|
-
.
|
|
92
|
-
|
|
93
|
-
$density-scale,
|
|
94
|
-
$query: mdc-helpers.$mdc-base-styles-query
|
|
95
|
-
);
|
|
96
|
-
}
|
|
56
|
+
.mat-mdc-checkbox {
|
|
57
|
+
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-density-tokens($density-scale));
|
|
58
|
+
}
|
|
97
59
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
60
|
+
@include mdc-helpers.if-touch-targets-unsupported($density-scale) {
|
|
61
|
+
.mat-mdc-checkbox-touch-target {
|
|
62
|
+
display: none;
|
|
102
63
|
}
|
|
103
64
|
}
|
|
104
65
|
}
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
// we have explicitly set the default color.
|
|
18
18
|
@include mdc-theme.prop(color, text-primary-on-background);
|
|
19
19
|
|
|
20
|
+
// Increase specificity to override styles from list theme.
|
|
20
21
|
&:hover:not(.mdc-list-item--disabled),
|
|
21
|
-
&:focus
|
|
22
|
-
&.mat-mdc-option-active,
|
|
22
|
+
&:focus.mdc-list-item,
|
|
23
|
+
&.mat-mdc-option-active.mdc-list-item,
|
|
23
24
|
|
|
24
25
|
// In multiple mode there is a checkbox to show that the option is selected.
|
|
25
26
|
&.mdc-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-list-item--disabled) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
+
@use '@material/elevation/elevation-theme' as mdc-elevation-theme;
|
|
2
3
|
@use '@material/theme/custom-properties' as mdc-custom-properties;
|
|
3
4
|
@use '@material/theme/theme' as mdc-theme;
|
|
4
5
|
@use '@material/theme/keys' as mdc-keys;
|
|
@@ -11,12 +12,12 @@ $_placeholder-color-palette: theming.define-palette(palette.$red-palette);
|
|
|
11
12
|
// Placeholder color config that can be passed to token getter functions when generating token
|
|
12
13
|
// slots.
|
|
13
14
|
$placeholder-color-config: (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
primary: $_placeholder-color-palette,
|
|
16
|
+
accent: $_placeholder-color-palette,
|
|
17
|
+
warn: $_placeholder-color-palette,
|
|
18
|
+
is-dark: false,
|
|
19
|
+
foreground: palette.$light-theme-foreground-palette,
|
|
20
|
+
background: palette.$light-theme-background-palette,
|
|
20
21
|
);
|
|
21
22
|
|
|
22
23
|
$_placeholder-typography-level-config: mdc-helpers.typography-config-level-from-mdc(body1);
|
|
@@ -24,20 +25,20 @@ $_placeholder-typography-level-config: mdc-helpers.typography-config-level-from-
|
|
|
24
25
|
// Placeholder typography config that can be passed to token getter functions when generating token
|
|
25
26
|
// slots.
|
|
26
27
|
$placeholder-typography-config: (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
font-family: Roboto,
|
|
29
|
+
headline-1: $_placeholder-typography-level-config,
|
|
30
|
+
headline-2: $_placeholder-typography-level-config,
|
|
31
|
+
headline-3: $_placeholder-typography-level-config,
|
|
32
|
+
headline-4: $_placeholder-typography-level-config,
|
|
33
|
+
headline-5: $_placeholder-typography-level-config,
|
|
34
|
+
headline-6: $_placeholder-typography-level-config,
|
|
35
|
+
subtitle-1: $_placeholder-typography-level-config,
|
|
36
|
+
subtitle-2: $_placeholder-typography-level-config,
|
|
37
|
+
body-1: $_placeholder-typography-level-config,
|
|
38
|
+
body-2: $_placeholder-typography-level-config,
|
|
39
|
+
caption: $_placeholder-typography-level-config,
|
|
40
|
+
button: $_placeholder-typography-level-config,
|
|
41
|
+
overline: $_placeholder-typography-level-config,
|
|
41
42
|
);
|
|
42
43
|
|
|
43
44
|
// Placeholder density config that can be passed to token getter functions when generating token
|
|
@@ -94,3 +95,15 @@ $_component-prefix: null;
|
|
|
94
95
|
}
|
|
95
96
|
@return $result;
|
|
96
97
|
}
|
|
98
|
+
|
|
99
|
+
// MDC doesn't currently handle elevation tokens properly. As a temporary workaround we can combine
|
|
100
|
+
// the elevation and shadow-color tokens into a full box-shadow and use it as the value for the
|
|
101
|
+
// elevation token.
|
|
102
|
+
@function resolve-elevation($tokens, $elevation-token, $shadow-color-token) {
|
|
103
|
+
$elevation: map.get($tokens, $elevation-token);
|
|
104
|
+
$shadow-color: map.get($tokens, $shadow-color-token);
|
|
105
|
+
@return map.merge($tokens, (
|
|
106
|
+
$elevation-token: mdc-elevation-theme.elevation-box-shadow($elevation, $shadow-color),
|
|
107
|
+
$shadow-color-token: null,
|
|
108
|
+
));
|
|
109
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../../theming/palette';
|
|
3
|
+
@use '../../../theming/theming';
|
|
4
|
+
@use '../../token-utils';
|
|
5
|
+
@use '@material/theme/theme-color' as mdc-theme-color;
|
|
6
|
+
|
|
7
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
8
|
+
$prefix: (mdc, checkbox);
|
|
9
|
+
|
|
10
|
+
// MDC logs a warning if the `contrast-tone` function is called with a CSS variable.
|
|
11
|
+
// This function falls back to determining the tone based on whether the theme is light or dark.
|
|
12
|
+
@function _contrast-tone($value, $is-dark, $light-color: '#fff', $dark-color: '#000') {
|
|
13
|
+
@if ($value == 'dark' or $value == 'light' or type-of($value) == 'color') {
|
|
14
|
+
@return if(mdc-theme-color.contrast-tone($value) == 'dark', $dark-color, $light-color);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@return if($is-dark, $light-color, $dark-color);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
21
|
+
// but may be in a future version of the theming API.
|
|
22
|
+
//
|
|
23
|
+
// Tokens that are available in MDC, but not used in Angular Material should be mapped to `null`.
|
|
24
|
+
// `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
|
|
25
|
+
// our CSS.
|
|
26
|
+
@function get-unthemable-tokens() {
|
|
27
|
+
@return (
|
|
28
|
+
// The color of the checkmark when the checkbox is selected and disabled.
|
|
29
|
+
disabled-selected-checkmark-color: #fff,
|
|
30
|
+
// The opacity of the ripple when the checkbox is selected and focused.
|
|
31
|
+
selected-focus-state-layer-opacity: 0.16,
|
|
32
|
+
// The opacity of the ripple when the checkbox is selected and hovered.
|
|
33
|
+
selected-hover-state-layer-opacity: 0.04,
|
|
34
|
+
// The opacity of the ripple when the checkbox is selected and pressed.
|
|
35
|
+
selected-pressed-state-layer-opacity: 0.16,
|
|
36
|
+
// The opacity of the ripple when the checkbox is unselected and focused.
|
|
37
|
+
unselected-focus-state-layer-opacity: 0.16,
|
|
38
|
+
// The opacity of the ripple when the checkbox is unselected and hovered.
|
|
39
|
+
unselected-hover-state-layer-opacity: 0.04,
|
|
40
|
+
// The opacity of the ripple when the checkbox is unselected and pressed.
|
|
41
|
+
unselected-pressed-state-layer-opacity: 0.16,
|
|
42
|
+
// =============================================================================================
|
|
43
|
+
// = TOKENS NOT USED IN ANGULAR MATERIAL =
|
|
44
|
+
// =============================================================================================
|
|
45
|
+
// MDC currently doesn't output a slot for these tokens.
|
|
46
|
+
disabled-selected-icon-opacity: null,
|
|
47
|
+
disabled-unselected-icon-opacity: null,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
52
|
+
@function get-color-tokens($config) {
|
|
53
|
+
$foreground: map.get($config, foreground);
|
|
54
|
+
$accent: map.get($config, accent);
|
|
55
|
+
$is-dark: map.get($config, is-dark);
|
|
56
|
+
$foreground-base: theming.get-color-from-palette($foreground, base);
|
|
57
|
+
$accent-default: theming.get-color-from-palette($accent, default);
|
|
58
|
+
$disabled-color: theming.get-color-from-palette($foreground, base, 0.38);
|
|
59
|
+
$selected-color: theming.get-color-from-palette($accent);
|
|
60
|
+
$border-color: theming.get-color-from-palette($foreground, base, 0.54);
|
|
61
|
+
$active-border-color:
|
|
62
|
+
theming.get-color-from-palette(palette.$gray-palette, if($is-dark, 200, 900));
|
|
63
|
+
|
|
64
|
+
@return (
|
|
65
|
+
// The color of the checkbox fill when the checkbox is selected and disabled.
|
|
66
|
+
disabled-selected-icon-color: $disabled-color,
|
|
67
|
+
// The color of the checkbox border when the checkbox is unselected and disabled.
|
|
68
|
+
disabled-unselected-icon-color: $disabled-color,
|
|
69
|
+
// The color of the checkmark when the checkbox is selected.
|
|
70
|
+
selected-checkmark-color: _contrast-tone($selected-color, $is-dark),
|
|
71
|
+
// The color of the checkbox fill when the checkbox is selected and focused.
|
|
72
|
+
selected-focus-icon-color: $selected-color,
|
|
73
|
+
// The color of the checkbox fill when the checkbox is selected and hovered.
|
|
74
|
+
selected-hover-icon-color: $selected-color,
|
|
75
|
+
// The color of the checkbox fill when the checkbox is selected.
|
|
76
|
+
selected-icon-color: $selected-color,
|
|
77
|
+
// The color of the checkbox fill when the checkbox is selected an pressed.
|
|
78
|
+
selected-pressed-icon-color: $selected-color,
|
|
79
|
+
// The color of the checkbox border when the checkbox is unselected and focused.
|
|
80
|
+
unselected-focus-icon-color: $active-border-color,
|
|
81
|
+
// The color of the checkbox border when the checkbox is unselected and hovered.
|
|
82
|
+
unselected-hover-icon-color: $active-border-color,
|
|
83
|
+
// The color of the checkbox border when the checkbox is unselected.
|
|
84
|
+
unselected-icon-color: $border-color,
|
|
85
|
+
// The color of the checkbox border when the checkbox is unselected and pressed.
|
|
86
|
+
unselected-pressed-icon-color: $border-color,
|
|
87
|
+
// The color of the ripple when the checkbox is selected and focused.
|
|
88
|
+
selected-focus-state-layer-color: $accent-default,
|
|
89
|
+
// The color of the ripple when the checkbox is selected and hovered.
|
|
90
|
+
selected-hover-state-layer-color: $accent-default,
|
|
91
|
+
// The color of the ripple when the checkbox is selected and pressed.
|
|
92
|
+
selected-pressed-state-layer-color: $accent-default,
|
|
93
|
+
// The color of the ripple when the checkbox is unselected and focused.
|
|
94
|
+
unselected-focus-state-layer-color: $foreground-base,
|
|
95
|
+
// The color of the ripple when the checkbox is unselected and hovered.
|
|
96
|
+
unselected-hover-state-layer-color: $foreground-base,
|
|
97
|
+
// The color of the ripple when the checkbox is unselected and pressed.
|
|
98
|
+
unselected-pressed-state-layer-color: $foreground-base,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
103
|
+
@function get-typography-tokens($config) {
|
|
104
|
+
@return ();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
108
|
+
@function get-density-tokens($config) {
|
|
109
|
+
$scale: theming.clamp-density($config, -3);
|
|
110
|
+
|
|
111
|
+
@return (
|
|
112
|
+
// The diameter of the checkbox's ripple.
|
|
113
|
+
state-layer-size: map.get((
|
|
114
|
+
0: 40px,
|
|
115
|
+
-1: 36px,
|
|
116
|
+
-2: 32px,
|
|
117
|
+
-3: 28px,
|
|
118
|
+
), $scale)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
123
|
+
// This is used to create token slots.
|
|
124
|
+
@function get-token-slots() {
|
|
125
|
+
@return token-utils.merge-all(
|
|
126
|
+
get-unthemable-tokens(),
|
|
127
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
128
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
129
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
130
|
+
);
|
|
131
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
+
@use '../../../style/elevation';
|
|
2
3
|
@use '../../../theming/theming';
|
|
3
4
|
@use '../../token-utils';
|
|
4
5
|
|
|
@@ -14,45 +15,49 @@ $prefix: (mdc, elevated-card);
|
|
|
14
15
|
@function get-unthemable-tokens() {
|
|
15
16
|
@return (
|
|
16
17
|
// The border-radius of the card.
|
|
17
|
-
|
|
18
|
+
container-shape: 4px,
|
|
18
19
|
// =============================================================================================
|
|
19
20
|
// = TOKENS NOT USED IN ANGULAR MATERIAL =
|
|
20
21
|
// =============================================================================================
|
|
21
|
-
// TODO(mmalerba): The elevation tokens don't seem to work currently.
|
|
22
|
-
// Should work with MDC to figure out what's wrong.
|
|
23
|
-
container-elevation: null,
|
|
24
|
-
container-shadow-color: null,
|
|
25
22
|
// Angular Material's card is not an interactive element, and therefore does not support states.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
disabled-container-color: null,
|
|
24
|
+
disabled-container-elevation: null,
|
|
25
|
+
disabled-container-opacity: null,
|
|
26
|
+
dragged-container-elevation: null,
|
|
27
|
+
dragged-state-layer-color: null,
|
|
28
|
+
dragged-state-layer-opacity: null,
|
|
29
|
+
focus-container-elevation: null,
|
|
30
|
+
focus-state-layer-color:null,
|
|
31
|
+
focus-state-layer-opacity: null,
|
|
32
|
+
hover-container-elevation: null,
|
|
33
|
+
hover-state-layer-color: null,
|
|
34
|
+
hover-state-layer-opacity: null,
|
|
35
|
+
pressed-container-elevation: null,
|
|
36
|
+
pressed-state-layer-color: null,
|
|
37
|
+
pressed-state-layer-opacity: null,
|
|
41
38
|
// Angular Material does not currently support surface tint.
|
|
42
|
-
|
|
39
|
+
container-surface-tint-layer-color: null,
|
|
43
40
|
// MDC does not seem to use these tokens.
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
icon-color: null,
|
|
42
|
+
icon-size: null,
|
|
46
43
|
);
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
50
47
|
@function get-color-tokens($config) {
|
|
51
48
|
$background: map.get($config, background);
|
|
49
|
+
$foreground: map.get($config, foreground);
|
|
50
|
+
$elevation: theming.get-color-from-palette($foreground, elevation);
|
|
52
51
|
|
|
53
52
|
@return (
|
|
54
53
|
// The background color of the card.
|
|
55
|
-
|
|
54
|
+
container-color: theming.get-color-from-palette($background, card),
|
|
55
|
+
// The elevation level of the card.
|
|
56
|
+
// (Part of the color tokens because it needs to be combined with the shadow color to generate
|
|
57
|
+
// the final box-shadow).
|
|
58
|
+
container-elevation: 1,
|
|
59
|
+
// The color of the card's shadow.
|
|
60
|
+
container-shadow-color: if($elevation != null, $elevation, elevation.$color),
|
|
56
61
|
);
|
|
57
62
|
}
|
|
58
63
|
|
|
@@ -70,9 +75,9 @@ $prefix: (mdc, elevated-card);
|
|
|
70
75
|
// This is used to create token slots.
|
|
71
76
|
@function get-token-slots() {
|
|
72
77
|
@return token-utils.merge-all(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
get-unthemable-tokens(),
|
|
79
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
80
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
81
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
77
82
|
);
|
|
78
83
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
+
@use '../../../style/elevation';
|
|
2
3
|
@use '../../../theming/theming';
|
|
3
4
|
@use '../../token-utils';
|
|
4
5
|
|
|
@@ -14,41 +15,37 @@ $prefix: (mdc, outlined-card);
|
|
|
14
15
|
@function get-unthemable-tokens() {
|
|
15
16
|
@return (
|
|
16
17
|
// The border-radius of the card.
|
|
17
|
-
|
|
18
|
+
container-shape: 4px,
|
|
18
19
|
// The thickness of the card's border.
|
|
19
|
-
|
|
20
|
+
outline-width: 1px,
|
|
20
21
|
// =============================================================================================
|
|
21
22
|
// = TOKENS NOT USED IN ANGULAR MATERIAL =
|
|
22
23
|
// =============================================================================================
|
|
23
|
-
// TODO(mmalerba): The elevation tokens don't seem to work currently.
|
|
24
|
-
// Should work with MDC to figure out what's wrong.
|
|
25
|
-
container-elevation: null,
|
|
26
|
-
container-shadow-color: null,
|
|
27
24
|
// Angular Material's card is not an interactive element, and therefore does not support states.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
disabled-container-elevation: null,
|
|
26
|
+
disabled-outline-color: null,
|
|
27
|
+
disabled-outline-opacity: null,
|
|
28
|
+
dragged-container-elevation: null,
|
|
29
|
+
dragged-outline-color: null,
|
|
30
|
+
dragged-state-layer-color: null,
|
|
31
|
+
dragged-state-layer-opacity: null,
|
|
32
|
+
focus-container-elevation: null,
|
|
33
|
+
focus-outline-color: null,
|
|
34
|
+
focus-state-layer-color: null,
|
|
35
|
+
focus-state-layer-opacity: null,
|
|
36
|
+
hover-container-elevation: null,
|
|
37
|
+
hover-outline-color: null,
|
|
38
|
+
hover-state-layer-color: null,
|
|
39
|
+
hover-state-layer-opacity: null,
|
|
40
|
+
pressed-container-elevation: null,
|
|
41
|
+
pressed-outline-color: null,
|
|
42
|
+
pressed-state-layer-color: null,
|
|
43
|
+
pressed-state-layer-opacity: null,
|
|
47
44
|
// Angular Material does not currently support surface tint.
|
|
48
|
-
|
|
45
|
+
container-surface-tint-layer-color: null,
|
|
49
46
|
// MDC does not seem to use these tokens.
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
icon-color: null,
|
|
48
|
+
icon-size: null,
|
|
52
49
|
);
|
|
53
50
|
}
|
|
54
51
|
|
|
@@ -56,12 +53,19 @@ $prefix: (mdc, outlined-card);
|
|
|
56
53
|
@function get-color-tokens($config) {
|
|
57
54
|
$background: map.get($config, background);
|
|
58
55
|
$foreground: map.get($config, foreground);
|
|
56
|
+
$elevation: theming.get-color-from-palette($foreground, elevation);
|
|
59
57
|
|
|
60
58
|
@return (
|
|
61
59
|
// The background color of the card.
|
|
62
|
-
|
|
60
|
+
container-color: theming.get-color-from-palette($background, card),
|
|
63
61
|
// The border color of the card.
|
|
64
|
-
|
|
62
|
+
outline-color: theming.get-color-from-palette($foreground, base, 0.12),
|
|
63
|
+
// The elevation level of the card.
|
|
64
|
+
// (Part of the color tokens because it needs to be combined with the shadow color to generate
|
|
65
|
+
// the final box-shadow).
|
|
66
|
+
container-elevation: 0,
|
|
67
|
+
// The color of the card's shadow.
|
|
68
|
+
container-shadow-color: if($elevation != null, $elevation, elevation.$color),
|
|
65
69
|
);
|
|
66
70
|
}
|
|
67
71
|
|
|
@@ -79,9 +83,9 @@ $prefix: (mdc, outlined-card);
|
|
|
79
83
|
// This is used to create token slots.
|
|
80
84
|
@function get-token-slots() {
|
|
81
85
|
@return token-utils.merge-all(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
get-unthemable-tokens(),
|
|
87
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
88
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
89
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
86
90
|
);
|
|
87
91
|
}
|