@angular/material 20.1.0-next.1 → 20.1.0-rc.0
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 +28 -37
- package/autocomplete/_m2-autocomplete.scss +10 -22
- package/badge/_badge-theme.scss +35 -44
- package/badge/_m2-badge.scss +46 -59
- package/bottom-sheet/_bottom-sheet-theme.scss +28 -40
- package/bottom-sheet/_m2-bottom-sheet.scss +16 -33
- package/button/_button-theme.scss +37 -55
- package/button/_fab-theme.scss +42 -56
- package/button/_icon-button-theme.scss +33 -49
- package/button/_m2-button.scss +135 -158
- package/button/_m2-fab.scss +60 -69
- package/button/_m2-icon-button.scss +30 -50
- package/button/_m3-button.scss +1 -2
- package/button/_m3-fab.scss +1 -2
- package/button/_m3-icon-button.scss +1 -2
- package/button/testing/index.d.ts +1 -0
- package/button-toggle/_button-toggle-theme.scss +29 -44
- package/button-toggle/_m2-button-toggle.scss +58 -81
- package/button-toggle/_m3-button-toggle.scss +1 -2
- package/card/_card-theme.scss +28 -36
- package/card/_m2-card.scss +30 -45
- package/checkbox/_checkbox-theme.scss +37 -50
- package/checkbox/_m2-checkbox.scss +30 -40
- package/checkbox/_m3-checkbox.scss +1 -2
- package/chips/_chips-theme.scss +27 -30
- package/chips/_m2-chip.scss +40 -53
- package/chips/_m3-chip.scss +1 -2
- package/core/_core-theme.scss +48 -67
- package/core/_m2-app.scss +11 -23
- package/core/focus-indicators/_private.scss +2 -5
- package/core/m2/_theming.scss +36 -41
- package/core/option/_m2-optgroup.scss +13 -25
- package/core/option/_m2-option.scss +16 -22
- package/core/option/_optgroup-theme.scss +28 -30
- package/core/option/_option-theme.scss +35 -34
- package/core/ripple/_m2-ripple.scss +8 -20
- package/core/ripple/_ripple-theme.scss +28 -33
- package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +14 -21
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +55 -45
- package/core/theming/_all-theme.scss +38 -42
- package/core/theming/_definition.scss +22 -13
- package/core/theming/_inspection.scss +0 -12
- package/core/theming/_m2-inspection.scss +0 -33
- package/core/theming/_theming.scss +4 -172
- package/core/tokens/_m2-utils.scss +16 -68
- package/core/tokens/_m3-utils.scss +2 -14
- package/core/tokens/_token-utils.scss +7 -27
- package/core/tokens/m2/_index.scss +6 -0
- package/core/tokens/m2/_md-sys-color.scss +123 -0
- package/core/tokens/m2/_md-sys-elevation.scss +16 -0
- package/core/tokens/m2/_md-sys-motion.scss +36 -0
- package/core/tokens/m2/_md-sys-shape.scss +22 -0
- package/core/tokens/m2/_md-sys-state.scss +15 -0
- package/core/tokens/m2/_md-sys-typescale.scss +68 -0
- package/core/tokens/m3/_md-sys-color.scss +2 -2
- package/core/tokens/m3/_md-sys-typescale.scss +1 -1
- package/core/tokens/m3/_theme.scss +14 -26
- package/datepicker/_datepicker-theme.scss +38 -40
- package/datepicker/_m2-datepicker.scss +26 -40
- package/dialog/_dialog-theme.scss +28 -34
- package/dialog/_m2-dialog.scss +34 -48
- package/divider/_divider-theme.scss +28 -30
- package/divider/_m2-divider.scss +10 -21
- package/expansion/_expansion-theme.scss +28 -39
- package/expansion/_m2-expansion.scss +52 -67
- package/expansion/_m3-expansion.scss +3 -2
- package/fesm2022/autocomplete.mjs +1 -1
- package/fesm2022/button/testing.mjs +7 -4
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +1 -1
- package/fesm2022/expansion.mjs +2 -2
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/{form-field-C9DZXojn.mjs → form-field-CFbrnFED.mjs} +3 -3
- package/fesm2022/{form-field-C9DZXojn.mjs.map → form-field-CFbrnFED.mjs.map} +1 -1
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/input.mjs +3 -27
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs +97 -13
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +343 -122
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/{module-BDiw_nWS.mjs → module-B0CLRw5e.mjs} +3 -3
- package/fesm2022/{module-BDiw_nWS.mjs.map → module-B0CLRw5e.mjs.map} +1 -1
- package/fesm2022/{module-DzZHEh7B.mjs → module-B62K-792.mjs} +2 -2
- package/fesm2022/{module-DzZHEh7B.mjs.map → module-B62K-792.mjs.map} +1 -1
- package/fesm2022/paginator.mjs +3 -3
- package/fesm2022/select.mjs +3 -3
- package/fesm2022/sidenav.mjs +2 -4
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +2 -2
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +2 -2
- package/fesm2022/timepicker.mjs +1 -1
- package/form-field/_form-field-theme.scss +35 -51
- package/form-field/_m2-form-field.scss +125 -146
- package/form-field/_m3-form-field.scss +1 -2
- package/grid-list/_grid-list-theme.scss +28 -28
- package/grid-list/_m2-grid-list.scss +16 -29
- package/icon/_icon-theme.scss +40 -41
- package/icon/_m2-icon.scss +7 -21
- package/input/_input-theme.scss +1 -4
- package/input/index.d.ts +0 -11
- package/list/_list-theme.scss +57 -53
- package/list/_m2-list.scss +84 -108
- package/list/_m3-list.scss +1 -2
- package/menu/_m2-menu.scss +33 -46
- package/menu/_menu-theme.scss +28 -33
- package/menu/index.d.ts +145 -61
- package/menu/testing/index.d.ts +50 -2
- package/package.json +2 -2
- package/paginator/_m2-paginator.scss +38 -58
- package/paginator/_m3-paginator.scss +1 -2
- package/paginator/_paginator-theme.scss +28 -33
- 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-bar/_m2-progress-bar.scss +11 -24
- package/progress-bar/_progress-bar-theme.scss +35 -43
- package/progress-spinner/_m2-progress-spinner.scss +9 -20
- package/progress-spinner/_progress-spinner-theme.scss +42 -43
- package/radio/_m2-radio.scss +30 -40
- package/radio/_m3-radio.scss +1 -2
- package/radio/_radio-theme.scss +33 -46
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-generate/theme-color/schema.json +1 -1
- package/select/_m2-select.scss +23 -30
- package/select/_m3-select.scss +1 -2
- package/select/_select-theme.scss +38 -51
- package/sidenav/_m2-sidenav.scss +26 -36
- package/sidenav/_sidenav-theme.scss +28 -30
- package/slide-toggle/_m2-slide-toggle.scss +111 -143
- package/slide-toggle/_m3-slide-toggle.scss +1 -0
- package/slide-toggle/_slide-toggle-theme.scss +42 -80
- package/slider/_m2-slider.scss +34 -55
- package/slider/_slider-theme.scss +38 -45
- package/snack-bar/_m2-snack-bar.scss +16 -36
- package/snack-bar/_snack-bar-theme.scss +28 -31
- package/sort/_m2-sort.scss +7 -18
- package/sort/_sort-theme.scss +28 -33
- package/stepper/_m2-stepper.scss +39 -57
- package/stepper/_m3-stepper.scss +1 -2
- package/stepper/_stepper-theme.scss +41 -49
- package/table/_m2-table.scss +54 -72
- package/table/_m3-table.scss +1 -2
- package/table/_table-theme.scss +28 -36
- package/tabs/_m2-tabs.scss +31 -46
- package/tabs/_m3-tabs.scss +1 -2
- package/tabs/_tabs-theme.scss +41 -49
- package/timepicker/_m2-timepicker.scss +10 -22
- package/timepicker/_timepicker-theme.scss +28 -46
- package/toolbar/_m2-toolbar.scss +26 -46
- package/toolbar/_m3-toolbar.scss +1 -2
- package/toolbar/_toolbar-theme.scss +55 -46
- package/tooltip/_m2-tooltip.scss +16 -34
- package/tooltip/_tooltip-theme.scss +28 -37
- package/tree/_m2-tree.scss +21 -38
- package/tree/_m3-tree.scss +1 -2
- package/tree/_tree-theme.scss +28 -38
- package/core/tokens/_format-tokens.scss +0 -5
|
@@ -2,29 +2,45 @@
|
|
|
2
2
|
@use '../core/tokens/m2-utils';
|
|
3
3
|
@use '../core/tokens/m3-utils';
|
|
4
4
|
@use '../core/theming/theming';
|
|
5
|
-
@use '../core/theming/inspection';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
// but may be in a future version of the theming API.
|
|
9
|
-
@function get-unthemable-tokens($theme) {
|
|
6
|
+
@function get-tokens($theme) {
|
|
10
7
|
$system: m2-utils.get-system($theme);
|
|
8
|
+
$density-scale: theming.clamp-density(map.get($system, density-scale), -3);
|
|
11
9
|
|
|
12
10
|
@return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
base: (
|
|
12
|
+
checkbox-disabled-selected-checkmark-color: map.get($system, surface),
|
|
13
|
+
checkbox-selected-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
14
|
+
checkbox-selected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
15
|
+
checkbox-selected-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
16
|
+
checkbox-unselected-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
17
|
+
checkbox-unselected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
18
|
+
checkbox-unselected-pressed-state-layer-opacity:
|
|
19
|
+
map.get($system, pressed-state-layer-opacity),
|
|
20
|
+
),
|
|
21
|
+
color: private-get-color-palette-color-tokens($theme, secondary),
|
|
22
|
+
typography: (
|
|
23
|
+
checkbox-label-text-font: map.get($system, body-medium-font),
|
|
24
|
+
checkbox-label-text-line-height: map.get($system, body-medium-line-height),
|
|
25
|
+
checkbox-label-text-size: map.get($system, body-medium-size),
|
|
26
|
+
checkbox-label-text-tracking: map.get($system, body-medium-tracking),
|
|
27
|
+
checkbox-label-text-weight: map.get($system, body-medium-weight)
|
|
28
|
+
),
|
|
29
|
+
density: (
|
|
30
|
+
checkbox-touch-target-display: if($density-scale < -1, none, block),
|
|
31
|
+
checkbox-state-layer-size: map.get((
|
|
32
|
+
0: 40px,
|
|
33
|
+
-1: 36px,
|
|
34
|
+
-2: 32px,
|
|
35
|
+
-3: 28px,
|
|
36
|
+
), $density-scale)
|
|
37
|
+
),
|
|
20
38
|
);
|
|
21
39
|
}
|
|
22
40
|
|
|
23
|
-
|
|
24
|
-
@function get-color-tokens($theme, $color-variant, $exclude: ()) {
|
|
41
|
+
@function private-get-color-palette-color-tokens($theme, $color-variant, $exclude: ()) {
|
|
25
42
|
$system: m2-utils.get-system($theme);
|
|
26
43
|
$system: m3-utils.replace-colors-with-variant($system, secondary, $color-variant);
|
|
27
|
-
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
28
44
|
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
29
45
|
|
|
30
46
|
$tokens: (
|
|
@@ -54,29 +70,3 @@
|
|
|
54
70
|
|
|
55
71
|
@return $tokens;
|
|
56
72
|
}
|
|
57
|
-
|
|
58
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
59
|
-
@function get-typography-tokens($theme) {
|
|
60
|
-
@return (
|
|
61
|
-
checkbox-label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
|
|
62
|
-
checkbox-label-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
|
|
63
|
-
checkbox-label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
64
|
-
checkbox-label-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
|
|
65
|
-
checkbox-label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight)
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
70
|
-
@function get-density-tokens($theme) {
|
|
71
|
-
$scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
72
|
-
|
|
73
|
-
@return (
|
|
74
|
-
checkbox-touch-target-display: if($scale < -1, none, block),
|
|
75
|
-
checkbox-state-layer-size: map.get((
|
|
76
|
-
0: 40px,
|
|
77
|
-
-1: 36px,
|
|
78
|
-
-2: 32px,
|
|
79
|
-
-3: 28px,
|
|
80
|
-
), $scale)
|
|
81
|
-
);
|
|
82
|
-
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use 'sass:list';
|
|
3
3
|
@use '../core/tokens/m3-utils';
|
|
4
4
|
@use '../core/theming/theming';
|
|
5
|
-
@use '../core/theming/inspection';
|
|
6
5
|
@use '../core/tokens/m3';
|
|
7
6
|
|
|
8
7
|
/// Generates custom tokens for mat-checkbox.
|
|
@@ -52,7 +51,7 @@
|
|
|
52
51
|
checkbox-label-text-tracking: map.get($system, body-medium-tracking),
|
|
53
52
|
checkbox-label-text-weight: map.get($system, body-medium-weight),
|
|
54
53
|
),
|
|
55
|
-
density: get-density-tokens(map.get($
|
|
54
|
+
density: get-density-tokens(map.get($system, density-scale)),
|
|
56
55
|
);
|
|
57
56
|
}
|
|
58
57
|
|
package/chips/_chips-theme.scss
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use './m2-chip';
|
|
3
3
|
@use './m3-chip';
|
|
4
4
|
@use '../core/tokens/token-utils';
|
|
5
|
-
@use '../core/theming/theming';
|
|
6
5
|
@use '../core/theming/inspection';
|
|
7
6
|
@use '../core/typography/typography';
|
|
8
7
|
@use 'sass:map';
|
|
@@ -12,10 +11,10 @@
|
|
|
12
11
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
13
12
|
@mixin base($theme) {
|
|
14
13
|
@if inspection.get-theme-version($theme) == 1 {
|
|
15
|
-
@include token-utils.
|
|
14
|
+
@include token-utils.values(map.get(m3-chip.get-tokens($theme), base));
|
|
16
15
|
} @else {
|
|
17
16
|
.mat-mdc-standard-chip {
|
|
18
|
-
@include token-utils.
|
|
17
|
+
@include token-utils.values(map.get(m2-chip.get-tokens($theme), base));
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
}
|
|
@@ -25,27 +24,27 @@
|
|
|
25
24
|
/// @param {String} $color-variant The color variant to use for the component (M3 only)
|
|
26
25
|
@mixin color($theme, $color-variant: null) {
|
|
27
26
|
@if inspection.get-theme-version($theme) == 1 {
|
|
28
|
-
@include token-utils.
|
|
27
|
+
@include token-utils.values(
|
|
29
28
|
map.get(m3-chip.get-tokens($theme, $color-variant), color));
|
|
30
29
|
} @else {
|
|
31
30
|
.mat-mdc-standard-chip {
|
|
32
|
-
@include token-utils.
|
|
31
|
+
@include token-utils.values(map.get(m2-chip.get-tokens($theme), color));
|
|
33
32
|
|
|
34
33
|
&.mat-mdc-chip-selected,
|
|
35
34
|
&.mat-mdc-chip-highlighted {
|
|
36
35
|
&.mat-primary {
|
|
37
|
-
@include token-utils.
|
|
38
|
-
m2-chip.get-color-tokens($theme, primary));
|
|
36
|
+
@include token-utils.values(
|
|
37
|
+
m2-chip.private-get-color-palette-color-tokens($theme, primary));
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
&.mat-accent {
|
|
42
|
-
@include token-utils.
|
|
43
|
-
m2-chip.get-color-tokens($theme, secondary));
|
|
41
|
+
@include token-utils.values(
|
|
42
|
+
m2-chip.private-get-color-palette-color-tokens($theme, secondary));
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
&.mat-warn {
|
|
47
|
-
@include token-utils.
|
|
48
|
-
m2-chip.get-color-tokens($theme, error));
|
|
46
|
+
@include token-utils.values(
|
|
47
|
+
m2-chip.private-get-color-palette-color-tokens($theme, error));
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
}
|
|
@@ -56,10 +55,10 @@
|
|
|
56
55
|
/// @param {Map} $theme The theme to generate typography styles for.
|
|
57
56
|
@mixin typography($theme) {
|
|
58
57
|
@if inspection.get-theme-version($theme) == 1 {
|
|
59
|
-
@include token-utils.
|
|
58
|
+
@include token-utils.values(map.get(m3-chip.get-tokens($theme), typography));
|
|
60
59
|
} @else {
|
|
61
60
|
.mat-mdc-standard-chip {
|
|
62
|
-
@include token-utils.
|
|
61
|
+
@include token-utils.values(map.get(m2-chip.get-tokens($theme), typography));
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
}
|
|
@@ -68,10 +67,10 @@
|
|
|
68
67
|
/// @param {Map} $theme The theme to generate density styles for.
|
|
69
68
|
@mixin density($theme) {
|
|
70
69
|
@if inspection.get-theme-version($theme) == 1 {
|
|
71
|
-
@include token-utils.
|
|
70
|
+
@include token-utils.values(map.get(m3-chip.get-tokens($theme), density));
|
|
72
71
|
} @else {
|
|
73
72
|
.mat-mdc-chip.mat-mdc-standard-chip {
|
|
74
|
-
@include token-utils.
|
|
73
|
+
@include token-utils.values(map.get(m2-chip.get-tokens($theme), density));
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
}
|
|
@@ -96,23 +95,21 @@
|
|
|
96
95
|
/// @param {Map} $theme The theme to generate styles for.
|
|
97
96
|
/// @param {String} $color-variant The color variant to use for the component (M3 only)
|
|
98
97
|
@mixin theme($theme, $color-variant: null) {
|
|
99
|
-
@
|
|
100
|
-
@
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
99
|
+
@include base($theme);
|
|
100
|
+
@include color($theme, $color-variant);
|
|
101
|
+
@include density($theme);
|
|
102
|
+
@include typography($theme);
|
|
103
|
+
} @else {
|
|
104
|
+
@include base($theme);
|
|
105
|
+
@if inspection.theme-has($theme, color) {
|
|
106
|
+
@include color($theme);
|
|
107
|
+
}
|
|
108
|
+
@if inspection.theme-has($theme, density) {
|
|
103
109
|
@include density($theme);
|
|
110
|
+
}
|
|
111
|
+
@if inspection.theme-has($theme, typography) {
|
|
104
112
|
@include typography($theme);
|
|
105
|
-
} @else {
|
|
106
|
-
@include base($theme);
|
|
107
|
-
@if inspection.theme-has($theme, color) {
|
|
108
|
-
@include color($theme);
|
|
109
|
-
}
|
|
110
|
-
@if inspection.theme-has($theme, density) {
|
|
111
|
-
@include density($theme);
|
|
112
|
-
}
|
|
113
|
-
@if inspection.theme-has($theme, typography) {
|
|
114
|
-
@include typography($theme);
|
|
115
|
-
}
|
|
116
113
|
}
|
|
117
114
|
}
|
|
118
115
|
}
|
package/chips/_m2-chip.scss
CHANGED
|
@@ -1,41 +1,55 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../core/theming/inspection';
|
|
3
2
|
@use '../core/theming/theming';
|
|
4
3
|
@use '../core/tokens/m2-utils';
|
|
5
4
|
@use '../core/tokens/m3-utils';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
// but may be in a future version of the theming API.
|
|
9
|
-
@function get-unthemable-tokens($theme) {
|
|
6
|
+
@function get-tokens($theme) {
|
|
10
7
|
$system: m2-utils.get-system($theme);
|
|
8
|
+
$density-scale: theming.clamp-density(map.get($system, density-scale), -2);
|
|
11
9
|
|
|
12
10
|
@return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
11
|
+
base: (
|
|
12
|
+
chip-container-shape-radius: 16px,
|
|
13
|
+
chip-disabled-container-opacity: 0.4,
|
|
14
|
+
chip-disabled-outline-color: transparent,
|
|
15
|
+
chip-flat-selected-outline-width: 0,
|
|
16
|
+
chip-focus-outline-color: transparent,
|
|
17
|
+
chip-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
18
|
+
chip-outline-color: transparent,
|
|
19
|
+
chip-outline-width: 0,
|
|
20
|
+
chip-selected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
21
|
+
chip-selected-trailing-action-state-layer-color: transparent,
|
|
22
|
+
chip-trailing-action-focus-opacity: 1,
|
|
23
|
+
chip-trailing-action-focus-state-layer-opacity: 0,
|
|
24
|
+
chip-trailing-action-hover-state-layer-opacity: 0,
|
|
25
|
+
chip-trailing-action-opacity: 0.54,
|
|
26
|
+
chip-trailing-action-state-layer-color: transparent,
|
|
27
|
+
chip-with-avatar-avatar-shape-radius: 14px,
|
|
28
|
+
chip-with-avatar-avatar-size: 28px,
|
|
29
|
+
chip-with-avatar-disabled-avatar-opacity: 1,
|
|
30
|
+
chip-with-icon-disabled-icon-opacity: 1,
|
|
31
|
+
chip-with-icon-icon-size: 18px,
|
|
32
|
+
chip-with-trailing-icon-disabled-trailing-icon-opacity: 1,
|
|
33
|
+
),
|
|
34
|
+
color: private-get-color-palette-color-tokens($theme, null),
|
|
35
|
+
typography: (
|
|
36
|
+
chip-label-text-font: map.get($system, body-medium-font),
|
|
37
|
+
chip-label-text-line-height: map.get($system, body-medium-line-height),
|
|
38
|
+
chip-label-text-size: map.get($system, body-medium-size),
|
|
39
|
+
chip-label-text-tracking: map.get($system, body-medium-tracking),
|
|
40
|
+
chip-label-text-weight: map.get($system, body-medium-weight)
|
|
41
|
+
),
|
|
42
|
+
density: (
|
|
43
|
+
chip-container-height: map.get((
|
|
44
|
+
0: 32px,
|
|
45
|
+
-1: 28px,
|
|
46
|
+
-2: 24px), $density-scale)
|
|
47
|
+
),
|
|
34
48
|
);
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
38
|
-
@function get-color-tokens($theme, $color-variant: null) {
|
|
52
|
+
@function private-get-color-palette-color-tokens($theme, $color-variant: null) {
|
|
39
53
|
$system: m2-utils.get-system($theme);
|
|
40
54
|
$background: m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
41
55
|
$foreground: map.get($system, on-surface);
|
|
@@ -69,30 +83,3 @@
|
|
|
69
83
|
chip-with-trailing-icon-trailing-icon-color: $foreground,
|
|
70
84
|
);
|
|
71
85
|
}
|
|
72
|
-
|
|
73
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
74
|
-
@function get-typography-tokens($theme) {
|
|
75
|
-
@return (
|
|
76
|
-
chip-label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
|
|
77
|
-
chip-label-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
|
|
78
|
-
chip-label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
79
|
-
chip-label-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
|
|
80
|
-
chip-label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight)
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
85
|
-
@function get-density-tokens($theme) {
|
|
86
|
-
$scale: theming.clamp-density(inspection.get-theme-density($theme), -2);
|
|
87
|
-
@return (
|
|
88
|
-
// The height of the chip.
|
|
89
|
-
chip-container-height: map.get(
|
|
90
|
-
(
|
|
91
|
-
0: 32px,
|
|
92
|
-
-1: 28px,
|
|
93
|
-
-2: 24px,
|
|
94
|
-
),
|
|
95
|
-
$scale
|
|
96
|
-
)
|
|
97
|
-
);
|
|
98
|
-
}
|
package/chips/_m3-chip.scss
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use 'sass:list';
|
|
3
3
|
@use '../core/tokens/m3-utils';
|
|
4
4
|
@use '../core/theming/theming';
|
|
5
|
-
@use '../core/theming/inspection';
|
|
6
5
|
@use '../core/tokens/m3';
|
|
7
6
|
|
|
8
7
|
/// Generates custom tokens for the mat-chip.
|
|
@@ -67,7 +66,7 @@
|
|
|
67
66
|
chip-label-text-tracking: map.get($system, label-large-tracking),
|
|
68
67
|
chip-label-text-weight: map.get($system, label-large-weight),
|
|
69
68
|
),
|
|
70
|
-
density: get-density-tokens(map.get($
|
|
69
|
+
density: get-density-tokens(map.get($system, density-scale)),
|
|
71
70
|
);
|
|
72
71
|
}
|
|
73
72
|
|
package/core/_core-theme.scss
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
@use './theming/theming';
|
|
2
1
|
@use './theming/inspection';
|
|
3
2
|
@use './ripple/ripple-theme';
|
|
4
3
|
@use './option/option-theme';
|
|
5
4
|
@use './option/optgroup-theme';
|
|
6
5
|
@use './selection/pseudo-checkbox/pseudo-checkbox-theme';
|
|
7
|
-
@use './style/sass-utils';
|
|
8
6
|
@use './typography/typography';
|
|
9
7
|
@use './tokens/token-utils';
|
|
10
8
|
@use './m2-app';
|
|
@@ -16,71 +14,59 @@
|
|
|
16
14
|
@use 'sass:map';
|
|
17
15
|
|
|
18
16
|
@mixin base($theme) {
|
|
17
|
+
$tokens: map.get(m2-app.get-tokens($theme), base);
|
|
19
18
|
@if inspection.get-theme-version($theme) == 1 {
|
|
20
|
-
|
|
21
|
-
@include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), base));
|
|
22
|
-
@include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), base));
|
|
23
|
-
@include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), base));
|
|
24
|
-
@include token-utils.create-token-values(map.get(m3-pseudo-checkbox.get-tokens($theme), base));
|
|
25
|
-
} @else {
|
|
26
|
-
@include ripple-theme.base($theme);
|
|
27
|
-
@include option-theme.base($theme);
|
|
28
|
-
@include optgroup-theme.base($theme);
|
|
29
|
-
@include pseudo-checkbox-theme.base($theme);
|
|
30
|
-
@include sass-utils.current-selector-or-root() {
|
|
31
|
-
@include token-utils.create-token-values-mixed(m2-app.get-unthemable-tokens());
|
|
32
|
-
}
|
|
19
|
+
$tokens: map.get(m3-app.get-tokens($theme), base);
|
|
33
20
|
}
|
|
21
|
+
|
|
22
|
+
@include token-utils.values($tokens);
|
|
23
|
+
|
|
24
|
+
@include ripple-theme.base($theme);
|
|
25
|
+
@include option-theme.base($theme);
|
|
26
|
+
@include optgroup-theme.base($theme);
|
|
27
|
+
@include pseudo-checkbox-theme.base($theme);
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
@mixin color($theme) {
|
|
31
|
+
$tokens: map.get(m2-app.get-tokens($theme), color);
|
|
37
32
|
@if inspection.get-theme-version($theme) == 1 {
|
|
38
|
-
|
|
39
|
-
@include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), color));
|
|
40
|
-
@include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), color));
|
|
41
|
-
@include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), color));
|
|
42
|
-
@include token-utils.create-token-values(map.get(m3-pseudo-checkbox.get-tokens($theme), color));
|
|
43
|
-
} @else {
|
|
44
|
-
@include ripple-theme.color($theme);
|
|
45
|
-
@include option-theme.color($theme);
|
|
46
|
-
@include optgroup-theme.color($theme);
|
|
47
|
-
@include pseudo-checkbox-theme.color($theme);
|
|
48
|
-
@include sass-utils.current-selector-or-root() {
|
|
49
|
-
@include token-utils.create-token-values-mixed(m2-app.get-color-tokens($theme));
|
|
50
|
-
}
|
|
33
|
+
$tokens: map.get(m3-app.get-tokens($theme), color);
|
|
51
34
|
}
|
|
35
|
+
|
|
36
|
+
@include token-utils.values($tokens);
|
|
37
|
+
|
|
38
|
+
@include ripple-theme.color($theme);
|
|
39
|
+
@include option-theme.color($theme);
|
|
40
|
+
@include optgroup-theme.color($theme);
|
|
41
|
+
@include pseudo-checkbox-theme.color($theme);
|
|
52
42
|
}
|
|
53
43
|
|
|
54
44
|
@mixin typography($theme) {
|
|
45
|
+
$tokens: map.get(m2-app.get-tokens($theme), typography);
|
|
55
46
|
@if inspection.get-theme-version($theme) == 1 {
|
|
56
|
-
|
|
57
|
-
@include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), typography));
|
|
58
|
-
@include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), typography));
|
|
59
|
-
@include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), typography));
|
|
60
|
-
@include token-utils.create-token-values(
|
|
61
|
-
map.get(m3-pseudo-checkbox.get-tokens($theme), typography));
|
|
62
|
-
} @else {
|
|
63
|
-
@include option-theme.typography($theme);
|
|
64
|
-
@include optgroup-theme.typography($theme);
|
|
65
|
-
@include pseudo-checkbox-theme.typography($theme);
|
|
66
|
-
@include ripple-theme.typography($theme);
|
|
47
|
+
$tokens: map.get(m3-app.get-tokens($theme), typography);
|
|
67
48
|
}
|
|
49
|
+
|
|
50
|
+
@include token-utils.values($tokens);
|
|
51
|
+
|
|
52
|
+
@include ripple-theme.typography($theme);
|
|
53
|
+
@include option-theme.typography($theme);
|
|
54
|
+
@include optgroup-theme.typography($theme);
|
|
55
|
+
@include pseudo-checkbox-theme.typography($theme);
|
|
68
56
|
}
|
|
69
57
|
|
|
70
58
|
@mixin density($theme) {
|
|
59
|
+
$tokens: map.get(m2-app.get-tokens($theme), density);
|
|
71
60
|
@if inspection.get-theme-version($theme) == 1 {
|
|
72
|
-
|
|
73
|
-
@include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), density));
|
|
74
|
-
@include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), density));
|
|
75
|
-
@include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), density));
|
|
76
|
-
@include token-utils.create-token-values(
|
|
77
|
-
map.get(m3-pseudo-checkbox.get-tokens($theme), density));
|
|
78
|
-
} @else {
|
|
79
|
-
@include option-theme.density($theme);
|
|
80
|
-
@include optgroup-theme.density($theme);
|
|
81
|
-
@include pseudo-checkbox-theme.density($theme);
|
|
82
|
-
@include ripple-theme.density($theme);
|
|
61
|
+
$tokens: map.get(m3-app.get-tokens($theme), density);
|
|
83
62
|
}
|
|
63
|
+
|
|
64
|
+
@include token-utils.values($tokens);
|
|
65
|
+
|
|
66
|
+
@include ripple-theme.density($theme);
|
|
67
|
+
@include option-theme.density($theme);
|
|
68
|
+
@include optgroup-theme.density($theme);
|
|
69
|
+
@include pseudo-checkbox-theme.density($theme);
|
|
84
70
|
}
|
|
85
71
|
|
|
86
72
|
@function _define-overrides() {
|
|
@@ -119,26 +105,21 @@
|
|
|
119
105
|
|
|
120
106
|
// Mixin that renders all of the core styles that depend on the theme.
|
|
121
107
|
@mixin theme($theme) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
@
|
|
127
|
-
|
|
108
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
109
|
+
@include base($theme);
|
|
110
|
+
@include color($theme);
|
|
111
|
+
@include density($theme);
|
|
112
|
+
@include typography($theme);
|
|
113
|
+
} @else {
|
|
114
|
+
@include base($theme);
|
|
115
|
+
@if inspection.theme-has($theme, color) {
|
|
128
116
|
@include color($theme);
|
|
117
|
+
}
|
|
118
|
+
@if inspection.theme-has($theme, density) {
|
|
129
119
|
@include density($theme);
|
|
120
|
+
}
|
|
121
|
+
@if inspection.theme-has($theme, typography) {
|
|
130
122
|
@include typography($theme);
|
|
131
|
-
} @else {
|
|
132
|
-
@include base($theme);
|
|
133
|
-
@if inspection.theme-has($theme, color) {
|
|
134
|
-
@include color($theme);
|
|
135
|
-
}
|
|
136
|
-
@if inspection.theme-has($theme, density) {
|
|
137
|
-
@include density($theme);
|
|
138
|
-
}
|
|
139
|
-
@if inspection.theme-has($theme, typography) {
|
|
140
|
-
@include typography($theme);
|
|
141
|
-
}
|
|
142
123
|
}
|
|
143
124
|
}
|
|
144
125
|
}
|
package/core/_m2-app.scss
CHANGED
|
@@ -2,35 +2,23 @@
|
|
|
2
2
|
@use './style/elevation';
|
|
3
3
|
@use '../core/tokens/m2-utils';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
// but may be in a future version of the theming API.
|
|
7
|
-
@function get-unthemable-tokens() {
|
|
8
|
-
@return ();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
12
|
-
@function get-color-tokens($theme) {
|
|
5
|
+
@function get-tokens($theme) {
|
|
13
6
|
$system: m2-utils.get-system($theme);
|
|
14
7
|
|
|
15
|
-
$tokens: (
|
|
8
|
+
$color-tokens: (
|
|
16
9
|
app-background-color: map.get($system, background),
|
|
17
|
-
app-text-color: map.get($system, on-surface)
|
|
10
|
+
app-text-color: map.get($system, on-surface)
|
|
18
11
|
);
|
|
19
|
-
|
|
20
12
|
@for $zValue from 0 through 24 {
|
|
21
|
-
$
|
|
22
|
-
|
|
13
|
+
$color-tokens: map.set($color-tokens, 'app-elevation-shadow-level-#{$zValue}',
|
|
14
|
+
elevation.get-box-shadow($zValue, map.get($system, shadow)));
|
|
23
15
|
}
|
|
24
16
|
|
|
25
|
-
@return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
@return (
|
|
18
|
+
base: (),
|
|
19
|
+
color: $color-tokens,
|
|
20
|
+
typography: (),
|
|
21
|
+
density: (),
|
|
22
|
+
);
|
|
31
23
|
}
|
|
32
24
|
|
|
33
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
34
|
-
@function get-density-tokens($theme) {
|
|
35
|
-
@return ();
|
|
36
|
-
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use 'sass:meta';
|
|
3
3
|
@use '@angular/cdk';
|
|
4
4
|
@use '../style/layout-common';
|
|
5
|
-
@use '../theming/theming';
|
|
6
5
|
@use '../theming/inspection';
|
|
7
6
|
|
|
8
7
|
// Private sass variables that will be used as reference throughout component stylesheets.
|
|
@@ -104,10 +103,8 @@ $default-border-radius: 4px;
|
|
|
104
103
|
@include _customize-focus-indicators((border-color: $theme-or-color));
|
|
105
104
|
}
|
|
106
105
|
@else {
|
|
107
|
-
@
|
|
108
|
-
@
|
|
109
|
-
@include strong-focus-indicators-color($theme-or-color);
|
|
110
|
-
}
|
|
106
|
+
@if inspection.theme-has($theme-or-color, color) {
|
|
107
|
+
@include strong-focus-indicators-color($theme-or-color);
|
|
111
108
|
}
|
|
112
109
|
}
|
|
113
110
|
}
|