@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
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
@use '../core/style/sass-utils';
|
|
2
1
|
@use '../core/theming/inspection';
|
|
3
|
-
@use '../core/theming/theming';
|
|
4
2
|
@use '../core/tokens/token-utils';
|
|
5
3
|
@use '../core/typography/typography';
|
|
6
4
|
@use './m2-button-toggle';
|
|
@@ -11,14 +9,12 @@
|
|
|
11
9
|
/// for the mat-button-toggle.
|
|
12
10
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
13
11
|
@mixin base($theme) {
|
|
12
|
+
$tokens: map.get(m2-button-toggle.get-tokens($theme), base);
|
|
14
13
|
@if inspection.get-theme-version($theme) == 1 {
|
|
15
|
-
|
|
16
|
-
} @else {
|
|
17
|
-
@include sass-utils.current-selector-or-root() {
|
|
18
|
-
@include token-utils.create-token-values-mixed(
|
|
19
|
-
m2-button-toggle.get-unthemable-tokens($theme));
|
|
20
|
-
}
|
|
14
|
+
$tokens: map.get(m3-button-toggle.get-tokens($theme), base);
|
|
21
15
|
}
|
|
16
|
+
|
|
17
|
+
@include token-utils.values($tokens);
|
|
22
18
|
}
|
|
23
19
|
|
|
24
20
|
/// Outputs color theme styles for the mat-button-toggle.
|
|
@@ -26,43 +22,34 @@
|
|
|
26
22
|
/// @param {String} $color-variant: The color variant to use for the button toggle: primary,
|
|
27
23
|
/// secondary, tertiary, or error (If not specified, default secondary color will be used).
|
|
28
24
|
@mixin color($theme, $color-variant: null) {
|
|
25
|
+
$tokens: map.get(m2-button-toggle.get-tokens($theme), color);
|
|
29
26
|
@if inspection.get-theme-version($theme) == 1 {
|
|
30
|
-
|
|
31
|
-
map.get(m3-button-toggle.get-tokens($theme, $color-variant), color));
|
|
32
|
-
} @else {
|
|
33
|
-
@include sass-utils.current-selector-or-root() {
|
|
34
|
-
@include token-utils.create-token-values-mixed(
|
|
35
|
-
m2-button-toggle.get-color-tokens($theme)
|
|
36
|
-
);
|
|
37
|
-
}
|
|
27
|
+
$tokens: map.get(m3-button-toggle.get-tokens($theme, $color-variant), color);
|
|
38
28
|
}
|
|
29
|
+
|
|
30
|
+
@include token-utils.values($tokens);
|
|
39
31
|
}
|
|
40
32
|
|
|
41
33
|
/// Outputs typography theme styles for the mat-button-toggle.
|
|
42
34
|
/// @param {Map} $theme The theme to generate typography styles for.
|
|
43
35
|
@mixin typography($theme) {
|
|
36
|
+
$tokens: map.get(m2-button-toggle.get-tokens($theme), typography);
|
|
44
37
|
@if inspection.get-theme-version($theme) == 1 {
|
|
45
|
-
|
|
46
|
-
map.get(m3-button-toggle.get-tokens($theme), typography));
|
|
47
|
-
} @else {
|
|
48
|
-
@include sass-utils.current-selector-or-root() {
|
|
49
|
-
@include token-utils.create-token-values-mixed(
|
|
50
|
-
m2-button-toggle.get-typography-tokens($theme));
|
|
51
|
-
}
|
|
38
|
+
$tokens: map.get(m3-button-toggle.get-tokens($theme), typography);
|
|
52
39
|
}
|
|
40
|
+
|
|
41
|
+
@include token-utils.values($tokens);
|
|
53
42
|
}
|
|
54
43
|
|
|
55
44
|
/// Outputs density theme styles for the mat-button-toggle.
|
|
56
45
|
/// @param {Map} $theme The theme to generate density styles for.
|
|
57
46
|
@mixin density($theme) {
|
|
47
|
+
$tokens: map.get(m2-button-toggle.get-tokens($theme), density);
|
|
58
48
|
@if inspection.get-theme-version($theme) == 1 {
|
|
59
|
-
|
|
60
|
-
map.get(m3-button-toggle.get-tokens($theme), density));
|
|
61
|
-
} @else {
|
|
62
|
-
@include sass-utils.current-selector-or-root() {
|
|
63
|
-
@include token-utils.create-token-values-mixed(m2-button-toggle.get-density-tokens($theme));
|
|
64
|
-
}
|
|
49
|
+
$tokens: map.get(m3-button-toggle.get-tokens($theme), density);
|
|
65
50
|
}
|
|
51
|
+
|
|
52
|
+
@include token-utils.values($tokens);
|
|
66
53
|
}
|
|
67
54
|
|
|
68
55
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -86,23 +73,21 @@
|
|
|
86
73
|
/// @param {String} $color-variant: The color variant to use for the button toggle: primary,
|
|
87
74
|
/// secondary, tertiary, or error (If not specified, default secondary color will be used).
|
|
88
75
|
@mixin theme($theme, $color-variant: null) {
|
|
89
|
-
@
|
|
90
|
-
@
|
|
91
|
-
|
|
92
|
-
|
|
76
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
77
|
+
@include base($theme);
|
|
78
|
+
@include color($theme, $color-variant);
|
|
79
|
+
@include density($theme);
|
|
80
|
+
@include typography($theme);
|
|
81
|
+
} @else {
|
|
82
|
+
@include base($theme);
|
|
83
|
+
@if inspection.theme-has($theme, color) {
|
|
84
|
+
@include color($theme);
|
|
85
|
+
}
|
|
86
|
+
@if inspection.theme-has($theme, density) {
|
|
93
87
|
@include density($theme);
|
|
88
|
+
}
|
|
89
|
+
@if inspection.theme-has($theme, typography) {
|
|
94
90
|
@include typography($theme);
|
|
95
|
-
} @else {
|
|
96
|
-
@include base($theme);
|
|
97
|
-
@if inspection.theme-has($theme, color) {
|
|
98
|
-
@include color($theme);
|
|
99
|
-
}
|
|
100
|
-
@if inspection.theme-has($theme, density) {
|
|
101
|
-
@include density($theme);
|
|
102
|
-
}
|
|
103
|
-
@if inspection.theme-has($theme, typography) {
|
|
104
|
-
@include typography($theme);
|
|
105
|
-
}
|
|
106
91
|
}
|
|
107
92
|
}
|
|
108
93
|
}
|
|
@@ -1,91 +1,68 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../core/theming/theming';
|
|
3
|
-
@use '../core/theming/inspection';
|
|
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);
|
|
11
|
-
|
|
12
|
-
button-toggle-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
13
|
-
button-toggle-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
14
|
-
button-toggle-legacy-focus-state-layer-opacity: 1,
|
|
15
|
-
button-toggle-legacy-height: 36px,
|
|
16
|
-
button-toggle-legacy-shape: 2px,
|
|
17
|
-
button-toggle-shape: 4px,
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
22
|
-
@function get-color-tokens($theme) {
|
|
23
|
-
$system: m2-utils.get-system($theme);
|
|
24
|
-
|
|
25
|
-
@return (
|
|
26
|
-
button-toggle-background-color: map.get($system, surface),
|
|
27
|
-
button-toggle-disabled-selected-state-background-color:
|
|
28
|
-
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
29
|
-
button-toggle-disabled-selected-state-text-color:
|
|
30
|
-
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
31
|
-
button-toggle-disabled-state-background-color: map.get($system, surface),
|
|
32
|
-
button-toggle-disabled-state-text-color:
|
|
33
|
-
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
34
|
-
button-toggle-divider-color: map.get($system, outline),
|
|
35
|
-
button-toggle-legacy-disabled-selected-state-background-color:
|
|
36
|
-
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
37
|
-
button-toggle-legacy-disabled-state-background-color: map.get($system, surface),
|
|
38
|
-
button-toggle-legacy-disabled-state-text-color:
|
|
39
|
-
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
40
|
-
button-toggle-legacy-selected-state-background-color:
|
|
41
|
-
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
42
|
-
button-toggle-legacy-selected-state-text-color: map.get($system, on-surface),
|
|
43
|
-
button-toggle-legacy-state-layer-color:
|
|
44
|
-
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
45
|
-
button-toggle-legacy-text-color: map.get($system, on-surface),
|
|
46
|
-
button-toggle-selected-state-background-color:
|
|
47
|
-
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
48
|
-
button-toggle-selected-state-text-color: map.get($system, on-surface),
|
|
49
|
-
button-toggle-state-layer-color: map.get($system, on-surface),
|
|
50
|
-
button-toggle-text-color: map.get($system, on-surface),
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
55
|
-
@function get-typography-tokens($theme) {
|
|
56
|
-
@return (
|
|
57
|
-
button-toggle-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
58
|
-
button-toggle-label-text-line-height:
|
|
59
|
-
inspection.get-theme-typography($theme, body-1, line-height),
|
|
60
|
-
button-toggle-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
61
|
-
button-toggle-label-text-tracking:
|
|
62
|
-
inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
63
|
-
button-toggle-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
|
|
64
|
-
button-toggle-legacy-label-text-font:
|
|
65
|
-
inspection.get-theme-typography($theme, body-1, font-family),
|
|
66
|
-
button-toggle-legacy-label-text-line-height:
|
|
67
|
-
inspection.get-theme-typography($theme, body-1, line-height),
|
|
68
|
-
button-toggle-legacy-label-text-size:
|
|
69
|
-
inspection.get-theme-typography($theme, body-1, font-size),
|
|
70
|
-
button-toggle-legacy-label-text-tracking:
|
|
71
|
-
inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
72
|
-
button-toggle-legacy-label-text-weight:
|
|
73
|
-
inspection.get-theme-typography($theme, body-1, font-weight),
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
78
|
-
@function get-density-tokens($theme) {
|
|
79
|
-
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -4);
|
|
80
|
-
$size-scale: (
|
|
81
|
-
0: 48px,
|
|
82
|
-
-1: 44px,
|
|
83
|
-
-2: 40px,
|
|
84
|
-
-3: 36px,
|
|
85
|
-
-4: 24px,
|
|
86
|
-
);
|
|
8
|
+
$density-scale: theming.clamp-density(map.get($system, density-scale), -4);
|
|
87
9
|
|
|
88
10
|
@return (
|
|
89
|
-
|
|
11
|
+
base: (
|
|
12
|
+
button-toggle-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
13
|
+
button-toggle-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
14
|
+
button-toggle-legacy-focus-state-layer-opacity: 1,
|
|
15
|
+
button-toggle-legacy-height: 36px,
|
|
16
|
+
button-toggle-legacy-shape: 2px,
|
|
17
|
+
button-toggle-shape: 4px,
|
|
18
|
+
),
|
|
19
|
+
color: (
|
|
20
|
+
button-toggle-background-color: map.get($system, surface),
|
|
21
|
+
button-toggle-disabled-selected-state-background-color:
|
|
22
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
23
|
+
button-toggle-disabled-selected-state-text-color:
|
|
24
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
25
|
+
button-toggle-disabled-state-background-color: map.get($system, surface),
|
|
26
|
+
button-toggle-disabled-state-text-color:
|
|
27
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
28
|
+
button-toggle-divider-color: map.get($system, outline),
|
|
29
|
+
button-toggle-legacy-disabled-selected-state-background-color:
|
|
30
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
31
|
+
button-toggle-legacy-disabled-state-background-color: map.get($system, surface),
|
|
32
|
+
button-toggle-legacy-disabled-state-text-color:
|
|
33
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
34
|
+
button-toggle-legacy-selected-state-background-color:
|
|
35
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
36
|
+
button-toggle-legacy-selected-state-text-color: map.get($system, on-surface),
|
|
37
|
+
button-toggle-legacy-state-layer-color:
|
|
38
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
39
|
+
button-toggle-legacy-text-color: map.get($system, on-surface),
|
|
40
|
+
button-toggle-selected-state-background-color:
|
|
41
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
42
|
+
button-toggle-selected-state-text-color: map.get($system, on-surface),
|
|
43
|
+
button-toggle-state-layer-color: map.get($system, on-surface),
|
|
44
|
+
button-toggle-text-color: map.get($system, on-surface),
|
|
45
|
+
),
|
|
46
|
+
typography: (
|
|
47
|
+
button-toggle-label-text-font: map.get($system, body-large-font),
|
|
48
|
+
button-toggle-label-text-line-height: map.get($system, body-large-line-height),
|
|
49
|
+
button-toggle-label-text-size: map.get($system, body-large-size),
|
|
50
|
+
button-toggle-label-text-tracking: map.get($system, body-large-tracking),
|
|
51
|
+
button-toggle-label-text-weight: map.get($system, body-large-weight),
|
|
52
|
+
button-toggle-legacy-label-text-font: map.get($system, body-large-font),
|
|
53
|
+
button-toggle-legacy-label-text-line-height: map.get($system, body-large-line-height),
|
|
54
|
+
button-toggle-legacy-label-text-size: map.get($system, body-large-size),
|
|
55
|
+
button-toggle-legacy-label-text-tracking: map.get($system, body-large-tracking),
|
|
56
|
+
button-toggle-legacy-label-text-weight: map.get($system, body-large-weight),
|
|
57
|
+
),
|
|
58
|
+
density: (
|
|
59
|
+
button-toggle-height: map.get((
|
|
60
|
+
0: 48px,
|
|
61
|
+
-1: 44px,
|
|
62
|
+
-2: 40px,
|
|
63
|
+
-3: 36px,
|
|
64
|
+
-4: 24px,
|
|
65
|
+
), $density-scale)
|
|
66
|
+
),
|
|
90
67
|
);
|
|
91
68
|
}
|
|
@@ -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-button-toggle.
|
|
@@ -56,7 +55,7 @@
|
|
|
56
55
|
button-toggle-legacy-state-layer-color: null,
|
|
57
56
|
button-toggle-legacy-text-color: null,
|
|
58
57
|
),
|
|
59
|
-
density: get-density-tokens(map.get($
|
|
58
|
+
density: get-density-tokens(map.get($system, density-scale)),
|
|
60
59
|
);
|
|
61
60
|
|
|
62
61
|
@return $tokens;
|
package/card/_card-theme.scss
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../core/style/sass-utils';
|
|
3
|
-
@use '../core/theming/theming';
|
|
4
2
|
@use '../core/theming/inspection';
|
|
5
3
|
@use '../core/typography/typography';
|
|
6
4
|
@use '../core/tokens/token-utils';
|
|
@@ -8,43 +6,39 @@
|
|
|
8
6
|
@use './m3-card';
|
|
9
7
|
|
|
10
8
|
@mixin base($theme) {
|
|
9
|
+
$tokens: map.get(m2-card.get-tokens($theme), base);
|
|
11
10
|
@if inspection.get-theme-version($theme) == 1 {
|
|
12
|
-
|
|
13
|
-
} @else {
|
|
14
|
-
@include sass-utils.current-selector-or-root() {
|
|
15
|
-
@include token-utils.create-token-values-mixed(m2-card.get-unthemable-tokens());
|
|
16
|
-
}
|
|
11
|
+
$tokens: map.get(m3-card.get-tokens($theme), base);
|
|
17
12
|
}
|
|
13
|
+
|
|
14
|
+
@include token-utils.values($tokens);
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
@mixin color($theme) {
|
|
18
|
+
$tokens: map.get(m2-card.get-tokens($theme), color);
|
|
21
19
|
@if inspection.get-theme-version($theme) == 1 {
|
|
22
|
-
|
|
23
|
-
} @else {
|
|
24
|
-
@include sass-utils.current-selector-or-root() {
|
|
25
|
-
@include token-utils.create-token-values-mixed(m2-card.get-color-tokens($theme));
|
|
26
|
-
}
|
|
20
|
+
$tokens: map.get(m3-card.get-tokens($theme), color);
|
|
27
21
|
}
|
|
22
|
+
|
|
23
|
+
@include token-utils.values($tokens);
|
|
28
24
|
}
|
|
29
25
|
|
|
30
26
|
@mixin typography($theme) {
|
|
27
|
+
$tokens: map.get(m2-card.get-tokens($theme), typography);
|
|
31
28
|
@if inspection.get-theme-version($theme) == 1 {
|
|
32
|
-
|
|
33
|
-
} @else {
|
|
34
|
-
@include sass-utils.current-selector-or-root() {
|
|
35
|
-
@include token-utils.create-token-values-mixed(m2-card.get-typography-tokens($theme));
|
|
36
|
-
}
|
|
29
|
+
$tokens: map.get(m3-card.get-tokens($theme), typography);
|
|
37
30
|
}
|
|
31
|
+
|
|
32
|
+
@include token-utils.values($tokens);
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
@mixin density($theme) {
|
|
36
|
+
$tokens: map.get(m2-card.get-tokens($theme), density);
|
|
41
37
|
@if inspection.get-theme-version($theme) == 1 {
|
|
42
|
-
|
|
43
|
-
} @else {
|
|
44
|
-
@include sass-utils.current-selector-or-root() {
|
|
45
|
-
@include token-utils.create-token-values-mixed(m2-card.get-density-tokens($theme));
|
|
46
|
-
}
|
|
38
|
+
$tokens: map.get(m3-card.get-tokens($theme), density);
|
|
47
39
|
}
|
|
40
|
+
|
|
41
|
+
@include token-utils.values($tokens);
|
|
48
42
|
}
|
|
49
43
|
|
|
50
44
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -62,23 +56,21 @@
|
|
|
62
56
|
}
|
|
63
57
|
|
|
64
58
|
@mixin theme($theme) {
|
|
65
|
-
@
|
|
66
|
-
@
|
|
67
|
-
|
|
59
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
60
|
+
@include base($theme);
|
|
61
|
+
@include color($theme);
|
|
62
|
+
@include density($theme);
|
|
63
|
+
@include typography($theme);
|
|
64
|
+
} @else {
|
|
65
|
+
@include base($theme);
|
|
66
|
+
@if inspection.theme-has($theme, color) {
|
|
68
67
|
@include color($theme);
|
|
68
|
+
}
|
|
69
|
+
@if inspection.theme-has($theme, density) {
|
|
69
70
|
@include density($theme);
|
|
71
|
+
}
|
|
72
|
+
@if inspection.theme-has($theme, typography) {
|
|
70
73
|
@include typography($theme);
|
|
71
|
-
} @else {
|
|
72
|
-
@include base($theme);
|
|
73
|
-
@if inspection.theme-has($theme, color) {
|
|
74
|
-
@include color($theme);
|
|
75
|
-
}
|
|
76
|
-
@if inspection.theme-has($theme, density) {
|
|
77
|
-
@include density($theme);
|
|
78
|
-
}
|
|
79
|
-
@if inspection.theme-has($theme, typography) {
|
|
80
|
-
@include typography($theme);
|
|
81
|
-
}
|
|
82
74
|
}
|
|
83
75
|
}
|
|
84
76
|
}
|
package/card/_m2-card.scss
CHANGED
|
@@ -1,54 +1,39 @@
|
|
|
1
|
-
@use '../core/theming/inspection';
|
|
2
1
|
@use '../core/style/elevation';
|
|
3
2
|
@use '../core/tokens/m2-utils';
|
|
4
3
|
@use 'sass:map';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
// but may be in a future version of the theming API.
|
|
8
|
-
@function get-unthemable-tokens() {
|
|
9
|
-
@return (
|
|
10
|
-
card-elevated-container-shape: 4px,
|
|
11
|
-
card-outlined-container-shape: 4px,
|
|
12
|
-
card-filled-container-shape: 4px,
|
|
13
|
-
card-outlined-outline-width: 1px,
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
-
@function get-color-tokens($theme) {
|
|
5
|
+
@function get-tokens($theme) {
|
|
19
6
|
$system: m2-utils.get-system($theme);
|
|
20
7
|
|
|
21
8
|
@return (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
9
|
+
base: (
|
|
10
|
+
card-elevated-container-shape: 4px,
|
|
11
|
+
card-outlined-container-shape: 4px,
|
|
12
|
+
card-filled-container-shape: 4px,
|
|
13
|
+
card-outlined-outline-width: 1px,
|
|
14
|
+
),
|
|
15
|
+
color: (
|
|
16
|
+
card-elevated-container-color: map.get($system, surface),
|
|
17
|
+
card-elevated-container-elevation: elevation.get-box-shadow(1),
|
|
18
|
+
card-outlined-container-color: map.get($system, surface),
|
|
19
|
+
card-outlined-container-elevation: elevation.get-box-shadow(0),
|
|
20
|
+
card-outlined-outline-color: map.get($system, outline),
|
|
21
|
+
card-subtitle-text-color: map.get($system, on-surface-variant),
|
|
22
|
+
card-filled-container-color: map.get($system, surface),
|
|
23
|
+
card-filled-container-elevation: elevation.get-box-shadow(0)
|
|
24
|
+
),
|
|
25
|
+
typography: (
|
|
26
|
+
card-title-text-font: map.get($system, title-small-font),
|
|
27
|
+
card-title-text-line-height: map.get($system, title-small-line-height),
|
|
28
|
+
card-title-text-size: map.get($system, title-small-size),
|
|
29
|
+
card-title-text-tracking: map.get($system, title-small-tracking),
|
|
30
|
+
card-title-text-weight: map.get($system, title-small-weight),
|
|
31
|
+
card-subtitle-text-font: map.get($system, label-medium-font),
|
|
32
|
+
card-subtitle-text-line-height: map.get($system, label-medium-line-height),
|
|
33
|
+
card-subtitle-text-size: map.get($system, label-medium-size),
|
|
34
|
+
card-subtitle-text-tracking: map.get($system, label-medium-tracking),
|
|
35
|
+
card-subtitle-text-weight: map.get($system, label-medium-weight),
|
|
36
|
+
),
|
|
37
|
+
density: (),
|
|
48
38
|
);
|
|
49
39
|
}
|
|
50
|
-
|
|
51
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
52
|
-
@function get-density-tokens($theme) {
|
|
53
|
-
@return ();
|
|
54
|
-
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@use '../core/style/sass-utils';
|
|
2
|
-
@use '../core/theming/theming';
|
|
3
1
|
@use '../core/theming/inspection';
|
|
4
2
|
@use '../core/tokens/token-utils';
|
|
5
3
|
@use '../core/typography/typography';
|
|
@@ -11,69 +9,60 @@
|
|
|
11
9
|
/// for the mat-checkbox.
|
|
12
10
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
13
11
|
@mixin base($theme) {
|
|
12
|
+
$tokens: map.get(m2-checkbox.get-tokens($theme), base);
|
|
14
13
|
@if inspection.get-theme-version($theme) == 1 {
|
|
15
|
-
|
|
16
|
-
} @else {
|
|
17
|
-
@include sass-utils.current-selector-or-root() {
|
|
18
|
-
@include token-utils.create-token-values-mixed(m2-checkbox.get-unthemable-tokens($theme));
|
|
19
|
-
}
|
|
14
|
+
$tokens: map.get(m3-checkbox.get-tokens($theme), base);
|
|
20
15
|
}
|
|
16
|
+
|
|
17
|
+
@include token-utils.values($tokens);
|
|
21
18
|
}
|
|
22
19
|
|
|
23
20
|
/// Outputs color theme styles for the mat-checkbox.
|
|
24
21
|
/// @param {Map} $theme The theme to generate color styles for.
|
|
25
22
|
/// @param {String} $color-variant The color variant to use for the component
|
|
26
23
|
@mixin color($theme, $color-variant: null) {
|
|
24
|
+
$tokens: map.get(m2-checkbox.get-tokens($theme), color);
|
|
27
25
|
@if inspection.get-theme-version($theme) == 1 {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@include token-utils.create-token-values-mixed(
|
|
33
|
-
m2-checkbox.get-color-tokens($theme, secondary));
|
|
34
|
-
}
|
|
26
|
+
$tokens: map.get(m3-checkbox.get-tokens($theme, $color-variant), color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@include token-utils.values($tokens);
|
|
35
30
|
|
|
31
|
+
@if inspection.get-theme-version($theme) != 1 {
|
|
36
32
|
.mat-mdc-checkbox {
|
|
37
33
|
&.mat-primary {
|
|
38
|
-
@include token-utils.
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
@include token-utils.values(m2-checkbox.private-get-color-palette-color-tokens(
|
|
35
|
+
$theme, primary,
|
|
36
|
+
$exclude: (checkbox-disabled-label-color, checkbox-label-text-color))
|
|
41
37
|
);
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
&.mat-warn {
|
|
45
|
-
@include token-utils.
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
@include token-utils.values(m2-checkbox.private-get-color-palette-color-tokens(
|
|
42
|
+
$theme, error,
|
|
43
|
+
$exclude: (checkbox-disabled-label-color, checkbox-label-text-color))
|
|
48
44
|
);
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
47
|
}
|
|
52
48
|
}
|
|
53
49
|
|
|
54
|
-
/// Outputs typography theme styles for the mat-checkbox.
|
|
55
|
-
/// @param {Map} $theme The theme to generate typography styles for.
|
|
56
50
|
@mixin typography($theme) {
|
|
51
|
+
$tokens: map.get(m2-checkbox.get-tokens($theme), typography);
|
|
57
52
|
@if inspection.get-theme-version($theme) == 1 {
|
|
58
|
-
|
|
59
|
-
map.get(m3-checkbox.get-tokens($theme), typography));
|
|
60
|
-
} @else {
|
|
61
|
-
@include sass-utils.current-selector-or-root() {
|
|
62
|
-
@include token-utils.create-token-values-mixed(m2-checkbox.get-typography-tokens($theme));
|
|
63
|
-
}
|
|
53
|
+
$tokens: map.get(m3-checkbox.get-tokens($theme), typography);
|
|
64
54
|
}
|
|
55
|
+
|
|
56
|
+
@include token-utils.values($tokens);
|
|
65
57
|
}
|
|
66
58
|
|
|
67
|
-
/// Outputs density theme styles for the mat-checkbox.
|
|
68
|
-
/// @param {Map} $theme The theme to generate density styles for.
|
|
69
59
|
@mixin density($theme) {
|
|
60
|
+
$tokens: map.get(m2-checkbox.get-tokens($theme), density);
|
|
70
61
|
@if inspection.get-theme-version($theme) == 1 {
|
|
71
|
-
|
|
72
|
-
} @else {
|
|
73
|
-
@include sass-utils.current-selector-or-root() {
|
|
74
|
-
@include token-utils.create-token-values-mixed(m2-checkbox.get-density-tokens($theme));
|
|
75
|
-
}
|
|
62
|
+
$tokens: map.get(m3-checkbox.get-tokens($theme), density);
|
|
76
63
|
}
|
|
64
|
+
|
|
65
|
+
@include token-utils.values($tokens);
|
|
77
66
|
}
|
|
78
67
|
|
|
79
68
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -96,23 +85,21 @@
|
|
|
96
85
|
/// @param {Map} $theme The theme to generate styles for.
|
|
97
86
|
/// @param {String} $color-variant The color variant to use for the component (M3 only)
|
|
98
87
|
@mixin theme($theme, $color-variant: null) {
|
|
99
|
-
@
|
|
100
|
-
@
|
|
101
|
-
|
|
102
|
-
|
|
88
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
89
|
+
@include base($theme);
|
|
90
|
+
@include color($theme, $color-variant);
|
|
91
|
+
@include density($theme);
|
|
92
|
+
@include typography($theme);
|
|
93
|
+
} @else {
|
|
94
|
+
@include base($theme);
|
|
95
|
+
@if inspection.theme-has($theme, color) {
|
|
96
|
+
@include color($theme);
|
|
97
|
+
}
|
|
98
|
+
@if inspection.theme-has($theme, density) {
|
|
103
99
|
@include density($theme);
|
|
100
|
+
}
|
|
101
|
+
@if inspection.theme-has($theme, typography) {
|
|
104
102
|
@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
103
|
}
|
|
117
104
|
}
|
|
118
105
|
}
|