@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
package/button/_m2-button.scss
CHANGED
|
@@ -2,105 +2,147 @@
|
|
|
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
|
@use '../core/style/elevation';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
// but may be in a future version of the theming API.
|
|
10
|
-
@function get-unthemable-tokens() {
|
|
11
|
-
@return (
|
|
12
|
-
button-filled-container-shape: 4px,
|
|
13
|
-
button-filled-horizontal-padding: 16px,
|
|
14
|
-
button-filled-icon-offset: -4px,
|
|
15
|
-
button-filled-icon-spacing: 8px,
|
|
16
|
-
button-outlined-container-shape: 4px,
|
|
17
|
-
button-outlined-horizontal-padding: 15px, // Normally it's 16px, but -1px for the outline.
|
|
18
|
-
button-outlined-icon-offset: -4px,
|
|
19
|
-
button-outlined-icon-spacing: 8px,
|
|
20
|
-
button-outlined-keep-touch-target: false,
|
|
21
|
-
button-outlined-outline-width: 1px,
|
|
22
|
-
button-protected-container-elevation-shadow: elevation.get-box-shadow(2),
|
|
23
|
-
button-protected-container-shape: 4px,
|
|
24
|
-
button-protected-disabled-container-elevation-shadow: elevation.get-box-shadow(0),
|
|
25
|
-
button-protected-focus-container-elevation-shadow: elevation.get-box-shadow(4),
|
|
26
|
-
button-protected-horizontal-padding: 16px,
|
|
27
|
-
button-protected-hover-container-elevation-shadow: elevation.get-box-shadow(4),
|
|
28
|
-
button-protected-icon-offset: -4px,
|
|
29
|
-
button-protected-icon-spacing: 8px,
|
|
30
|
-
button-protected-pressed-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
31
|
-
button-text-container-shape: 4px,
|
|
32
|
-
button-text-horizontal-padding: 8px,
|
|
33
|
-
button-text-icon-offset: 0,
|
|
34
|
-
button-text-icon-spacing: 8px,
|
|
35
|
-
button-text-with-icon-horizontal-padding: 8px,
|
|
36
|
-
button-tonal-container-shape: 4px,
|
|
37
|
-
button-tonal-horizontal-padding: 16px,
|
|
38
|
-
button-tonal-icon-offset: -4px,
|
|
39
|
-
button-tonal-icon-spacing: 8px,
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
44
|
-
@function get-color-tokens($theme) {
|
|
7
|
+
@function get-tokens($theme) {
|
|
45
8
|
$system: m2-utils.get-system($theme);
|
|
46
|
-
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
47
9
|
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
48
10
|
$disabled-container : m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
49
11
|
|
|
12
|
+
$scale: theming.clamp-density(map.get($system, density-scale), -3);
|
|
13
|
+
$height: map.get((
|
|
14
|
+
0: 36px,
|
|
15
|
+
-1: 32px,
|
|
16
|
+
-2: 28px,
|
|
17
|
+
-3: 24px,
|
|
18
|
+
), $scale);
|
|
19
|
+
$touch-target-display: if($scale < -1, none, block);
|
|
20
|
+
|
|
50
21
|
@return (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
22
|
+
base: (
|
|
23
|
+
button-filled-container-shape: 4px,
|
|
24
|
+
button-filled-horizontal-padding: 16px,
|
|
25
|
+
button-filled-icon-offset: -4px,
|
|
26
|
+
button-filled-icon-spacing: 8px,
|
|
27
|
+
button-outlined-container-shape: 4px,
|
|
28
|
+
button-outlined-horizontal-padding: 15px, // Normally it's 16px, but -1px for the outline.
|
|
29
|
+
button-outlined-icon-offset: -4px,
|
|
30
|
+
button-outlined-icon-spacing: 8px,
|
|
31
|
+
button-outlined-keep-touch-target: false,
|
|
32
|
+
button-outlined-outline-width: 1px,
|
|
33
|
+
button-protected-container-elevation-shadow: elevation.get-box-shadow(2),
|
|
34
|
+
button-protected-container-shape: 4px,
|
|
35
|
+
button-protected-disabled-container-elevation-shadow: elevation.get-box-shadow(0),
|
|
36
|
+
button-protected-focus-container-elevation-shadow: elevation.get-box-shadow(4),
|
|
37
|
+
button-protected-horizontal-padding: 16px,
|
|
38
|
+
button-protected-hover-container-elevation-shadow: elevation.get-box-shadow(4),
|
|
39
|
+
button-protected-icon-offset: -4px,
|
|
40
|
+
button-protected-icon-spacing: 8px,
|
|
41
|
+
button-protected-pressed-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
42
|
+
button-text-container-shape: 4px,
|
|
43
|
+
button-text-horizontal-padding: 8px,
|
|
44
|
+
button-text-icon-offset: 0,
|
|
45
|
+
button-text-icon-spacing: 8px,
|
|
46
|
+
button-text-with-icon-horizontal-padding: 8px,
|
|
47
|
+
button-tonal-container-shape: 4px,
|
|
48
|
+
button-tonal-horizontal-padding: 16px,
|
|
49
|
+
button-tonal-icon-offset: -4px,
|
|
50
|
+
button-tonal-icon-spacing: 8px,
|
|
51
|
+
),
|
|
52
|
+
color: (
|
|
53
|
+
button-filled-container-color: map.get($system, surface),
|
|
54
|
+
button-filled-disabled-container-color: $disabled-container,
|
|
55
|
+
button-filled-disabled-label-text-color: $disabled,
|
|
56
|
+
button-filled-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
57
|
+
button-filled-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
58
|
+
button-filled-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
59
|
+
button-filled-label-text-color: map.get($system, on-surface),
|
|
60
|
+
button-filled-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
61
|
+
button-filled-ripple-color: m3-utils.color-with-opacity(
|
|
62
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
63
|
+
button-filled-state-layer-color: map.get($system, on-surface),
|
|
64
|
+
button-outlined-disabled-label-text-color: $disabled,
|
|
65
|
+
button-outlined-disabled-outline-color: map.get($system, outline),
|
|
66
|
+
button-outlined-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
67
|
+
button-outlined-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
68
|
+
button-outlined-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
69
|
+
button-outlined-label-text-color: map.get($system, on-surface),
|
|
70
|
+
button-outlined-outline-color: map.get($system, outline),
|
|
71
|
+
button-outlined-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
72
|
+
button-outlined-ripple-color: m3-utils.color-with-opacity(
|
|
73
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
74
|
+
button-outlined-state-layer-color: map.get($system, on-surface),
|
|
75
|
+
button-protected-container-color: map.get($system, surface),
|
|
76
|
+
button-protected-disabled-container-color: $disabled-container,
|
|
77
|
+
button-protected-disabled-label-text-color: $disabled,
|
|
78
|
+
button-protected-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
79
|
+
button-protected-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
80
|
+
button-protected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
81
|
+
button-protected-label-text-color: map.get($system, on-surface),
|
|
82
|
+
button-protected-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
83
|
+
button-protected-ripple-color: m3-utils.color-with-opacity(
|
|
84
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
85
|
+
button-protected-state-layer-color: map.get($system, on-surface),
|
|
86
|
+
button-text-disabled-label-text-color: $disabled,
|
|
87
|
+
button-text-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
88
|
+
button-text-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
89
|
+
button-text-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
90
|
+
button-text-label-text-color: map.get($system, on-surface),
|
|
91
|
+
button-text-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
92
|
+
button-text-ripple-color: m3-utils.color-with-opacity(
|
|
93
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
94
|
+
button-text-state-layer-color: map.get($system, on-surface),
|
|
95
|
+
button-tonal-container-color: map.get($system, surface),
|
|
96
|
+
button-tonal-disabled-container-color: $disabled-container,
|
|
97
|
+
button-tonal-disabled-label-text-color: $disabled,
|
|
98
|
+
button-tonal-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
99
|
+
button-tonal-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
100
|
+
button-tonal-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
101
|
+
button-tonal-label-text-color: map.get($system, on-surface),
|
|
102
|
+
button-tonal-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
103
|
+
button-tonal-ripple-color: m3-utils.color-with-opacity(
|
|
104
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
105
|
+
button-tonal-state-layer-color: map.get($system, on-surface),
|
|
106
|
+
),
|
|
107
|
+
typography: (
|
|
108
|
+
button-filled-label-text-font: map.get($system, label-small-font),
|
|
109
|
+
button-filled-label-text-size: map.get($system, label-small-size),
|
|
110
|
+
button-filled-label-text-tracking: map.get($system, label-small-tracking),
|
|
111
|
+
button-filled-label-text-transform: none,
|
|
112
|
+
button-filled-label-text-weight: map.get($system, label-small-weight),
|
|
113
|
+
button-outlined-label-text-font: map.get($system, label-small-font),
|
|
114
|
+
button-outlined-label-text-size: map.get($system, label-small-size),
|
|
115
|
+
button-outlined-label-text-tracking: map.get($system, label-small-tracking),
|
|
116
|
+
button-outlined-label-text-transform: none,
|
|
117
|
+
button-outlined-label-text-weight: map.get($system, label-small-weight),
|
|
118
|
+
button-protected-label-text-font: map.get($system, label-small-font),
|
|
119
|
+
button-protected-label-text-size: map.get($system, label-small-size),
|
|
120
|
+
button-protected-label-text-tracking: map.get($system, label-small-tracking),
|
|
121
|
+
button-protected-label-text-transform: none,
|
|
122
|
+
button-protected-label-text-weight: map.get($system, label-small-weight),
|
|
123
|
+
button-text-label-text-font: map.get($system, label-small-font),
|
|
124
|
+
button-text-label-text-size: map.get($system, label-small-size),
|
|
125
|
+
button-text-label-text-tracking: map.get($system, label-small-tracking),
|
|
126
|
+
button-text-label-text-transform: none,
|
|
127
|
+
button-text-label-text-weight: map.get($system, label-small-weight),
|
|
128
|
+
button-tonal-label-text-font: map.get($system, label-small-font),
|
|
129
|
+
button-tonal-label-text-size: map.get($system, label-small-size),
|
|
130
|
+
button-tonal-label-text-tracking: map.get($system, label-small-tracking),
|
|
131
|
+
button-tonal-label-text-transform: none,
|
|
132
|
+
button-tonal-label-text-weight: map.get($system, label-small-weight),
|
|
133
|
+
),
|
|
134
|
+
density: (
|
|
135
|
+
button-filled-container-height: $height,
|
|
136
|
+
button-filled-touch-target-display: $touch-target-display,
|
|
137
|
+
button-outlined-container-height: $height,
|
|
138
|
+
button-outlined-touch-target-display: $touch-target-display,
|
|
139
|
+
button-protected-container-height: $height,
|
|
140
|
+
button-protected-touch-target-display: $touch-target-display,
|
|
141
|
+
button-text-container-height: $height,
|
|
142
|
+
button-text-touch-target-display: $touch-target-display,
|
|
143
|
+
button-tonal-container-height: $height,
|
|
144
|
+
button-tonal-touch-target-display: $touch-target-display,
|
|
145
|
+
),
|
|
104
146
|
);
|
|
105
147
|
}
|
|
106
148
|
|
|
@@ -120,7 +162,7 @@
|
|
|
120
162
|
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
|
|
121
163
|
button-filled-state-layer-color: map.get($system, on-primary),
|
|
122
164
|
button-outlined-label-text-color: map.get($system, primary),
|
|
123
|
-
button-outlined-outline-color: map.get(
|
|
165
|
+
button-outlined-outline-color: map.get($system, outline),
|
|
124
166
|
button-outlined-ripple-color: m3-utils.color-with-opacity(
|
|
125
167
|
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
126
168
|
button-outlined-state-layer-color: map.get($system, primary),
|
|
@@ -140,68 +182,3 @@
|
|
|
140
182
|
button-tonal-state-layer-color: map.get($system, on-primary),
|
|
141
183
|
);
|
|
142
184
|
}
|
|
143
|
-
|
|
144
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
145
|
-
@function get-typography-tokens($theme) {
|
|
146
|
-
$font-family: inspection.get-theme-typography($theme, button, font-family);
|
|
147
|
-
$font-size: inspection.get-theme-typography($theme, button, font-size);
|
|
148
|
-
$font-weight: inspection.get-theme-typography($theme, button, font-weight);
|
|
149
|
-
$letter-spacing: inspection.get-theme-typography($theme, button, letter-spacing);
|
|
150
|
-
$text-transform: none;
|
|
151
|
-
|
|
152
|
-
@return (
|
|
153
|
-
button-filled-label-text-font: $font-family,
|
|
154
|
-
button-filled-label-text-size: $font-size,
|
|
155
|
-
button-filled-label-text-tracking: $letter-spacing,
|
|
156
|
-
button-filled-label-text-transform: none,
|
|
157
|
-
button-filled-label-text-weight: $font-weight,
|
|
158
|
-
button-outlined-label-text-font: $font-family,
|
|
159
|
-
button-outlined-label-text-size: $font-size,
|
|
160
|
-
button-outlined-label-text-tracking: $letter-spacing,
|
|
161
|
-
button-outlined-label-text-transform: none,
|
|
162
|
-
button-outlined-label-text-weight: $font-weight,
|
|
163
|
-
button-protected-label-text-font: $font-family,
|
|
164
|
-
button-protected-label-text-size: $font-size,
|
|
165
|
-
button-protected-label-text-tracking: $letter-spacing,
|
|
166
|
-
button-protected-label-text-transform: none,
|
|
167
|
-
button-protected-label-text-weight: $font-weight,
|
|
168
|
-
button-text-label-text-font: $font-family,
|
|
169
|
-
button-text-label-text-size: $font-size,
|
|
170
|
-
button-text-label-text-tracking: $letter-spacing,
|
|
171
|
-
button-text-label-text-transform: none,
|
|
172
|
-
button-text-label-text-weight: $font-weight,
|
|
173
|
-
button-tonal-label-text-font: $font-family,
|
|
174
|
-
button-tonal-label-text-size: $font-size,
|
|
175
|
-
button-tonal-label-text-tracking: $letter-spacing,
|
|
176
|
-
button-tonal-label-text-transform: none,
|
|
177
|
-
button-tonal-label-text-weight: $font-weight,
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
182
|
-
@function get-density-tokens($theme) {
|
|
183
|
-
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
184
|
-
$scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
185
|
-
$sizes: (
|
|
186
|
-
0: 36px,
|
|
187
|
-
-1: 32px,
|
|
188
|
-
-2: 28px,
|
|
189
|
-
-3: 24px,
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
$height: map.get($sizes, $scale);
|
|
193
|
-
$touch-target-display: if($scale < -1, none, block);
|
|
194
|
-
|
|
195
|
-
@return (
|
|
196
|
-
button-filled-container-height: $height,
|
|
197
|
-
button-filled-touch-target-display: $touch-target-display,
|
|
198
|
-
button-outlined-container-height: $height,
|
|
199
|
-
button-outlined-touch-target-display: $touch-target-display,
|
|
200
|
-
button-protected-container-height: $height,
|
|
201
|
-
button-protected-touch-target-display: $touch-target-display,
|
|
202
|
-
button-text-container-height: $height,
|
|
203
|
-
button-text-touch-target-display: $touch-target-display,
|
|
204
|
-
button-tonal-container-height: $height,
|
|
205
|
-
button-tonal-touch-target-display: $touch-target-display,
|
|
206
|
-
);
|
|
207
|
-
}
|
package/button/_m2-fab.scss
CHANGED
|
@@ -1,63 +1,75 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
2
3
|
@use '../core/tokens/m2-utils';
|
|
3
4
|
@use '../core/tokens/m3-utils';
|
|
4
5
|
@use '../core/theming/theming';
|
|
5
6
|
@use '../core/theming/inspection';
|
|
6
7
|
@use '../core/style/elevation';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
// but may be in a future version of the theming API.
|
|
10
|
-
@function get-unthemable-tokens() {
|
|
11
|
-
@return (
|
|
12
|
-
fab-container-elevation-shadow: elevation.get-box-shadow(6),
|
|
13
|
-
fab-container-shape: 50%,
|
|
14
|
-
fab-extended-container-elevation-shadow: elevation.get-box-shadow(6),
|
|
15
|
-
fab-extended-container-height: 48px,
|
|
16
|
-
fab-extended-container-shape: 24px,
|
|
17
|
-
fab-extended-focus-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
18
|
-
fab-extended-hover-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
19
|
-
fab-extended-pressed-container-elevation-shadow: elevation.get-box-shadow(12),
|
|
20
|
-
fab-focus-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
21
|
-
fab-hover-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
22
|
-
fab-pressed-container-elevation-shadow: elevation.get-box-shadow(12),
|
|
23
|
-
fab-small-container-elevation-shadow: elevation.get-box-shadow(6),
|
|
24
|
-
fab-small-container-shape: 50%,
|
|
25
|
-
fab-small-focus-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
26
|
-
fab-small-hover-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
27
|
-
fab-small-pressed-container-elevation-shadow: elevation.get-box-shadow(12),
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
32
|
-
@function get-color-tokens($theme) {
|
|
9
|
+
@function get-tokens($theme) {
|
|
33
10
|
$system: m2-utils.get-system($theme);
|
|
34
|
-
|
|
11
|
+
// TODO: Use system colors instead of checking theme type
|
|
12
|
+
$is-dark: false;
|
|
13
|
+
@if (meta.type-of($theme) == map and map.get($theme, color)) {
|
|
14
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
15
|
+
}
|
|
35
16
|
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
36
17
|
$disabled-container : m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
18
|
+
$density-scale: theming.clamp-density(map.get($system, density-scale), -3);
|
|
37
19
|
|
|
38
20
|
@return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
21
|
+
base: (
|
|
22
|
+
fab-container-elevation-shadow: elevation.get-box-shadow(6),
|
|
23
|
+
fab-container-shape: 50%,
|
|
24
|
+
fab-extended-container-elevation-shadow: elevation.get-box-shadow(6),
|
|
25
|
+
fab-extended-container-height: 48px,
|
|
26
|
+
fab-extended-container-shape: 24px,
|
|
27
|
+
fab-extended-focus-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
28
|
+
fab-extended-hover-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
29
|
+
fab-extended-pressed-container-elevation-shadow: elevation.get-box-shadow(12),
|
|
30
|
+
fab-focus-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
31
|
+
fab-hover-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
32
|
+
fab-pressed-container-elevation-shadow: elevation.get-box-shadow(12),
|
|
33
|
+
fab-small-container-elevation-shadow: elevation.get-box-shadow(6),
|
|
34
|
+
fab-small-container-shape: 50%,
|
|
35
|
+
fab-small-focus-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
36
|
+
fab-small-hover-container-elevation-shadow: elevation.get-box-shadow(8),
|
|
37
|
+
fab-small-pressed-container-elevation-shadow: elevation.get-box-shadow(12),
|
|
38
|
+
),
|
|
39
|
+
color: (
|
|
40
|
+
fab-container-color: map.get($system, surface),
|
|
41
|
+
fab-disabled-state-container-color: $disabled-container,
|
|
42
|
+
fab-disabled-state-foreground-color: $disabled,
|
|
43
|
+
fab-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
44
|
+
fab-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
45
|
+
fab-foreground-color: map.get($system, on-surface),
|
|
46
|
+
fab-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
47
|
+
fab-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
48
|
+
fab-ripple-color: m3-utils.color-with-opacity(
|
|
49
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
50
|
+
fab-small-container-color: map.get($system, surface),
|
|
51
|
+
fab-small-disabled-state-container-color: $disabled-container,
|
|
52
|
+
fab-small-disabled-state-foreground-color: $disabled,
|
|
53
|
+
fab-small-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
54
|
+
fab-small-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
55
|
+
fab-small-foreground-color: map.get($system, on-surface),
|
|
56
|
+
fab-small-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
57
|
+
fab-small-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
58
|
+
fab-small-ripple-color: m3-utils.color-with-opacity(
|
|
59
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
60
|
+
fab-small-state-layer-color: map.get($system, on-surface),
|
|
61
|
+
fab-state-layer-color: map.get($system, on-surface),
|
|
62
|
+
),
|
|
63
|
+
typography: (
|
|
64
|
+
fab-extended-label-text-font: map.get($system, label-small-font),
|
|
65
|
+
fab-extended-label-text-size: map.get($system, label-small-size),
|
|
66
|
+
fab-extended-label-text-tracking: map.get($system, label-small-tracking),
|
|
67
|
+
fab-extended-label-text-weight: map.get($system, label-small-weight)
|
|
68
|
+
),
|
|
69
|
+
density: (
|
|
70
|
+
fab-small-touch-target-display: if($density-scale < -1, none, block),
|
|
71
|
+
fab-touch-target-display: if($density-scale < -1, none, block),
|
|
72
|
+
),
|
|
61
73
|
);
|
|
62
74
|
}
|
|
63
75
|
|
|
@@ -79,24 +91,3 @@
|
|
|
79
91
|
fab-state-layer-color: map.get($system, on-primary),
|
|
80
92
|
);
|
|
81
93
|
}
|
|
82
|
-
|
|
83
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
84
|
-
@function get-typography-tokens($theme) {
|
|
85
|
-
@return (
|
|
86
|
-
fab-extended-label-text-font: inspection.get-theme-typography($theme, button, font-family),
|
|
87
|
-
fab-extended-label-text-size: inspection.get-theme-typography($theme, button, font-size),
|
|
88
|
-
fab-extended-label-text-tracking:
|
|
89
|
-
inspection.get-theme-typography($theme, button, letter-spacing),
|
|
90
|
-
fab-extended-label-text-weight: inspection.get-theme-typography($theme, button, font-weight)
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
95
|
-
@function get-density-tokens($theme) {
|
|
96
|
-
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
97
|
-
|
|
98
|
-
@return (
|
|
99
|
-
fab-small-touch-target-display: if($density-scale < -1, none, block),
|
|
100
|
-
fab-touch-target-display: if($density-scale < -1, none, block),
|
|
101
|
-
);
|
|
102
|
-
}
|
|
@@ -1,33 +1,41 @@
|
|
|
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() {
|
|
10
|
-
@return (
|
|
11
|
-
icon-button-icon-size: 24px,
|
|
12
|
-
icon-button-container-shape: 50%,
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
17
|
-
@function get-color-tokens($theme) {
|
|
6
|
+
@function get-tokens($theme) {
|
|
18
7
|
$system: m2-utils.get-system($theme);
|
|
19
|
-
$
|
|
8
|
+
$density-scale: theming.clamp-density(map.get($system, density-scale), -3);
|
|
20
9
|
|
|
21
10
|
@return (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
base: (
|
|
12
|
+
icon-button-icon-size: 24px,
|
|
13
|
+
icon-button-container-shape: 50%,
|
|
14
|
+
),
|
|
15
|
+
color: (
|
|
16
|
+
icon-button-disabled-icon-color:
|
|
17
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
18
|
+
icon-button-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
19
|
+
icon-button-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
20
|
+
icon-button-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
21
|
+
icon-button-icon-color: inherit,
|
|
22
|
+
icon-button-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
23
|
+
icon-button-ripple-color: m3-utils.color-with-opacity(
|
|
24
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
25
|
+
icon-button-state-layer-color: map.get($system, on-surface),
|
|
26
|
+
),
|
|
27
|
+
typography: (),
|
|
28
|
+
density: (
|
|
29
|
+
icon-button-touch-target-display: if($density-scale < -1, none, block),
|
|
30
|
+
icon-button-state-layer-size: map.get((
|
|
31
|
+
0: 48px,
|
|
32
|
+
-1: 44px,
|
|
33
|
+
-2: 40px,
|
|
34
|
+
-3: 36px,
|
|
35
|
+
-4: 32px,
|
|
36
|
+
-5: 28px,
|
|
37
|
+
), $density-scale)
|
|
38
|
+
),
|
|
31
39
|
);
|
|
32
40
|
}
|
|
33
41
|
|
|
@@ -43,31 +51,3 @@
|
|
|
43
51
|
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
44
52
|
);
|
|
45
53
|
}
|
|
46
|
-
|
|
47
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
48
|
-
@function get-typography-tokens($theme) {
|
|
49
|
-
@return ();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
53
|
-
@function get-density-tokens($theme, $exclude: ()) {
|
|
54
|
-
$scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
55
|
-
|
|
56
|
-
$tokens: (
|
|
57
|
-
icon-button-touch-target-display: if($scale < -1, none, block),
|
|
58
|
-
icon-button-state-layer-size: map.get((
|
|
59
|
-
0: 48px,
|
|
60
|
-
-1: 44px,
|
|
61
|
-
-2: 40px,
|
|
62
|
-
-3: 36px,
|
|
63
|
-
-4: 32px,
|
|
64
|
-
-5: 28px,
|
|
65
|
-
), $scale)
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
@each $token in $exclude {
|
|
69
|
-
$tokens: map.remove($tokens, $token);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@return $tokens;
|
|
73
|
-
}
|
package/button/_m3-button.scss
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
@use '../core/tokens/m3';
|
|
5
5
|
@use '../core/style/elevation';
|
|
6
6
|
@use '../core/theming/theming';
|
|
7
|
-
@use '../core/theming/inspection';
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
/// Generates custom tokens for the button.
|
|
@@ -141,7 +140,7 @@
|
|
|
141
140
|
button-tonal-label-text-tracking: map.get($system, label-large-tracking),
|
|
142
141
|
button-tonal-label-text-weight: map.get($system, label-large-weight),
|
|
143
142
|
),
|
|
144
|
-
density: get-density-tokens(map.get($
|
|
143
|
+
density: get-density-tokens(map.get($system, density-scale)),
|
|
145
144
|
);
|
|
146
145
|
}
|
|
147
146
|
|
package/button/_m3-fab.scss
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@use '../core/tokens/m3-utils';
|
|
4
4
|
@use '../core/style/elevation';
|
|
5
5
|
@use '../core/theming/theming';
|
|
6
|
-
@use '../core/theming/inspection';
|
|
7
6
|
@use '../core/tokens/m3';
|
|
8
7
|
|
|
9
8
|
/// Generates custom tokens for the mat-fab.
|
|
@@ -72,7 +71,7 @@
|
|
|
72
71
|
fab-extended-label-text-tracking: map.get($system, label-large-tracking),
|
|
73
72
|
fab-extended-label-text-weight: map.get($system, label-large-weight),
|
|
74
73
|
),
|
|
75
|
-
density: get-density-tokens(map.get($
|
|
74
|
+
density: get-density-tokens(map.get($system, density-scale)),
|
|
76
75
|
);
|
|
77
76
|
|
|
78
77
|
@return $tokens;
|
|
@@ -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-icon-button.
|
|
@@ -35,7 +34,7 @@
|
|
|
35
34
|
icon-button-state-layer-color: map.get($system, on-surface-variant),
|
|
36
35
|
),
|
|
37
36
|
typography: (),
|
|
38
|
-
density: get-density-tokens(map.get($
|
|
37
|
+
density: get-density-tokens(map.get($system, density-scale)),
|
|
39
38
|
);
|
|
40
39
|
|
|
41
40
|
@return $tokens;
|
|
@@ -18,6 +18,7 @@ interface ButtonHarnessFilters extends BaseHarnessFilters {
|
|
|
18
18
|
|
|
19
19
|
/** Harness for interacting with a mat-button in tests. */
|
|
20
20
|
declare class MatButtonHarness extends ContentContainerComponentHarness {
|
|
21
|
+
/** Selector for the harness. */
|
|
21
22
|
static hostSelector: string;
|
|
22
23
|
/**
|
|
23
24
|
* Gets a `HarnessPredicate` that can be used to search for a button with specific attributes.
|