@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,79 +1,49 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../core/style/sass-utils';
|
|
3
|
-
@use '../core/theming/theming';
|
|
4
3
|
@use '../core/theming/inspection';
|
|
5
4
|
@use '../core/tokens/token-utils';
|
|
6
5
|
@use '../core/typography/typography';
|
|
7
6
|
@use './m2-slide-toggle';
|
|
8
7
|
@use './m3-slide-toggle';
|
|
8
|
+
@use '../core/tokens/m2-utils';
|
|
9
9
|
|
|
10
10
|
/// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
|
|
11
11
|
/// for the mat-slide-toggle.
|
|
12
12
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
13
13
|
@mixin base($theme) {
|
|
14
|
+
$tokens: map.get(m2-slide-toggle.get-tokens($theme), base);
|
|
14
15
|
@if inspection.get-theme-version($theme) == 1 {
|
|
15
|
-
|
|
16
|
-
} @else {
|
|
17
|
-
@include sass-utils.current-selector-or-root() {
|
|
18
|
-
// TODO: See if this can be removed
|
|
19
|
-
@include token-utils.create-token-values-mixed(m2-slide-toggle.get-unthemable-tokens($theme));
|
|
20
|
-
|
|
21
|
-
.mat-mdc-slide-toggle {
|
|
22
|
-
@include token-utils.create-token-values-mixed(
|
|
23
|
-
m2-slide-toggle.get-unthemable-tokens($theme));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
16
|
+
$tokens: map.get(m3-slide-toggle.get-tokens($theme), base);
|
|
26
17
|
}
|
|
18
|
+
|
|
19
|
+
@include token-utils.values($tokens);
|
|
27
20
|
}
|
|
28
21
|
|
|
29
22
|
/// Outputs color theme styles for the mat-slide-toggle.
|
|
30
23
|
/// @param {Map} $theme The theme to generate color styles for.
|
|
31
24
|
/// @param {String} $color-variant The color variant to use for the component (M3 only)
|
|
32
25
|
@mixin color($theme, $color-variant: null) {
|
|
26
|
+
$tokens: map.get(m2-slide-toggle.get-tokens($theme), color);
|
|
33
27
|
@if inspection.get-theme-version($theme) == 1 {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} @else {
|
|
37
|
-
$mat-tokens: m2-slide-toggle.get-color-tokens($theme);
|
|
28
|
+
$tokens: map.get(m3-slide-toggle.get-tokens($theme, $color-variant), color);
|
|
29
|
+
}
|
|
38
30
|
|
|
39
|
-
|
|
40
|
-
@include sass-utils.current-selector-or-root() {
|
|
41
|
-
@include token-utils.create-token-values-mixed(m2-slide-toggle.get-color-tokens($theme));
|
|
31
|
+
@include token-utils.values($tokens);
|
|
42
32
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
--mdc-slide-toggle-disabled-label-text-color: #{inspection.get-theme-color(
|
|
47
|
-
$theme,
|
|
48
|
-
foreground,
|
|
49
|
-
disabled-text
|
|
50
|
-
)};
|
|
51
|
-
// TODO(wagnermaciel): Use our token system to define this css variable.
|
|
52
|
-
--mat-slide-toggle-disabled-label-text-color: #{inspection.get-theme-color(
|
|
53
|
-
$theme,
|
|
54
|
-
foreground,
|
|
55
|
-
disabled-text
|
|
56
|
-
)};
|
|
57
|
-
}
|
|
33
|
+
@if inspection.get-theme-version($theme) != 1 {
|
|
34
|
+
$mat-tokens: map.get(m2-slide-toggle.get-tokens($theme), color);
|
|
35
|
+
$system: m2-utils.get-system($theme);
|
|
58
36
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
)};
|
|
66
|
-
|
|
67
|
-
// Change the color palette related tokens to accent or warn if applicable
|
|
68
|
-
&.mat-accent {
|
|
69
|
-
@include token-utils.create-token-values-mixed(
|
|
70
|
-
m2-slide-toggle.private-get-color-palette-color-tokens($theme, accent));
|
|
71
|
-
}
|
|
37
|
+
.mat-mdc-slide-toggle {
|
|
38
|
+
// Change the color palette related tokens to accent or warn if applicable
|
|
39
|
+
&.mat-accent {
|
|
40
|
+
$tokens: m2-slide-toggle.private-get-color-palette-color-tokens($theme, secondary);
|
|
41
|
+
@include token-utils.values($tokens);
|
|
42
|
+
}
|
|
72
43
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
44
|
+
&.mat-warn {
|
|
45
|
+
$tokens: m2-slide-toggle.private-get-color-palette-color-tokens($theme, error);
|
|
46
|
+
@include token-utils.values($tokens);
|
|
77
47
|
}
|
|
78
48
|
}
|
|
79
49
|
}
|
|
@@ -83,16 +53,16 @@
|
|
|
83
53
|
/// @param {Map} $theme The theme to generate typography styles for.
|
|
84
54
|
@mixin typography($theme) {
|
|
85
55
|
@if inspection.get-theme-version($theme) == 1 {
|
|
86
|
-
@include token-utils.
|
|
56
|
+
@include token-utils.values(
|
|
87
57
|
map.get(m3-slide-toggle.get-tokens($theme), typography));
|
|
88
58
|
} @else {
|
|
89
59
|
@include sass-utils.current-selector-or-root() {
|
|
90
60
|
// TODO: See if this can be removed
|
|
91
|
-
@include token-utils.
|
|
61
|
+
@include token-utils.values(map.get(m2-slide-toggle.get-tokens($theme), typography));
|
|
92
62
|
|
|
93
63
|
.mat-mdc-slide-toggle {
|
|
94
|
-
@include token-utils.
|
|
95
|
-
m2-slide-toggle.get-
|
|
64
|
+
@include token-utils.values(
|
|
65
|
+
map.get(m2-slide-toggle.get-tokens($theme), typography));
|
|
96
66
|
}
|
|
97
67
|
}
|
|
98
68
|
}
|
|
@@ -101,18 +71,12 @@
|
|
|
101
71
|
/// Outputs density theme styles for the mat-slide-toggle.
|
|
102
72
|
/// @param {Map} $theme The theme to generate density styles for.
|
|
103
73
|
@mixin density($theme) {
|
|
74
|
+
$tokens: map.get(m2-slide-toggle.get-tokens($theme), density);
|
|
104
75
|
@if inspection.get-theme-version($theme) == 1 {
|
|
105
|
-
|
|
106
|
-
} @else {
|
|
107
|
-
@include sass-utils.current-selector-or-root() {
|
|
108
|
-
// TODO: See if this can be removed
|
|
109
|
-
@include token-utils.create-token-values-mixed(m2-slide-toggle.get-density-tokens($theme));
|
|
110
|
-
|
|
111
|
-
.mat-mdc-slide-toggle {
|
|
112
|
-
@include token-utils.create-token-values-mixed(m2-slide-toggle.get-density-tokens($theme));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
76
|
+
$tokens: map.get(m3-slide-toggle.get-tokens($theme), density);
|
|
115
77
|
}
|
|
78
|
+
|
|
79
|
+
@include token-utils.values($tokens);
|
|
116
80
|
}
|
|
117
81
|
|
|
118
82
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -135,23 +99,21 @@
|
|
|
135
99
|
/// @param {Map} $theme The theme to generate styles for.
|
|
136
100
|
/// @param {String} $color-variant The color variant to use for the component (M3 only)
|
|
137
101
|
@mixin theme($theme, $color-variant: null) {
|
|
138
|
-
@
|
|
139
|
-
@
|
|
140
|
-
|
|
141
|
-
|
|
102
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
103
|
+
@include base($theme);
|
|
104
|
+
@include color($theme, $color-variant);
|
|
105
|
+
@include density($theme);
|
|
106
|
+
@include typography($theme);
|
|
107
|
+
} @else {
|
|
108
|
+
@include base($theme);
|
|
109
|
+
@if inspection.theme-has($theme, color) {
|
|
110
|
+
@include color($theme);
|
|
111
|
+
}
|
|
112
|
+
@if inspection.theme-has($theme, density) {
|
|
142
113
|
@include density($theme);
|
|
114
|
+
}
|
|
115
|
+
@if inspection.theme-has($theme, typography) {
|
|
143
116
|
@include typography($theme);
|
|
144
|
-
} @else {
|
|
145
|
-
@include base($theme);
|
|
146
|
-
@if inspection.theme-has($theme, color) {
|
|
147
|
-
@include color($theme);
|
|
148
|
-
}
|
|
149
|
-
@if inspection.theme-has($theme, density) {
|
|
150
|
-
@include density($theme);
|
|
151
|
-
}
|
|
152
|
-
@if inspection.theme-has($theme, typography) {
|
|
153
|
-
@include typography($theme);
|
|
154
|
-
}
|
|
155
117
|
}
|
|
156
118
|
}
|
|
157
119
|
}
|
package/slider/_m2-slider.scss
CHANGED
|
@@ -1,44 +1,35 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../core/theming/inspection';
|
|
3
2
|
@use '../core/style/elevation';
|
|
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() {
|
|
10
|
-
@return (
|
|
11
|
-
slider-active-track-height: 6px,
|
|
12
|
-
slider-active-track-shape: 9999px,
|
|
13
|
-
slider-handle-elevation: elevation.get-box-shadow(1),
|
|
14
|
-
slider-handle-height: 20px,
|
|
15
|
-
slider-handle-shape: 50%,
|
|
16
|
-
slider-handle-width: 20px,
|
|
17
|
-
slider-inactive-track-height: 4px,
|
|
18
|
-
slider-inactive-track-shape: 9999px,
|
|
19
|
-
slider-value-indicator-border-radius: 4px,
|
|
20
|
-
slider-value-indicator-caret-display: block,
|
|
21
|
-
slider-value-indicator-container-transform: translateX(-50%),
|
|
22
|
-
slider-value-indicator-height: 32px,
|
|
23
|
-
slider-value-indicator-padding: 0 12px,
|
|
24
|
-
slider-value-indicator-text-transform: none,
|
|
25
|
-
slider-value-indicator-width: auto,
|
|
26
|
-
slider-with-overlap-handle-outline-width: 1px,
|
|
27
|
-
slider-with-tick-marks-active-container-opacity: 0.6,
|
|
28
|
-
slider-with-tick-marks-container-shape: 50%,
|
|
29
|
-
slider-with-tick-marks-container-size: 2px,
|
|
30
|
-
slider-with-tick-marks-inactive-container-opacity: 0.6,
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
35
|
-
@function get-color-tokens($theme) {
|
|
6
|
+
@function get-tokens($theme) {
|
|
36
7
|
$system: m2-utils.get-system($theme);
|
|
37
|
-
$theme-color-tokens: private-get-color-palette-color-tokens($theme, primary);
|
|
38
8
|
|
|
39
|
-
@return
|
|
40
|
-
|
|
41
|
-
|
|
9
|
+
@return (
|
|
10
|
+
base: (
|
|
11
|
+
slider-active-track-height: 6px,
|
|
12
|
+
slider-active-track-shape: 9999px,
|
|
13
|
+
slider-handle-elevation: elevation.get-box-shadow(1),
|
|
14
|
+
slider-handle-height: 20px,
|
|
15
|
+
slider-handle-shape: 50%,
|
|
16
|
+
slider-handle-width: 20px,
|
|
17
|
+
slider-inactive-track-height: 4px,
|
|
18
|
+
slider-inactive-track-shape: 9999px,
|
|
19
|
+
slider-value-indicator-border-radius: 4px,
|
|
20
|
+
slider-value-indicator-caret-display: block,
|
|
21
|
+
slider-value-indicator-container-transform: translateX(-50%),
|
|
22
|
+
slider-value-indicator-height: 32px,
|
|
23
|
+
slider-value-indicator-padding: 0 12px,
|
|
24
|
+
slider-value-indicator-text-transform: none,
|
|
25
|
+
slider-value-indicator-width: auto,
|
|
26
|
+
slider-with-overlap-handle-outline-width: 1px,
|
|
27
|
+
slider-with-tick-marks-active-container-opacity: 0.6,
|
|
28
|
+
slider-with-tick-marks-container-shape: 50%,
|
|
29
|
+
slider-with-tick-marks-container-size: 2px,
|
|
30
|
+
slider-with-tick-marks-inactive-container-opacity: 0.6,
|
|
31
|
+
),
|
|
32
|
+
color: map.merge(private-get-color-palette-color-tokens($theme, primary), (
|
|
42
33
|
slider-disabled-active-track-color: map.get($system, on-surface),
|
|
43
34
|
slider-disabled-handle-color: map.get($system, on-surface),
|
|
44
35
|
slider-disabled-inactive-track-color: map.get($system, on-surface),
|
|
@@ -46,8 +37,16 @@
|
|
|
46
37
|
slider-label-label-text-color: map.get($system, inverse-on-surface),
|
|
47
38
|
slider-value-indicator-opacity: 1,
|
|
48
39
|
slider-with-overlap-handle-outline-color: map.get($system, on-surface),
|
|
49
|
-
slider-with-tick-marks-disabled-container-color: map.get($system, on-surface),
|
|
40
|
+
slider-with-tick-marks-disabled-container-color: map.get($system, on-surface)),
|
|
41
|
+
),
|
|
42
|
+
typography: (
|
|
43
|
+
slider-label-label-text-font: map.get($system, label-medium-font),
|
|
44
|
+
slider-label-label-text-size: map.get($system, label-medium-size),
|
|
45
|
+
slider-label-label-text-line-height: map.get($system, label-medium-line-height),
|
|
46
|
+
slider-label-label-text-tracking: map.get($system, label-medium-tracking),
|
|
47
|
+
slider-label-label-text-weight: map.get($system, label-medium-weight),
|
|
50
48
|
),
|
|
49
|
+
density: (),
|
|
51
50
|
);
|
|
52
51
|
}
|
|
53
52
|
|
|
@@ -55,7 +54,6 @@
|
|
|
55
54
|
@function private-get-color-palette-color-tokens($theme, $color-variant) {
|
|
56
55
|
$system: m2-utils.get-system($theme);
|
|
57
56
|
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
58
|
-
$color: map.get($system, primary);
|
|
59
57
|
|
|
60
58
|
@return (
|
|
61
59
|
slider-active-track-color: map.get($system, primary),
|
|
@@ -72,22 +70,3 @@
|
|
|
72
70
|
slider-with-tick-marks-inactive-container-color: map.get($system, primary),
|
|
73
71
|
);
|
|
74
72
|
}
|
|
75
|
-
|
|
76
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
77
|
-
@function get-typography-tokens($theme) {
|
|
78
|
-
@return (
|
|
79
|
-
slider-label-label-text-font: inspection.get-theme-typography($theme, subtitle-2, font-family),
|
|
80
|
-
slider-label-label-text-size: inspection.get-theme-typography($theme, subtitle-2, font-size),
|
|
81
|
-
slider-label-label-text-line-height:
|
|
82
|
-
inspection.get-theme-typography($theme, subtitle-2, line-height),
|
|
83
|
-
slider-label-label-text-tracking:
|
|
84
|
-
inspection.get-theme-typography($theme, subtitle-2, letter-spacing),
|
|
85
|
-
slider-label-label-text-weight:
|
|
86
|
-
inspection.get-theme-typography($theme, subtitle-2, font-weight),
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
91
|
-
@function get-density-tokens($theme) {
|
|
92
|
-
@return ();
|
|
93
|
-
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
@use '../core/theming/theming';
|
|
2
1
|
@use '../core/theming/inspection';
|
|
3
2
|
@use '../core/typography/typography';
|
|
4
|
-
@use '../core/style/sass-utils';
|
|
5
3
|
@use '../core/tokens/token-utils';
|
|
6
4
|
@use './m2-slider';
|
|
7
5
|
@use './m3-slider';
|
|
@@ -11,35 +9,34 @@
|
|
|
11
9
|
/// for the mat-slider.
|
|
12
10
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
13
11
|
@mixin base($theme) {
|
|
12
|
+
$tokens: map.get(m2-slider.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-slider.get-unthemable-tokens());
|
|
19
|
-
}
|
|
14
|
+
$tokens: map.get(m3-slider.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-slider.
|
|
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 (M3 only)
|
|
26
23
|
@mixin color($theme, $color-variant: null) {
|
|
24
|
+
$tokens: map.get(m2-slider.get-tokens($theme), color);
|
|
27
25
|
@if inspection.get-theme-version($theme) == 1 {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} @else {
|
|
31
|
-
@include sass-utils.current-selector-or-root() {
|
|
32
|
-
@include token-utils.create-token-values-mixed(m2-slider.get-color-tokens($theme));
|
|
26
|
+
$tokens: map.get(m3-slider.get-tokens($theme, $color-variant), color);
|
|
27
|
+
}
|
|
33
28
|
|
|
34
|
-
|
|
35
|
-
@include token-utils.create-token-values-mixed(
|
|
36
|
-
m2-slider.private-get-color-palette-color-tokens($theme, secondary));
|
|
37
|
-
}
|
|
29
|
+
@include token-utils.values($tokens);
|
|
38
30
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
@if inspection.get-theme-version($theme) != 1 {
|
|
32
|
+
.mat-accent {
|
|
33
|
+
$tokens: m2-slider.private-get-color-palette-color-tokens($theme, secondary);
|
|
34
|
+
@include token-utils.values($tokens);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.mat-warn {
|
|
38
|
+
$tokens: m2-slider.private-get-color-palette-color-tokens($theme, error);
|
|
39
|
+
@include token-utils.values($tokens);
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
42
|
}
|
|
@@ -47,25 +44,23 @@
|
|
|
47
44
|
/// Outputs typography theme styles for the mat-slider.
|
|
48
45
|
/// @param {Map} $theme The theme to generate typography styles for.
|
|
49
46
|
@mixin typography($theme) {
|
|
47
|
+
$tokens: map.get(m2-slider.get-tokens($theme), typography);
|
|
50
48
|
@if inspection.get-theme-version($theme) == 1 {
|
|
51
|
-
|
|
52
|
-
} @else {
|
|
53
|
-
@include sass-utils.current-selector-or-root() {
|
|
54
|
-
@include token-utils.create-token-values-mixed(m2-slider.get-typography-tokens($theme));
|
|
55
|
-
}
|
|
49
|
+
$tokens: map.get(m3-slider.get-tokens($theme), typography);
|
|
56
50
|
}
|
|
51
|
+
|
|
52
|
+
@include token-utils.values($tokens);
|
|
57
53
|
}
|
|
58
54
|
|
|
59
55
|
/// Outputs density theme styles for the mat-slider.
|
|
60
56
|
/// @param {Map} $theme The theme to generate density styles for.
|
|
61
57
|
@mixin density($theme) {
|
|
58
|
+
$tokens: map.get(m2-slider.get-tokens($theme), density);
|
|
62
59
|
@if inspection.get-theme-version($theme) == 1 {
|
|
63
|
-
|
|
64
|
-
} @else {
|
|
65
|
-
@include sass-utils.current-selector-or-root() {
|
|
66
|
-
@include token-utils.create-token-values-mixed(m2-slider.get-density-tokens($theme));
|
|
67
|
-
}
|
|
60
|
+
$tokens: map.get(m3-slider.get-tokens($theme), density);
|
|
68
61
|
}
|
|
62
|
+
|
|
63
|
+
@include token-utils.values($tokens);
|
|
69
64
|
}
|
|
70
65
|
|
|
71
66
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -88,23 +83,21 @@
|
|
|
88
83
|
/// @param {Map} $theme The theme to generate styles for.
|
|
89
84
|
/// @param {String} $color-variant The color variant to use for the component (M3 only)
|
|
90
85
|
@mixin theme($theme, $color-variant: null) {
|
|
91
|
-
@
|
|
92
|
-
@
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
87
|
+
@include base($theme);
|
|
88
|
+
@include color($theme, $color-variant);
|
|
89
|
+
@include density($theme);
|
|
90
|
+
@include typography($theme);
|
|
91
|
+
} @else {
|
|
92
|
+
@include base($theme);
|
|
93
|
+
@if inspection.theme-has($theme, color) {
|
|
94
|
+
@include color($theme);
|
|
95
|
+
}
|
|
96
|
+
@if inspection.theme-has($theme, density) {
|
|
95
97
|
@include density($theme);
|
|
98
|
+
}
|
|
99
|
+
@if inspection.theme-has($theme, typography) {
|
|
96
100
|
@include typography($theme);
|
|
97
|
-
} @else {
|
|
98
|
-
@include base($theme);
|
|
99
|
-
@if inspection.theme-has($theme, color) {
|
|
100
|
-
@include color($theme);
|
|
101
|
-
}
|
|
102
|
-
@if inspection.theme-has($theme, density) {
|
|
103
|
-
@include density($theme);
|
|
104
|
-
}
|
|
105
|
-
@if inspection.theme-has($theme, typography) {
|
|
106
|
-
@include typography($theme);
|
|
107
|
-
}
|
|
108
101
|
}
|
|
109
102
|
}
|
|
110
103
|
}
|
|
@@ -1,44 +1,24 @@
|
|
|
1
|
-
@use '../core/theming/inspection';
|
|
2
1
|
@use '../core/tokens/m2-utils';
|
|
3
2
|
@use 'sass:map';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
// but may be in a future version of the theming API.
|
|
7
|
-
@function get-unthemable-tokens() {
|
|
8
|
-
@return (
|
|
9
|
-
snack-bar-container-shape: 4px,
|
|
10
|
-
);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
14
|
-
@function get-color-tokens($theme) {
|
|
15
|
-
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
4
|
+
@function get-tokens($theme) {
|
|
16
5
|
$system: m2-utils.get-system($theme);
|
|
17
6
|
|
|
18
7
|
@return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
snack-bar-supporting-text-line-height:
|
|
35
|
-
inspection.get-theme-typography($theme, body-2, line-height),
|
|
36
|
-
snack-bar-supporting-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
37
|
-
snack-bar-supporting-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
|
|
8
|
+
base: (
|
|
9
|
+
snack-bar-container-shape: 4px,
|
|
10
|
+
),
|
|
11
|
+
color: (
|
|
12
|
+
snack-bar-container-color: map.get($system, inverse-surface),
|
|
13
|
+
snack-bar-supporting-text-color: map.get($system, inverse-on-surface),
|
|
14
|
+
snack-bar-button-color: map.get($system, inverse-primary)
|
|
15
|
+
),
|
|
16
|
+
typography: (
|
|
17
|
+
snack-bar-supporting-text-font: map.get($system, body-medium-font),
|
|
18
|
+
snack-bar-supporting-text-line-height: map.get($system, body-medium-line-height),
|
|
19
|
+
snack-bar-supporting-text-size: map.get($system, body-medium-size),
|
|
20
|
+
snack-bar-supporting-text-weight: map.get($system, body-medium-weight),
|
|
21
|
+
),
|
|
22
|
+
density: (),
|
|
38
23
|
);
|
|
39
24
|
}
|
|
40
|
-
|
|
41
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
42
|
-
@function get-density-tokens($theme) {
|
|
43
|
-
@return ();
|
|
44
|
-
}
|
|
@@ -1,44 +1,43 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../core/theming/theming';
|
|
3
2
|
@use '../core/theming/inspection';
|
|
4
|
-
@use '../core/style/sass-utils';
|
|
5
3
|
@use '../core/typography/typography';
|
|
6
4
|
@use '../core/tokens/token-utils';
|
|
7
5
|
@use './m2-snack-bar';
|
|
8
6
|
@use './m3-snack-bar';
|
|
9
7
|
|
|
10
8
|
@mixin base($theme) {
|
|
9
|
+
$tokens: map.get(m2-snack-bar.get-tokens($theme), base);
|
|
11
10
|
@if inspection.get-theme-version($theme) == 1 {
|
|
12
|
-
|
|
13
|
-
} @else {
|
|
14
|
-
// Add default values for tokens not related to color, typography, or density.
|
|
15
|
-
@include sass-utils.current-selector-or-root() {
|
|
16
|
-
@include token-utils.create-token-values-mixed(m2-snack-bar.get-unthemable-tokens());
|
|
17
|
-
}
|
|
11
|
+
$tokens: map.get(m3-snack-bar.get-tokens($theme), base);
|
|
18
12
|
}
|
|
13
|
+
|
|
14
|
+
@include token-utils.values($tokens);
|
|
19
15
|
}
|
|
20
16
|
|
|
21
17
|
@mixin color($theme) {
|
|
22
18
|
@if inspection.get-theme-version($theme) == 1 {
|
|
23
|
-
@include token-utils.
|
|
19
|
+
@include token-utils.values(map.get(m3-snack-bar.get-tokens($theme), color));
|
|
24
20
|
} @else {
|
|
25
|
-
@include
|
|
26
|
-
@include token-utils.create-token-values-mixed(m2-snack-bar.get-color-tokens($theme));
|
|
27
|
-
}
|
|
21
|
+
@include token-utils.values(map.get(m2-snack-bar.get-tokens($theme), color));
|
|
28
22
|
}
|
|
29
23
|
}
|
|
30
24
|
|
|
31
25
|
@mixin typography($theme) {
|
|
26
|
+
$tokens: map.get(m2-snack-bar.get-tokens($theme), typography);
|
|
32
27
|
@if inspection.get-theme-version($theme) == 1 {
|
|
33
|
-
|
|
34
|
-
} @else {
|
|
35
|
-
@include sass-utils.current-selector-or-root() {
|
|
36
|
-
@include token-utils.create-token-values-mixed(m2-snack-bar.get-typography-tokens($theme));
|
|
37
|
-
}
|
|
28
|
+
$tokens: map.get(m3-snack-bar.get-tokens($theme), typography);
|
|
38
29
|
}
|
|
30
|
+
|
|
31
|
+
@include token-utils.values($tokens);
|
|
39
32
|
}
|
|
40
33
|
|
|
41
34
|
@mixin density($theme) {
|
|
35
|
+
$tokens: map.get(m2-snack-bar.get-tokens($theme), density);
|
|
36
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
37
|
+
$tokens: map.get(m3-snack-bar.get-tokens($theme), density);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@include token-utils.values($tokens);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -58,23 +57,21 @@
|
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
@mixin theme($theme) {
|
|
61
|
-
@
|
|
62
|
-
@
|
|
63
|
-
|
|
60
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
61
|
+
@include base($theme);
|
|
62
|
+
@include color($theme);
|
|
63
|
+
@include density($theme);
|
|
64
|
+
@include typography($theme);
|
|
65
|
+
} @else {
|
|
66
|
+
@include base($theme);
|
|
67
|
+
@if inspection.theme-has($theme, color) {
|
|
64
68
|
@include color($theme);
|
|
69
|
+
}
|
|
70
|
+
@if inspection.theme-has($theme, density) {
|
|
65
71
|
@include density($theme);
|
|
72
|
+
}
|
|
73
|
+
@if inspection.theme-has($theme, typography) {
|
|
66
74
|
@include typography($theme);
|
|
67
|
-
} @else {
|
|
68
|
-
@include base($theme);
|
|
69
|
-
@if inspection.theme-has($theme, color) {
|
|
70
|
-
@include color($theme);
|
|
71
|
-
}
|
|
72
|
-
@if inspection.theme-has($theme, density) {
|
|
73
|
-
@include density($theme);
|
|
74
|
-
}
|
|
75
|
-
@if inspection.theme-has($theme, typography) {
|
|
76
|
-
@include typography($theme);
|
|
77
|
-
}
|
|
78
75
|
}
|
|
79
76
|
}
|
|
80
77
|
}
|
package/sort/_m2-sort.scss
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
@use '../core/tokens/m2-utils';
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
// but may be in a future version of the theming API.
|
|
6
|
-
@function get-unthemable-tokens() {
|
|
7
|
-
@return ();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
11
|
-
@function get-color-tokens($theme) {
|
|
4
|
+
@function get-tokens($theme) {
|
|
12
5
|
$system: m2-utils.get-system($theme);
|
|
13
6
|
|
|
14
7
|
@return (
|
|
15
|
-
|
|
8
|
+
base: (),
|
|
9
|
+
color: (
|
|
10
|
+
sort-arrow-color: map.get($system, on-surface),
|
|
11
|
+
),
|
|
12
|
+
typography: (),
|
|
13
|
+
density: (),
|
|
16
14
|
);
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
20
|
-
@function get-typography-tokens($theme) {
|
|
21
|
-
@return ();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
25
|
-
@function get-density-tokens($theme) {
|
|
26
|
-
@return ();
|
|
27
|
-
}
|