@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,33 +1,20 @@
|
|
|
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';
|
|
7
5
|
@use './m3-button';
|
|
8
6
|
@use 'sass:map';
|
|
9
7
|
|
|
10
|
-
@mixin _m2-button-variant($theme, $palette) {
|
|
11
|
-
$mat-tokens: if(
|
|
12
|
-
$palette,
|
|
13
|
-
m2-button.private-get-color-palette-color-tokens($theme, $palette),
|
|
14
|
-
m2-button.get-color-tokens($theme)
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
@include token-utils.create-token-values-mixed($mat-tokens);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
8
|
/// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
|
|
21
9
|
/// for the mat-button.
|
|
22
10
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
23
11
|
@mixin base($theme) {
|
|
12
|
+
$tokens: map.get(m2-button.get-tokens($theme), base);
|
|
24
13
|
@if inspection.get-theme-version($theme) == 1 {
|
|
25
|
-
|
|
26
|
-
} @else {
|
|
27
|
-
@include sass-utils.current-selector-or-root() {
|
|
28
|
-
@include token-utils.create-token-values-mixed(m2-button.get-unthemable-tokens());
|
|
29
|
-
}
|
|
14
|
+
$tokens: map.get(m3-button.get-tokens($theme), base);
|
|
30
15
|
}
|
|
16
|
+
|
|
17
|
+
@include token-utils.values($tokens);
|
|
31
18
|
}
|
|
32
19
|
|
|
33
20
|
/// Outputs color theme styles for the mat-button.
|
|
@@ -36,56 +23,53 @@
|
|
|
36
23
|
/// the badge: primary, secondary, tertiary, or error (If not specified,
|
|
37
24
|
/// default primary color will be used).
|
|
38
25
|
@mixin color($theme, $color-variant: null) {
|
|
26
|
+
$tokens: map.get(m2-button.get-tokens($theme), color);
|
|
39
27
|
@if inspection.get-theme-version($theme) == 1 {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@include _m2-button-variant($theme, null);
|
|
45
|
-
}
|
|
28
|
+
$tokens: map.get(m3-button.get-tokens($theme, $color-variant), color);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@include token-utils.values($tokens);
|
|
46
32
|
|
|
33
|
+
@if inspection.get-theme-version($theme) != 1 {
|
|
47
34
|
.mat-mdc-button,
|
|
48
35
|
.mat-mdc-unelevated-button,
|
|
49
36
|
.mat-mdc-raised-button,
|
|
50
37
|
.mat-mdc-outlined-button,
|
|
51
38
|
.mat-tonal-button {
|
|
52
39
|
&.mat-primary {
|
|
53
|
-
|
|
40
|
+
$tokens: m2-button.private-get-color-palette-color-tokens($theme, primary);
|
|
41
|
+
@include token-utils.values($tokens);
|
|
54
42
|
}
|
|
55
43
|
|
|
56
44
|
&.mat-accent {
|
|
57
|
-
|
|
45
|
+
$tokens: m2-button.private-get-color-palette-color-tokens($theme, secondary);
|
|
46
|
+
@include token-utils.values($tokens);
|
|
58
47
|
}
|
|
59
48
|
|
|
60
49
|
&.mat-warn {
|
|
61
|
-
|
|
50
|
+
$tokens: m2-button.private-get-color-palette-color-tokens($theme, error);
|
|
51
|
+
@include token-utils.values($tokens);
|
|
62
52
|
}
|
|
63
53
|
}
|
|
64
54
|
}
|
|
65
55
|
}
|
|
66
56
|
|
|
67
|
-
/// Outputs typography theme styles for the mat-button.
|
|
68
|
-
/// @param {Map} $theme The theme to generate typography styles for.
|
|
69
57
|
@mixin typography($theme) {
|
|
58
|
+
$tokens: map.get(m2-button.get-tokens($theme), typography);
|
|
70
59
|
@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-button.get-typography-tokens($theme));
|
|
75
|
-
}
|
|
60
|
+
$tokens: map.get(m3-button.get-tokens($theme), typography);
|
|
76
61
|
}
|
|
62
|
+
|
|
63
|
+
@include token-utils.values($tokens);
|
|
77
64
|
}
|
|
78
65
|
|
|
79
|
-
/// Outputs density theme styles for the mat-button.
|
|
80
|
-
/// @param {Map} $theme The theme to generate density styles for.
|
|
81
66
|
@mixin density($theme) {
|
|
67
|
+
$tokens: map.get(m2-button.get-tokens($theme), density);
|
|
82
68
|
@if inspection.get-theme-version($theme) == 1 {
|
|
83
|
-
|
|
84
|
-
} @else {
|
|
85
|
-
@include sass-utils.current-selector-or-root() {
|
|
86
|
-
@include token-utils.create-token-values-mixed(m2-button.get-density-tokens($theme));
|
|
87
|
-
}
|
|
69
|
+
$tokens: map.get(m3-button.get-tokens($theme), density);
|
|
88
70
|
}
|
|
71
|
+
|
|
72
|
+
@include token-utils.values($tokens);
|
|
89
73
|
}
|
|
90
74
|
|
|
91
75
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -109,23 +93,21 @@
|
|
|
109
93
|
/// @param {String} $color-variant: The color variant to use for the button: primary, secondary,
|
|
110
94
|
// tertiary, or error (If not specified, default primary color will be used).
|
|
111
95
|
@mixin theme($theme, $color-variant: null) {
|
|
112
|
-
@
|
|
113
|
-
@
|
|
114
|
-
|
|
115
|
-
|
|
96
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
97
|
+
@include base($theme);
|
|
98
|
+
@include color($theme, $color-variant);
|
|
99
|
+
@include density($theme);
|
|
100
|
+
@include typography($theme);
|
|
101
|
+
} @else {
|
|
102
|
+
@include base($theme);
|
|
103
|
+
@if inspection.theme-has($theme, color) {
|
|
104
|
+
@include color($theme);
|
|
105
|
+
}
|
|
106
|
+
@if inspection.theme-has($theme, density) {
|
|
116
107
|
@include density($theme);
|
|
108
|
+
}
|
|
109
|
+
@if inspection.theme-has($theme, typography) {
|
|
117
110
|
@include typography($theme);
|
|
118
|
-
} @else {
|
|
119
|
-
@include base($theme);
|
|
120
|
-
@if inspection.theme-has($theme, color) {
|
|
121
|
-
@include color($theme);
|
|
122
|
-
}
|
|
123
|
-
@if inspection.theme-has($theme, density) {
|
|
124
|
-
@include density($theme);
|
|
125
|
-
}
|
|
126
|
-
@if inspection.theme-has($theme, typography) {
|
|
127
|
-
@include typography($theme);
|
|
128
|
-
}
|
|
129
111
|
}
|
|
130
112
|
}
|
|
131
113
|
}
|
package/button/_fab-theme.scss
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@use '../core/style/sass-utils';
|
|
2
|
-
@use '../core/theming/theming';
|
|
3
1
|
@use '../core/theming/inspection';
|
|
4
2
|
@use './m2-fab';
|
|
5
3
|
@use './m3-fab';
|
|
@@ -11,23 +9,12 @@
|
|
|
11
9
|
/// for the mat-fab.
|
|
12
10
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
13
11
|
@mixin base($theme) {
|
|
12
|
+
$tokens: map.get(m2-fab.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-fab.get-unthemable-tokens());
|
|
19
|
-
}
|
|
14
|
+
$tokens: map.get(m3-fab.get-tokens($theme), base);
|
|
20
15
|
}
|
|
21
|
-
}
|
|
22
16
|
|
|
23
|
-
@
|
|
24
|
-
$mat-tokens: if(
|
|
25
|
-
$palette,
|
|
26
|
-
m2-fab.private-get-color-palette-color-tokens($theme, $palette),
|
|
27
|
-
m2-fab.get-color-tokens($theme)
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
@include token-utils.create-token-values-mixed($mat-tokens);
|
|
17
|
+
@include token-utils.values($tokens);
|
|
31
18
|
}
|
|
32
19
|
|
|
33
20
|
/// Outputs color theme styles for the mat-fab.
|
|
@@ -35,25 +22,28 @@
|
|
|
35
22
|
/// @param {ArgList} $color-variant: The color variant to use for the fab: primary, secondary,
|
|
36
23
|
// or tertiary. (If not specified, default primary color will be used).
|
|
37
24
|
@mixin color($theme, $color-variant: null) {
|
|
25
|
+
$tokens: map.get(m2-fab.get-tokens($theme), color);
|
|
38
26
|
@if inspection.get-theme-version($theme) == 1 {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
@include _fab-variant($theme, null);
|
|
27
|
+
$tokens: map.get(m3-fab.get-tokens($theme, $color-variant), color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include token-utils.values($tokens);
|
|
44
31
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
@if inspection.get-theme-version($theme) != 1 {
|
|
33
|
+
.mat-mdc-fab, .mat-mdc-mini-fab {
|
|
34
|
+
&.mat-primary {
|
|
35
|
+
$tokens: m2-fab.private-get-color-palette-color-tokens($theme, primary);
|
|
36
|
+
@include token-utils.values($tokens);
|
|
37
|
+
}
|
|
49
38
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
&.mat-accent {
|
|
40
|
+
$tokens: m2-fab.private-get-color-palette-color-tokens($theme, secondary);
|
|
41
|
+
@include token-utils.values($tokens);
|
|
42
|
+
}
|
|
53
43
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
&.mat-warn {
|
|
45
|
+
$tokens: m2-fab.private-get-color-palette-color-tokens($theme, error);
|
|
46
|
+
@include token-utils.values($tokens);
|
|
57
47
|
}
|
|
58
48
|
}
|
|
59
49
|
}
|
|
@@ -62,25 +52,23 @@
|
|
|
62
52
|
/// Outputs typography theme styles for the mat-fab.
|
|
63
53
|
/// @param {Map} $theme The theme to generate typography styles for.
|
|
64
54
|
@mixin typography($theme) {
|
|
55
|
+
$tokens: map.get(m2-fab.get-tokens($theme), typography);
|
|
65
56
|
@if inspection.get-theme-version($theme) == 1 {
|
|
66
|
-
|
|
67
|
-
} @else {
|
|
68
|
-
@include sass-utils.current-selector-or-root() {
|
|
69
|
-
@include token-utils.create-token-values-mixed(m2-fab.get-typography-tokens($theme));
|
|
70
|
-
}
|
|
57
|
+
$tokens: map.get(m3-fab.get-tokens($theme), typography);
|
|
71
58
|
}
|
|
59
|
+
|
|
60
|
+
@include token-utils.values($tokens);
|
|
72
61
|
}
|
|
73
62
|
|
|
74
63
|
/// Outputs density theme styles for the mat-fab.
|
|
75
64
|
/// @param {Map} $theme The theme to generate density styles for.
|
|
76
65
|
@mixin density($theme) {
|
|
66
|
+
$tokens: map.get(m2-fab.get-tokens($theme), density);
|
|
77
67
|
@if inspection.get-theme-version($theme) == 1 {
|
|
78
|
-
|
|
79
|
-
} @else {
|
|
80
|
-
@include sass-utils.current-selector-or-root() {
|
|
81
|
-
@include token-utils.create-token-values-mixed(m2-fab.get-density-tokens($theme));
|
|
82
|
-
}
|
|
68
|
+
$tokens: map.get(m3-fab.get-tokens($theme), density);
|
|
83
69
|
}
|
|
70
|
+
|
|
71
|
+
@include token-utils.values($tokens);
|
|
84
72
|
}
|
|
85
73
|
|
|
86
74
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -103,23 +91,21 @@
|
|
|
103
91
|
/// @param {Map} $theme The theme to generate styles for.
|
|
104
92
|
/// @param {String} $color-variant: The color variant to use for the fab
|
|
105
93
|
@mixin theme($theme, $color-variant: null) {
|
|
106
|
-
@
|
|
107
|
-
@
|
|
108
|
-
|
|
109
|
-
|
|
94
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
95
|
+
@include base($theme);
|
|
96
|
+
@include color($theme, $color-variant);
|
|
97
|
+
@include density($theme);
|
|
98
|
+
@include typography($theme);
|
|
99
|
+
} @else {
|
|
100
|
+
@include base($theme);
|
|
101
|
+
@if inspection.theme-has($theme, color) {
|
|
102
|
+
@include color($theme);
|
|
103
|
+
}
|
|
104
|
+
@if inspection.theme-has($theme, density) {
|
|
110
105
|
@include density($theme);
|
|
106
|
+
}
|
|
107
|
+
@if inspection.theme-has($theme, typography) {
|
|
111
108
|
@include typography($theme);
|
|
112
|
-
} @else {
|
|
113
|
-
@include base($theme);
|
|
114
|
-
@if inspection.theme-has($theme, color) {
|
|
115
|
-
@include color($theme);
|
|
116
|
-
}
|
|
117
|
-
@if inspection.theme-has($theme, density) {
|
|
118
|
-
@include density($theme);
|
|
119
|
-
}
|
|
120
|
-
@if inspection.theme-has($theme, typography) {
|
|
121
|
-
@include typography($theme);
|
|
122
|
-
}
|
|
123
109
|
}
|
|
124
110
|
}
|
|
125
111
|
}
|
|
@@ -2,30 +2,18 @@
|
|
|
2
2
|
@use 'sass:math';
|
|
3
3
|
@use './m2-icon-button';
|
|
4
4
|
@use './m3-icon-button';
|
|
5
|
-
@use '../core/style/sass-utils';
|
|
6
5
|
@use '../core/tokens/token-utils';
|
|
7
|
-
@use '../core/
|
|
6
|
+
@use '../core/tokens/m2-utils';
|
|
8
7
|
@use '../core/theming/inspection';
|
|
8
|
+
@use '../core/theming/theming';
|
|
9
9
|
|
|
10
10
|
@mixin base($theme) {
|
|
11
|
+
$tokens: map.get(m2-icon-button.get-tokens($theme), base);
|
|
11
12
|
@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-icon-button.get-unthemable-tokens());
|
|
17
|
-
}
|
|
13
|
+
$tokens: map.get(m3-icon-button.get-tokens($theme), base);
|
|
18
14
|
}
|
|
19
|
-
}
|
|
20
15
|
|
|
21
|
-
@
|
|
22
|
-
$mat-tokens: if(
|
|
23
|
-
$palette,
|
|
24
|
-
m2-icon-button.private-get-color-palette-color-tokens($theme, $palette),
|
|
25
|
-
m2-icon-button.get-color-tokens($theme)
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
@include token-utils.create-token-values-mixed($mat-tokens);
|
|
16
|
+
@include token-utils.values($tokens);
|
|
29
17
|
}
|
|
30
18
|
|
|
31
19
|
/// Outputs color theme styles for the mat-icon-button.
|
|
@@ -33,48 +21,49 @@
|
|
|
33
21
|
/// @param {String} $color-variant: The color variant to use for the
|
|
34
22
|
// button: primary, secondary, tertiary, or error.
|
|
35
23
|
@mixin color($theme, $color-variant: null) {
|
|
24
|
+
$tokens: map.get(m2-icon-button.get-tokens($theme), color);
|
|
36
25
|
@if inspection.get-theme-version($theme) == 1 {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} @else {
|
|
40
|
-
@include sass-utils.current-selector-or-root() {
|
|
41
|
-
@include _m2-icon-button-variant($theme, null);
|
|
26
|
+
$tokens: map.get(m3-icon-button.get-tokens($theme, $color-variant), color);
|
|
27
|
+
}
|
|
42
28
|
|
|
43
|
-
|
|
44
|
-
&.mat-primary {
|
|
45
|
-
@include _m2-icon-button-variant($theme, primary);
|
|
46
|
-
}
|
|
29
|
+
@include token-utils.values($tokens);
|
|
47
30
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
31
|
+
@if inspection.get-theme-version($theme) != 1 {
|
|
32
|
+
.mat-mdc-icon-button {
|
|
33
|
+
&.mat-primary {
|
|
34
|
+
$tokens: m2-icon-button.private-get-color-palette-color-tokens($theme, primary);
|
|
35
|
+
@include token-utils.values($tokens);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.mat-accent {
|
|
39
|
+
$tokens: m2-icon-button.private-get-color-palette-color-tokens($theme, secondary);
|
|
40
|
+
@include token-utils.values($tokens);
|
|
41
|
+
}
|
|
51
42
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
&.mat-warn {
|
|
44
|
+
$tokens: m2-icon-button.private-get-color-palette-color-tokens($theme, error);
|
|
45
|
+
@include token-utils.values($tokens);
|
|
55
46
|
}
|
|
56
47
|
}
|
|
57
48
|
}
|
|
58
49
|
}
|
|
59
50
|
|
|
60
51
|
@mixin typography($theme) {
|
|
52
|
+
$tokens: map.get(m2-icon-button.get-tokens($theme), typography);
|
|
61
53
|
@if inspection.get-theme-version($theme) == 1 {
|
|
62
|
-
|
|
63
|
-
map.get(m3-icon-button.get-tokens($theme), typography));
|
|
64
|
-
} @else {
|
|
65
|
-
@include sass-utils.current-selector-or-root() {
|
|
66
|
-
@include token-utils.create-token-values-mixed(m2-icon-button.get-typography-tokens($theme)
|
|
67
|
-
);
|
|
68
|
-
}
|
|
54
|
+
$tokens: map.get(m3-icon-button.get-tokens($theme), typography);
|
|
69
55
|
}
|
|
56
|
+
|
|
57
|
+
@include token-utils.values($tokens);
|
|
70
58
|
}
|
|
71
59
|
|
|
72
60
|
@mixin density($theme) {
|
|
73
61
|
@if inspection.get-theme-version($theme) == 1 {
|
|
74
|
-
@include token-utils.
|
|
62
|
+
@include token-utils.values(map.get(m3-icon-button.get-tokens($theme), density));
|
|
75
63
|
} @else {
|
|
76
64
|
$icon-size: 24px;
|
|
77
|
-
$
|
|
65
|
+
$system: m2-utils.get-system($theme);
|
|
66
|
+
$density-scale: theming.clamp-density(map.get($system, density-scale), -5);
|
|
78
67
|
$size-map: (
|
|
79
68
|
0: 48px,
|
|
80
69
|
-1: 44px,
|
|
@@ -85,12 +74,9 @@
|
|
|
85
74
|
);
|
|
86
75
|
$calculated-size: map.get($size-map, $density-scale);
|
|
87
76
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
$theme, $exclude: (icon-button-state-layer-size))
|
|
92
|
-
);
|
|
93
|
-
}
|
|
77
|
+
$density-tokens: map.get(m2-icon-button.get-tokens($theme), density);
|
|
78
|
+
$density-tokens: map.remove($density-tokens, icon-button-state-layer-size);
|
|
79
|
+
@include token-utils.values($density-tokens);
|
|
94
80
|
|
|
95
81
|
// Use `mat-mdc-button-base` to increase the specificity over the button's structural styles.
|
|
96
82
|
.mat-mdc-icon-button.mat-mdc-button-base {
|
|
@@ -130,7 +116,6 @@
|
|
|
130
116
|
/// @param {String} $color-variant: The color variant to use for the button: primary,
|
|
131
117
|
// secondary, tertiary, or error.
|
|
132
118
|
@mixin theme($theme, $color-variant: null) {
|
|
133
|
-
@include theming.private-check-duplicate-theme-styles($theme, 'mat-icon-button') {
|
|
134
119
|
@if inspection.get-theme-version($theme) == 1 {
|
|
135
120
|
@include base($theme);
|
|
136
121
|
@include color($theme, $color-variant);
|
|
@@ -146,7 +131,6 @@
|
|
|
146
131
|
}
|
|
147
132
|
@if inspection.theme-has($theme, typography) {
|
|
148
133
|
@include typography($theme);
|
|
149
|
-
}
|
|
150
134
|
}
|
|
151
135
|
}
|
|
152
136
|
}
|