@angular/material 20.1.0-next.0 → 20.1.0-next.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/autocomplete/_m2-autocomplete.scss +5 -2
- package/bottom-sheet/_m2-bottom-sheet.scss +6 -2
- package/button/_m2-button.scss +39 -34
- package/button/_m2-fab.scss +14 -10
- package/button/_m2-icon-button.scss +7 -5
- package/card/_m2-card.scss +1 -1
- package/checkbox/_m2-checkbox.scss +2 -3
- package/chips/_m2-chip.scss +6 -23
- package/core/m2/_theming.scss +72 -108
- package/core/option/_m2-optgroup.scss +4 -1
- package/core/option/_m2-option.scss +7 -6
- package/core/ripple/_m2-ripple.scss +6 -10
- package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +2 -3
- package/core/tokens/_m2-utils.scss +1 -11
- package/core/tokens/_m3-system.scss +11 -9
- package/datepicker/_datepicker-theme.scss +16 -54
- package/datepicker/_m2-datepicker.scss +26 -109
- package/datepicker/index.d.ts +1 -1
- package/dialog/_m2-dialog.scss +6 -4
- package/divider/_m2-divider.scss +4 -2
- package/fesm2022/button.mjs +2 -2
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/slider.mjs +2 -2
- package/fesm2022/slider.mjs.map +1 -1
- package/form-field/_m2-form-field.scss +2 -2
- package/list/_m2-list.scss +5 -9
- package/menu/_m2-menu.scss +12 -9
- package/package.json +2 -2
- package/paginator/_m2-paginator.scss +2 -1
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/radio/_m3-radio.scss +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/select/_m2-select.scss +4 -3
- package/select/_select-theme.scss +6 -3
- package/slider/_m2-slider.scss +27 -26
- package/slider/_slider-theme.scss +2 -2
- package/snack-bar/_m2-snack-bar.scss +0 -1
- package/sort/_m2-sort.scss +5 -2
- package/table/_m2-table.scss +7 -5
- package/tabs/_m2-tabs.scss +5 -11
- package/timepicker/_m2-timepicker.scss +5 -2
- package/toolbar/_m2-toolbar.scss +4 -2
- package/tree/_m2-tree.scss +5 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
@use '../core/theming/inspection';
|
|
2
1
|
@use '../core/style/elevation';
|
|
2
|
+
@use '../core/tokens/m2-utils';
|
|
3
|
+
@use 'sass:map';
|
|
3
4
|
|
|
4
5
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
5
6
|
// but may be in a future version of the theming API.
|
|
@@ -12,8 +13,10 @@
|
|
|
12
13
|
|
|
13
14
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
14
15
|
@function get-color-tokens($theme) {
|
|
16
|
+
$system: m2-utils.get-system($theme);
|
|
17
|
+
|
|
15
18
|
@return (
|
|
16
|
-
autocomplete-background-color:
|
|
19
|
+
autocomplete-background-color: map.get($system, surface)
|
|
17
20
|
);
|
|
18
21
|
}
|
|
19
22
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
@use '../core/theming/inspection';
|
|
2
|
+
@use '../core/tokens/m2-utils';
|
|
3
|
+
@use 'sass:map';
|
|
2
4
|
|
|
3
5
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
4
6
|
// but may be in a future version of the theming API.
|
|
@@ -11,9 +13,11 @@
|
|
|
11
13
|
|
|
12
14
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
13
15
|
@function get-color-tokens($theme) {
|
|
16
|
+
$system: m2-utils.get-system($theme);
|
|
17
|
+
|
|
14
18
|
@return (
|
|
15
|
-
bottom-sheet-container-text-color:
|
|
16
|
-
bottom-sheet-container-background-color:
|
|
19
|
+
bottom-sheet-container-text-color: map.get($system, on-surface),
|
|
20
|
+
bottom-sheet-container-background-color: map.get($system, surface),
|
|
17
21
|
);
|
|
18
22
|
}
|
|
19
23
|
|
package/button/_m2-button.scss
CHANGED
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
@function get-color-tokens($theme) {
|
|
45
45
|
$system: m2-utils.get-system($theme);
|
|
46
46
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
47
|
-
$outline: inspection.get-theme-color($theme, system, outline);
|
|
48
47
|
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
49
48
|
$disabled-container : m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
50
49
|
|
|
@@ -52,55 +51,56 @@
|
|
|
52
51
|
button-filled-container-color: map.get($system, surface),
|
|
53
52
|
button-filled-disabled-container-color: $disabled-container,
|
|
54
53
|
button-filled-disabled-label-text-color: $disabled,
|
|
55
|
-
button-filled-disabled-state-layer-color:
|
|
54
|
+
button-filled-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
56
55
|
button-filled-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
57
56
|
button-filled-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
58
|
-
button-filled-label-text-color:
|
|
57
|
+
button-filled-label-text-color: map.get($system, on-surface),
|
|
59
58
|
button-filled-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
60
|
-
button-filled-ripple-color:
|
|
61
|
-
|
|
59
|
+
button-filled-ripple-color: m3-utils.color-with-opacity(
|
|
60
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
61
|
+
button-filled-state-layer-color: map.get($system, on-surface),
|
|
62
62
|
button-outlined-disabled-label-text-color: $disabled,
|
|
63
|
-
button-outlined-disabled-outline-color: $outline,
|
|
64
|
-
button-outlined-disabled-state-layer-color:
|
|
65
|
-
inspection.get-theme-color($theme, foreground, base),
|
|
63
|
+
button-outlined-disabled-outline-color: map.get($system, outline),
|
|
64
|
+
button-outlined-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
66
65
|
button-outlined-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
67
66
|
button-outlined-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
68
|
-
button-outlined-label-text-color:
|
|
69
|
-
button-outlined-outline-color: $outline,
|
|
70
|
-
button-outlined-pressed-state-layer-opacity:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
button-outlined-state-layer-color:
|
|
67
|
+
button-outlined-label-text-color: map.get($system, on-surface),
|
|
68
|
+
button-outlined-outline-color: map.get($system, outline),
|
|
69
|
+
button-outlined-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
70
|
+
button-outlined-ripple-color: m3-utils.color-with-opacity(
|
|
71
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
72
|
+
button-outlined-state-layer-color: map.get($system, on-surface),
|
|
74
73
|
button-protected-container-color: map.get($system, surface),
|
|
75
74
|
button-protected-disabled-container-color: $disabled-container,
|
|
76
75
|
button-protected-disabled-label-text-color: $disabled,
|
|
77
|
-
button-protected-disabled-state-layer-color:
|
|
78
|
-
inspection.get-theme-color($theme, foreground, base),
|
|
76
|
+
button-protected-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
79
77
|
button-protected-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
80
78
|
button-protected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
81
|
-
button-protected-label-text-color:
|
|
82
|
-
button-protected-pressed-state-layer-opacity:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
button-protected-state-layer-color:
|
|
79
|
+
button-protected-label-text-color: map.get($system, on-surface),
|
|
80
|
+
button-protected-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
81
|
+
button-protected-ripple-color: m3-utils.color-with-opacity(
|
|
82
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
83
|
+
button-protected-state-layer-color: map.get($system, on-surface),
|
|
86
84
|
button-text-disabled-label-text-color: $disabled,
|
|
87
|
-
button-text-disabled-state-layer-color:
|
|
85
|
+
button-text-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
88
86
|
button-text-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
89
87
|
button-text-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
90
|
-
button-text-label-text-color:
|
|
88
|
+
button-text-label-text-color: map.get($system, on-surface),
|
|
91
89
|
button-text-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
92
|
-
button-text-ripple-color:
|
|
93
|
-
|
|
90
|
+
button-text-ripple-color: m3-utils.color-with-opacity(
|
|
91
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
92
|
+
button-text-state-layer-color: map.get($system, on-surface),
|
|
94
93
|
button-tonal-container-color: map.get($system, surface),
|
|
95
94
|
button-tonal-disabled-container-color: $disabled-container,
|
|
96
95
|
button-tonal-disabled-label-text-color: $disabled,
|
|
97
|
-
button-tonal-disabled-state-layer-color:
|
|
96
|
+
button-tonal-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
98
97
|
button-tonal-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
99
98
|
button-tonal-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
100
|
-
button-tonal-label-text-color:
|
|
99
|
+
button-tonal-label-text-color: map.get($system, on-surface),
|
|
101
100
|
button-tonal-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
102
|
-
button-tonal-ripple-color:
|
|
103
|
-
|
|
101
|
+
button-tonal-ripple-color: m3-utils.color-with-opacity(
|
|
102
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
103
|
+
button-tonal-state-layer-color: map.get($system, on-surface),
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -116,22 +116,27 @@
|
|
|
116
116
|
@return (
|
|
117
117
|
button-filled-container-color: map.get($system, primary),
|
|
118
118
|
button-filled-label-text-color: map.get($system, on-primary),
|
|
119
|
-
button-filled-ripple-color: m3-utils.color-with-opacity(
|
|
119
|
+
button-filled-ripple-color: m3-utils.color-with-opacity(
|
|
120
|
+
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
|
|
120
121
|
button-filled-state-layer-color: map.get($system, on-primary),
|
|
121
122
|
button-outlined-label-text-color: map.get($system, primary),
|
|
122
123
|
button-outlined-outline-color: map.get(get-color-tokens($theme), button-outlined-outline-color),
|
|
123
|
-
button-outlined-ripple-color: m3-utils.color-with-opacity(
|
|
124
|
+
button-outlined-ripple-color: m3-utils.color-with-opacity(
|
|
125
|
+
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
124
126
|
button-outlined-state-layer-color: map.get($system, primary),
|
|
125
127
|
button-protected-container-color: map.get($system, primary),
|
|
126
128
|
button-protected-label-text-color: map.get($system, on-primary),
|
|
127
|
-
button-protected-ripple-color: m3-utils.color-with-opacity(
|
|
129
|
+
button-protected-ripple-color: m3-utils.color-with-opacity(
|
|
130
|
+
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
|
|
128
131
|
button-protected-state-layer-color: map.get($system, on-primary),
|
|
129
132
|
button-text-label-text-color: map.get($system, primary),
|
|
130
|
-
button-text-ripple-color: m3-utils.color-with-opacity(
|
|
133
|
+
button-text-ripple-color: m3-utils.color-with-opacity(
|
|
134
|
+
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
131
135
|
button-text-state-layer-color: map.get($system, primary),
|
|
132
136
|
button-tonal-container-color: map.get($system, primary),
|
|
133
137
|
button-tonal-label-text-color: map.get($system, on-primary),
|
|
134
|
-
button-tonal-ripple-color: m3-utils.color-with-opacity(
|
|
138
|
+
button-tonal-ripple-color: m3-utils.color-with-opacity(
|
|
139
|
+
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
|
|
135
140
|
button-tonal-state-layer-color: map.get($system, on-primary),
|
|
136
141
|
);
|
|
137
142
|
}
|
package/button/_m2-fab.scss
CHANGED
|
@@ -39,23 +39,25 @@
|
|
|
39
39
|
fab-container-color: map.get($system, surface),
|
|
40
40
|
fab-disabled-state-container-color: $disabled-container,
|
|
41
41
|
fab-disabled-state-foreground-color: $disabled,
|
|
42
|
-
fab-disabled-state-layer-color:
|
|
42
|
+
fab-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
43
43
|
fab-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
44
|
-
fab-foreground-color:
|
|
44
|
+
fab-foreground-color: map.get($system, on-surface),
|
|
45
45
|
fab-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
46
46
|
fab-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
47
|
-
fab-ripple-color:
|
|
47
|
+
fab-ripple-color: m3-utils.color-with-opacity(
|
|
48
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
48
49
|
fab-small-container-color: map.get($system, surface),
|
|
49
50
|
fab-small-disabled-state-container-color: $disabled-container,
|
|
50
51
|
fab-small-disabled-state-foreground-color: $disabled,
|
|
51
|
-
fab-small-disabled-state-layer-color:
|
|
52
|
+
fab-small-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
52
53
|
fab-small-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
53
|
-
fab-small-foreground-color:
|
|
54
|
+
fab-small-foreground-color: map.get($system, on-surface),
|
|
54
55
|
fab-small-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
55
56
|
fab-small-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
56
|
-
fab-small-ripple-color:
|
|
57
|
-
|
|
58
|
-
fab-state-layer-color:
|
|
57
|
+
fab-small-ripple-color: m3-utils.color-with-opacity(
|
|
58
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
59
|
+
fab-small-state-layer-color: map.get($system, on-surface),
|
|
60
|
+
fab-state-layer-color: map.get($system, on-surface),
|
|
59
61
|
);
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -67,10 +69,12 @@
|
|
|
67
69
|
@return (
|
|
68
70
|
fab-container-color: map.get($system, primary),
|
|
69
71
|
fab-foreground-color: map.get($system, on-primary),
|
|
70
|
-
fab-ripple-color: m3-utils.color-with-opacity(
|
|
72
|
+
fab-ripple-color: m3-utils.color-with-opacity(
|
|
73
|
+
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
71
74
|
fab-small-container-color: map.get($system, primary),
|
|
72
75
|
fab-small-foreground-color: map.get($system, on-primary),
|
|
73
|
-
fab-small-ripple-color: m3-utils.color-with-opacity(
|
|
76
|
+
fab-small-ripple-color: m3-utils.color-with-opacity(
|
|
77
|
+
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
|
|
74
78
|
fab-small-state-layer-color: map.get($system, on-primary),
|
|
75
79
|
fab-state-layer-color: map.get($system, on-primary),
|
|
76
80
|
);
|
|
@@ -19,14 +19,15 @@
|
|
|
19
19
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
20
20
|
|
|
21
21
|
@return (
|
|
22
|
-
icon-button-disabled-icon-color:
|
|
23
|
-
icon-button-disabled-state-layer-color:
|
|
22
|
+
icon-button-disabled-icon-color: m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
23
|
+
icon-button-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
24
24
|
icon-button-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
25
25
|
icon-button-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
26
26
|
icon-button-icon-color: inherit,
|
|
27
27
|
icon-button-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
28
|
-
icon-button-ripple-color:
|
|
29
|
-
|
|
28
|
+
icon-button-ripple-color: m3-utils.color-with-opacity(
|
|
29
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
30
|
+
icon-button-state-layer-color: map.get($system, on-surface),
|
|
30
31
|
);
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -38,7 +39,8 @@
|
|
|
38
39
|
@return (
|
|
39
40
|
icon-button-icon-color: map.get($system, primary),
|
|
40
41
|
icon-button-state-layer-color: map.get($system, primary),
|
|
41
|
-
icon-button-ripple-color: m3-utils.color-with-opacity(
|
|
42
|
+
icon-button-ripple-color: m3-utils.color-with-opacity(
|
|
43
|
+
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
42
44
|
);
|
|
43
45
|
}
|
|
44
46
|
|
package/card/_m2-card.scss
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
card-elevated-container-elevation: elevation.get-box-shadow(1),
|
|
24
24
|
card-outlined-container-color: map.get($system, surface),
|
|
25
25
|
card-outlined-container-elevation: elevation.get-box-shadow(0),
|
|
26
|
-
card-outlined-outline-color:
|
|
26
|
+
card-outlined-outline-color: map.get($system, outline),
|
|
27
27
|
card-subtitle-text-color: map.get($system, on-surface-variant),
|
|
28
28
|
card-filled-container-color: map.get($system, surface),
|
|
29
29
|
card-filled-container-elevation: elevation.get-box-shadow(0)
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
$system: m2-utils.get-system($theme);
|
|
11
11
|
|
|
12
12
|
@return (
|
|
13
|
-
checkbox-disabled-selected-checkmark-color:
|
|
13
|
+
checkbox-disabled-selected-checkmark-color: map.get($system, surface),
|
|
14
14
|
checkbox-selected-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
15
15
|
checkbox-selected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
16
16
|
checkbox-selected-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
$system: m2-utils.get-system($theme);
|
|
26
26
|
$system: m3-utils.replace-colors-with-variant($system, secondary, $color-variant);
|
|
27
27
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
28
|
-
$foreground-base: inspection.get-theme-color($theme, foreground, base);
|
|
29
28
|
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
30
29
|
|
|
31
30
|
$tokens: (
|
|
@@ -46,7 +45,7 @@
|
|
|
46
45
|
checkbox-selected-pressed-state-layer-color: map.get($system, secondary),
|
|
47
46
|
checkbox-unselected-focus-state-layer-color: map.get($system, on-surface),
|
|
48
47
|
checkbox-unselected-hover-state-layer-color: map.get($system, on-surface),
|
|
49
|
-
checkbox-unselected-pressed-state-layer-color: $
|
|
48
|
+
checkbox-unselected-pressed-state-layer-color: map.get($system, on-surface),
|
|
50
49
|
);
|
|
51
50
|
|
|
52
51
|
@each $token in $exclude {
|
package/chips/_m2-chip.scss
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use 'sass:meta';
|
|
3
|
-
@use 'sass:color';
|
|
4
2
|
@use '../core/theming/inspection';
|
|
5
|
-
@use '../core/m2/palette' as m2-palette;
|
|
6
3
|
@use '../core/theming/theming';
|
|
7
4
|
@use '../core/tokens/m2-utils';
|
|
8
5
|
@use '../core/tokens/m3-utils';
|
|
@@ -40,38 +37,24 @@
|
|
|
40
37
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
41
38
|
@function get-color-tokens($theme, $color-variant: null) {
|
|
42
39
|
$system: m2-utils.get-system($theme);
|
|
43
|
-
$
|
|
44
|
-
$
|
|
45
|
-
$state-layer-color: inspection.get-theme-color($theme, foreground, base);
|
|
40
|
+
$background: m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
41
|
+
$foreground: map.get($system, on-surface);
|
|
46
42
|
|
|
47
|
-
@if $color-variant
|
|
48
|
-
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
49
|
-
$grey-50: map.get(m2-palette.$grey-palette, 50);
|
|
50
|
-
$grey-900: map.get(m2-palette.$grey-palette, 900);
|
|
51
|
-
$foreground: if($is-dark, $grey-50, $grey-900);
|
|
52
|
-
|
|
53
|
-
$surface: map.get($system, surface);
|
|
54
|
-
$background: if(
|
|
55
|
-
meta.type-of($state-layer-color) == color and meta.type-of($surface) == color,
|
|
56
|
-
color.mix($state-layer-color, $surface, 12%),
|
|
57
|
-
$state-layer-color
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
@else {
|
|
43
|
+
@if $color-variant {
|
|
61
44
|
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
62
|
-
|
|
63
45
|
$background: map.get($system, primary);
|
|
64
46
|
$foreground: map.get($system, on-primary);
|
|
65
47
|
}
|
|
48
|
+
|
|
66
49
|
@return (
|
|
67
50
|
chip-disabled-label-text-color: $foreground,
|
|
68
51
|
chip-elevated-container-color: $background,
|
|
69
52
|
chip-elevated-disabled-container-color: $background,
|
|
70
53
|
chip-elevated-selected-container-color: $background,
|
|
71
54
|
chip-flat-disabled-selected-container-color: $background,
|
|
72
|
-
chip-focus-state-layer-color: $
|
|
55
|
+
chip-focus-state-layer-color: map.get($system, on-surface),
|
|
73
56
|
chip-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
74
|
-
chip-hover-state-layer-color: $
|
|
57
|
+
chip-hover-state-layer-color: map.get($system, on-surface),
|
|
75
58
|
chip-label-text-color: $foreground,
|
|
76
59
|
chip-selected-disabled-trailing-icon-color: $foreground,
|
|
77
60
|
chip-selected-focus-state-layer-color: map.get($system, focus-state-layer-opacity),
|
package/core/m2/_theming.scss
CHANGED
|
@@ -113,18 +113,34 @@
|
|
|
113
113
|
@return $theme;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
116
|
+
@function _define-system($primary, $accent, $warn, $is-dark) {
|
|
117
|
+
$system: (
|
|
118
|
+
primary: map.get($primary, default),
|
|
119
|
+
on-primary: map.get($primary, default-contrast),
|
|
120
|
+
secondary: map.get($accent, default),
|
|
121
|
+
on-secondary: map.get($accent, default-contrast),
|
|
122
|
+
error: map.get($warn, default),
|
|
123
|
+
on-error: map.get($warn, default-contrast),
|
|
124
|
+
shadow: black,
|
|
125
|
+
hover-state-layer-opacity: 0.04,
|
|
126
|
+
focus-state-layer-opacity: 0.12,
|
|
127
|
+
pressed-state-layer-opacity: 0.12,
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
@if $is-dark {
|
|
131
|
+
@return map.merge($system, (
|
|
132
|
+
surface: map.get(palette.$grey-palette, 800),
|
|
133
|
+
surface-variant: #4a4a4a,
|
|
134
|
+
on-surface: white,
|
|
135
|
+
on-surface-variant: rgba(white, 0.7),
|
|
136
|
+
background: #303030,
|
|
137
|
+
inverse-surface: white,
|
|
138
|
+
inverse-on-surface: rgba(black, 0.87),
|
|
139
|
+
outline: rgba(white, 0.12),
|
|
140
|
+
outline-variant: rgba(white, 0.38),
|
|
141
|
+
));
|
|
142
|
+
} @else {
|
|
143
|
+
@return map.merge($system, (
|
|
128
144
|
surface: white,
|
|
129
145
|
surface-variant: #f6f6f6,
|
|
130
146
|
on-surface: rgba(black, 0.87),
|
|
@@ -134,62 +150,34 @@
|
|
|
134
150
|
inverse-on-surface: white,
|
|
135
151
|
outline: rgba(black, 0.12),
|
|
136
152
|
outline-variant: rgba(black, 0.38),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
pressed-state-layer-opacity: 0.12,
|
|
140
|
-
shadow: black,
|
|
141
|
-
primary: map.get($primary, default),
|
|
142
|
-
on-primary: map.get($primary, default-contrast),
|
|
143
|
-
secondary: map.get($accent, default),
|
|
144
|
-
on-secondary: map.get($accent, default-contrast),
|
|
145
|
-
error: map.get($warn, default),
|
|
146
|
-
on-error: map.get($warn, default-contrast),
|
|
147
|
-
),
|
|
148
|
-
);
|
|
153
|
+
));
|
|
154
|
+
}
|
|
149
155
|
}
|
|
150
156
|
|
|
151
|
-
// Creates a
|
|
157
|
+
// Creates a color configuration from the specified
|
|
152
158
|
// primary, accent and warn palettes.
|
|
153
|
-
@function _mat-create-
|
|
159
|
+
@function _mat-create-color-config($primary, $accent, $warn: null, $is-dark) {
|
|
154
160
|
$warn: if($warn != null, $warn, define-palette(palette.$red-palette));
|
|
161
|
+
$foreground:
|
|
162
|
+
if($is-dark, palette.$dark-theme-foreground-palette, palette.$light-theme-foreground-palette);
|
|
163
|
+
$background:
|
|
164
|
+
if($is-dark, palette.$dark-theme-background-palette, palette.$light-theme-background-palette);
|
|
165
|
+
|
|
155
166
|
@return (
|
|
156
167
|
primary: $primary,
|
|
157
168
|
accent: $accent,
|
|
158
169
|
warn: $warn,
|
|
159
|
-
is-dark:
|
|
160
|
-
foreground:
|
|
161
|
-
background:
|
|
162
|
-
system: (
|
|
163
|
-
surface: map.get(palette.$grey-palette, 800),
|
|
164
|
-
surface-variant: #4a4a4a,
|
|
165
|
-
on-surface: white,
|
|
166
|
-
on-surface-variant: rgba(white, 0.7),
|
|
167
|
-
background: #303030,
|
|
168
|
-
inverse-surface: white,
|
|
169
|
-
inverse-on-surface: rgba(black, 0.87),
|
|
170
|
-
outline: rgba(white, 0.12),
|
|
171
|
-
outline-variant: rgba(white, 0.38),
|
|
172
|
-
hover-state-layer-opacity: 0.04,
|
|
173
|
-
focus-state-layer-opacity: 0.12,
|
|
174
|
-
pressed-state-layer-opacity: 0.12,
|
|
175
|
-
shadow: black,
|
|
176
|
-
primary: map.get($primary, default),
|
|
177
|
-
on-primary: map.get($primary, default-contrast),
|
|
178
|
-
secondary: map.get($accent, default),
|
|
179
|
-
on-secondary: map.get($accent, default-contrast),
|
|
180
|
-
error: map.get($warn, default),
|
|
181
|
-
on-error: map.get($warn, default-contrast),
|
|
182
|
-
),
|
|
170
|
+
is-dark: $is-dark,
|
|
171
|
+
foreground: $foreground,
|
|
172
|
+
background: $background,
|
|
183
173
|
);
|
|
184
174
|
}
|
|
185
175
|
|
|
186
|
-
|
|
187
|
-
// as it would break existing apps that set the parameter by name.
|
|
188
|
-
|
|
189
|
-
/// Creates a container object for a light theme to be given to individual component theme mixins.
|
|
176
|
+
/// Creates a container object for a theme to be given to individual component theme mixins.
|
|
190
177
|
/// @param {Map} $primary The theme configuration object.
|
|
191
178
|
/// @returns {Map} A complete Angular Material theme map.
|
|
192
|
-
@function
|
|
179
|
+
@function _define-theme(
|
|
180
|
+
$primary, $accent: null, $warn: define-palette(palette.$red-palette), $is-dark) {
|
|
193
181
|
// This function creates a container object for the individual component theme mixins. Consumers
|
|
194
182
|
// can construct such an object by calling this function, or by building the object manually.
|
|
195
183
|
// There are two possible ways to invoke this function in order to create such an object:
|
|
@@ -206,13 +194,15 @@
|
|
|
206
194
|
@if $accent != null {
|
|
207
195
|
@warn theming.$private-legacy-theme-warning;
|
|
208
196
|
$theme: _mat-validate-theme(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
197
|
+
(
|
|
198
|
+
_is-legacy-theme: true,
|
|
199
|
+
color: _mat-create-color-config($primary, $accent, $warn, $is-dark),
|
|
200
|
+
)
|
|
213
201
|
);
|
|
214
202
|
|
|
215
|
-
|
|
203
|
+
$theme: _internalize-theme(theming.private-create-backwards-compatibility-theme($theme));
|
|
204
|
+
$theme: map.set($theme, _mat-system, _define-system($primary, $accent, $warn, $is-dark));
|
|
205
|
+
@return $theme;
|
|
216
206
|
}
|
|
217
207
|
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
218
208
|
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
@@ -224,15 +214,30 @@
|
|
|
224
214
|
$accent: map.get($color-settings, accent);
|
|
225
215
|
$warn: map.get($color-settings, warn);
|
|
226
216
|
$result: map.merge(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
217
|
+
$result,
|
|
218
|
+
(
|
|
219
|
+
color: _mat-create-color-config($primary, $accent, $warn, $is-dark),
|
|
220
|
+
)
|
|
231
221
|
);
|
|
232
222
|
}
|
|
233
|
-
|
|
234
|
-
|
|
223
|
+
$theme: _internalize-theme(
|
|
224
|
+
theming.private-create-backwards-compatibility-theme(_mat-validate-theme($result))
|
|
235
225
|
);
|
|
226
|
+
$primary: map.get($result, primary) or map.get($result, color, primary) or ();
|
|
227
|
+
$accent: map.get($result, accent) or map.get($result, color, accent) or ();
|
|
228
|
+
$warn: map.get($result, warn) or map.get($result, color, warn) or ();
|
|
229
|
+
$theme: map.set($theme, _mat-system, _define-system($primary, $accent, $warn, $is-dark));
|
|
230
|
+
@return $theme;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// TODO: Remove legacy API and rename `$primary` below to `$config`. Currently it cannot be renamed
|
|
234
|
+
// as it would break existing apps that set the parameter by name.
|
|
235
|
+
|
|
236
|
+
/// Creates a container object for a light theme to be given to individual component theme mixins.
|
|
237
|
+
/// @param {Map} $primary The theme configuration object.
|
|
238
|
+
/// @returns {Map} A complete Angular Material theme map.
|
|
239
|
+
@function define-light-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
240
|
+
@return _define-theme($primary, $accent, $warn, false);
|
|
236
241
|
}
|
|
237
242
|
|
|
238
243
|
// TODO: Remove legacy API and rename below `$primary` to `$config`. Currently it cannot be renamed
|
|
@@ -242,48 +247,7 @@
|
|
|
242
247
|
/// @param {Map} $primary The theme configuration object.
|
|
243
248
|
/// @returns {Map} A complete Angular Material theme map.
|
|
244
249
|
@function define-dark-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
245
|
-
|
|
246
|
-
// can construct such an object by calling this function, or by building the object manually.
|
|
247
|
-
// There are two possible ways to invoke this function in order to create such an object:
|
|
248
|
-
//
|
|
249
|
-
// (1) Passing in a map that holds optional configurations for individual parts of the
|
|
250
|
-
// theming system. For `color` configurations, the function only expects the palettes
|
|
251
|
-
// for `primary` and `accent` (and optionally `warn`). The function will expand the
|
|
252
|
-
// shorthand into an actual configuration that can be consumed in `-color` mixins.
|
|
253
|
-
// (2) Legacy pattern: Passing in the palettes as parameters. This is not as flexible
|
|
254
|
-
// as passing in a configuration map because only the `color` system can be configured.
|
|
255
|
-
//
|
|
256
|
-
// If the legacy pattern is used, we generate a container object only with a dark-themed
|
|
257
|
-
// configuration for the `color` theming part.
|
|
258
|
-
@if $accent != null {
|
|
259
|
-
@warn theming.$private-legacy-theme-warning;
|
|
260
|
-
$theme: _mat-validate-theme(
|
|
261
|
-
(
|
|
262
|
-
_is-legacy-theme: true,
|
|
263
|
-
color: _mat-create-dark-color-config($primary, $accent, $warn),
|
|
264
|
-
)
|
|
265
|
-
);
|
|
266
|
-
@return _internalize-theme(theming.private-create-backwards-compatibility-theme($theme));
|
|
267
|
-
}
|
|
268
|
-
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
269
|
-
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
270
|
-
// above, the color shorthand will be expanded to an actual dark-themed color configuration.
|
|
271
|
-
$result: $primary;
|
|
272
|
-
@if map.get($primary, color) {
|
|
273
|
-
$color-settings: map.get($primary, color);
|
|
274
|
-
$primary: map.get($color-settings, primary);
|
|
275
|
-
$accent: map.get($color-settings, accent);
|
|
276
|
-
$warn: map.get($color-settings, warn);
|
|
277
|
-
$result: map.merge(
|
|
278
|
-
$result,
|
|
279
|
-
(
|
|
280
|
-
color: _mat-create-dark-color-config($primary, $accent, $warn),
|
|
281
|
-
)
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
@return _internalize-theme(
|
|
285
|
-
theming.private-create-backwards-compatibility-theme(_mat-validate-theme($result))
|
|
286
|
-
);
|
|
250
|
+
@return _define-theme($primary, $accent, $warn, true);
|
|
287
251
|
}
|
|
288
252
|
|
|
289
253
|
/// Gets the color configuration from the given theme or configuration.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
@use '../theming/inspection';
|
|
2
|
+
@use '../tokens/m2-utils';
|
|
3
|
+
@use 'sass:map';
|
|
2
4
|
|
|
3
5
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
4
6
|
// but may be in a future version of the theming API.
|
|
@@ -8,8 +10,9 @@
|
|
|
8
10
|
|
|
9
11
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
10
12
|
@function get-color-tokens($theme) {
|
|
13
|
+
$system: m2-utils.get-system($theme);
|
|
11
14
|
@return (
|
|
12
|
-
optgroup-label-text-color:
|
|
15
|
+
optgroup-label-text-color: map.get($system, on-surface),
|
|
13
16
|
);
|
|
14
17
|
}
|
|
15
18
|
|
|
@@ -12,17 +12,18 @@
|
|
|
12
12
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
13
13
|
@function get-color-tokens($theme, $color-variant) {
|
|
14
14
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
15
|
-
$active-state-layer-color: inspection.get-theme-color($theme, foreground, base,
|
|
16
|
-
if($is-dark, 0.08, 0.04));
|
|
17
15
|
$system: m2-utils.get-system($theme);
|
|
18
16
|
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
19
17
|
|
|
20
18
|
@return (
|
|
21
19
|
option-selected-state-label-text-color: map.get($system, primary),
|
|
22
|
-
option-label-text-color:
|
|
23
|
-
option-hover-state-layer-color:
|
|
24
|
-
|
|
25
|
-
option-
|
|
20
|
+
option-label-text-color: map.get($system, on-surface),
|
|
21
|
+
option-hover-state-layer-color: m3-utils.color-with-opacity(
|
|
22
|
+
map.get($system, on-surface), map.get($system, hover-state-layer-opacity)),
|
|
23
|
+
option-focus-state-layer-color: m3-utils.color-with-opacity(
|
|
24
|
+
map.get($system, on-surface), map.get($system, focus-state-layer-opacity)),
|
|
25
|
+
option-selected-state-layer-color: m3-utils.color-with-opacity(
|
|
26
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
26
27
|
);
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
@use 'sass:
|
|
2
|
-
@use '../
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../tokens/m2-utils';
|
|
3
|
+
@use '../tokens/m3-utils';
|
|
3
4
|
|
|
4
5
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
5
6
|
// but may be in a future version of the theming API.
|
|
@@ -9,16 +10,11 @@
|
|
|
9
10
|
|
|
10
11
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
11
12
|
@function get-color-tokens($theme) {
|
|
12
|
-
$
|
|
13
|
-
$base: inspection.get-theme-color($theme, foreground, base);
|
|
14
|
-
|
|
15
|
-
// If the base is a color *type* we can use it directly in the `rgba` call below.
|
|
16
|
-
// If it's anything else (e.g. a CSS variable) we fall back to using static colors
|
|
17
|
-
// since we don't have a way of adjusting the opacity.
|
|
18
|
-
$color: if(meta.type-of($base) == color, $base, if($is-dark, #fff, #000));
|
|
13
|
+
$system: m2-utils.get-system($theme);
|
|
19
14
|
|
|
20
15
|
@return (
|
|
21
|
-
ripple-color:
|
|
16
|
+
ripple-color: m3-utils.color-with-opacity(
|
|
17
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
22
18
|
);
|
|
23
19
|
}
|
|
24
20
|
|