@angular/material 20.0.3 → 20.1.0-next.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 +0 -1
- package/autocomplete/_m2-autocomplete.scss +1 -14
- package/badge/_badge-theme.scss +2 -2
- package/badge/_m2-badge.scss +13 -34
- package/bottom-sheet/_m2-bottom-sheet.scss +2 -15
- package/button/_button-theme.scss +2 -2
- package/button/_fab-theme.scss +2 -2
- package/button/_icon-button-theme.scss +2 -2
- package/button/_m2-button.scss +59 -108
- package/button/_m2-fab.scss +28 -60
- package/button/_m2-icon-button.scss +12 -26
- package/button-toggle/_button-toggle-theme.scss +2 -1
- package/button-toggle/_m2-button-toggle.scss +24 -49
- package/card/_m2-card.scss +9 -18
- package/checkbox/_checkbox-theme.scss +4 -3
- package/checkbox/_m2-checkbox.scss +31 -59
- package/chips/_chips-theme.scss +7 -4
- package/chips/_m2-chip.scss +19 -27
- package/chips/index.d.ts +56 -4
- package/chips/testing/index.d.ts +23 -2
- package/core/_m2-app.scss +6 -19
- package/core/m2/_theming.scss +55 -9
- package/core/option/_m2-optgroup.scss +1 -14
- package/core/option/_m2-option.scss +8 -16
- package/core/option/_option-theme.scss +3 -3
- package/core/ripple/_m2-ripple.scss +0 -13
- package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +10 -20
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +3 -3
- package/core/style/_private.scss +6 -9
- package/core/style/_sass-utils.scss +0 -29
- package/core/tokens/_m2-utils.scss +20 -42
- package/core/tokens/_m3-system.scss +9 -11
- package/{date-range-input-harness.d-CaEyN8dT.d.ts → date-range-input-harness.d-CJ4r85Uf.d.ts} +7 -4
- package/datepicker/_datepicker-theme.scss +10 -6
- package/datepicker/_m2-datepicker.scss +32 -41
- package/datepicker/index.d.ts +1 -1
- package/datepicker/testing/index.d.ts +3 -3
- package/dialog/_m2-dialog.scss +3 -24
- package/divider/_m2-divider.scss +1 -14
- package/expansion/_m2-expansion.scss +15 -25
- package/fesm2022/chips/testing.mjs +26 -1
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +131 -13
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/{date-range-input-harness-Bp1T4oUe.mjs → date-range-input-harness-DEyfkeOs.mjs} +32 -4
- package/fesm2022/date-range-input-harness-DEyfkeOs.mjs.map +1 -0
- package/fesm2022/datepicker/testing.mjs +3 -3
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/form-field/testing/control.mjs +26 -1
- package/fesm2022/form-field/testing/control.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs +4 -4
- package/fesm2022/input/testing.mjs +7 -4
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/{input-harness-oQzj5EsQ.mjs → input-harness-C5Msdc4-.mjs} +6 -3
- package/fesm2022/input-harness-C5Msdc4-.mjs.map +1 -0
- package/fesm2022/menu.mjs +11 -2
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs +2 -3
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/select/testing.mjs +8 -5
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +2 -2
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/stepper.mjs +2 -2
- package/fesm2022/stepper.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +2 -2
- package/form-field/_m2-form-field.scss +58 -92
- package/form-field/testing/control/index.d.ts +8 -5
- package/form-field/testing/index.d.ts +5 -5
- package/form-field-control-harness.d-BLvFBy6v.d.ts +18 -0
- package/grid-list/_m2-grid-list.scss +0 -13
- package/icon/_m2-icon.scss +0 -13
- package/input/testing/index.d.ts +5 -4
- package/{input-harness.d-8fkAAbu2.d.ts → input-harness.d-DVI6ttzl.d.ts} +4 -4
- package/list/_list-theme.scss +10 -5
- package/list/_m2-list.scss +17 -31
- package/menu/_m2-menu.scss +4 -18
- package/menu/index.d.ts +2 -0
- package/package.json +6 -6
- package/paginator/_m2-paginator.scss +6 -18
- package/paginator/testing/index.d.ts +2 -3
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/progress-bar/_m2-progress-bar.scss +11 -20
- package/progress-bar/_progress-bar-theme.scss +2 -2
- package/progress-spinner/_m2-progress-spinner.scss +7 -15
- package/progress-spinner/_progress-spinner-theme.scss +2 -2
- package/radio/_m2-radio.scss +21 -32
- package/radio/_m3-radio.scss +1 -1
- package/radio/_radio-theme.scss +6 -3
- package/schematics/ng-add/index.js +2 -2
- package/select/_m2-select.scss +12 -35
- package/select/testing/index.d.ts +5 -6
- package/sidenav/_m2-sidenav.scss +10 -20
- package/slide-toggle/_m2-slide-toggle.scss +13 -20
- package/slide-toggle/_slide-toggle-theme.scss +3 -2
- package/slider/_m2-slider.scss +5 -18
- package/snack-bar/_m2-snack-bar.scss +6 -22
- package/sort/_m2-sort.scss +1 -34
- package/stepper/_m2-stepper.scss +23 -34
- package/stepper/_m3-stepper.scss +2 -2
- package/stepper/_stepper-theme.scss +2 -2
- package/table/_m2-table.scss +4 -17
- package/tabs/_m2-tabs.scss +16 -27
- package/tabs/_tabs-theme.scss +4 -4
- package/timepicker/_m2-timepicker.scss +1 -14
- package/toolbar/_m2-toolbar.scss +2 -15
- package/tooltip/_m2-tooltip.scss +4 -14
- package/tree/_m2-tree.scss +2 -17
- package/core/tokens/_m2-tokens.scss +0 -131
- package/fesm2022/date-range-input-harness-Bp1T4oUe.mjs.map +0 -1
- package/fesm2022/input-harness-oQzj5EsQ.mjs.map +0 -1
package/_index.scss
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
@forward './core/theming/theming' as private-* show private-clamp-density;
|
|
18
18
|
@forward './core/typography/typography' show typography-hierarchy;
|
|
19
19
|
@forward './core/typography/typography-utils' show font-shorthand;
|
|
20
|
-
@forward 'core/tokens/m2-tokens' show m2-tokens-from-theme;
|
|
21
20
|
@forward './core/tokens/m3-system' show system-level-colors,
|
|
22
21
|
system-level-typography, system-level-elevation, system-level-shape,
|
|
23
22
|
system-level-motion, system-level-state, theme, theme-overrides;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
@use '../core/tokens/m2-utils';
|
|
2
1
|
@use '../core/theming/inspection';
|
|
3
2
|
@use '../core/style/elevation';
|
|
4
|
-
@use '../core/style/sass-utils';
|
|
5
3
|
|
|
6
4
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
7
5
|
// but may be in a future version of the theming API.
|
|
@@ -15,7 +13,7 @@
|
|
|
15
13
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
16
14
|
@function get-color-tokens($theme) {
|
|
17
15
|
@return (
|
|
18
|
-
autocomplete-background-color: inspection.get-theme-color($theme,
|
|
16
|
+
autocomplete-background-color: inspection.get-theme-color($theme, system, surface)
|
|
19
17
|
);
|
|
20
18
|
}
|
|
21
19
|
|
|
@@ -28,14 +26,3 @@
|
|
|
28
26
|
@function get-density-tokens($theme) {
|
|
29
27
|
@return ();
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
33
|
-
// This is used to create token slots.
|
|
34
|
-
@function get-token-slots() {
|
|
35
|
-
@return sass-utils.deep-merge-all(
|
|
36
|
-
get-unthemable-tokens(),
|
|
37
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
38
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
39
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
40
|
-
);
|
|
41
|
-
}
|
package/badge/_badge-theme.scss
CHANGED
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
|
|
39
39
|
.mat-badge-accent {
|
|
40
40
|
@include token-utils.create-token-values-mixed(
|
|
41
|
-
m2-badge.private-get-color-palette-color-tokens($theme,
|
|
41
|
+
m2-badge.private-get-color-palette-color-tokens($theme, secondary)
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.mat-badge-warn {
|
|
46
46
|
@include token-utils.create-token-values-mixed(
|
|
47
|
-
m2-badge.private-get-color-palette-color-tokens($theme,
|
|
47
|
+
m2-badge.private-get-color-palette-color-tokens($theme, error)
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
}
|
package/badge/_m2-badge.scss
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
@use 'sass:meta';
|
|
2
1
|
@use 'sass:map';
|
|
3
2
|
@use 'sass:math';
|
|
4
|
-
@use 'sass:color';
|
|
5
|
-
@use '../core/tokens/m2-utils';
|
|
6
3
|
@use '../core/theming/inspection';
|
|
7
|
-
@use '../core/
|
|
4
|
+
@use '../core/tokens/m2-utils';
|
|
5
|
+
@use '../core/tokens/m3-utils';
|
|
8
6
|
|
|
9
7
|
$_default-size: 22px;
|
|
10
8
|
$_small-size: $_default-size - 6px;
|
|
@@ -43,32 +41,24 @@ $_large-size: $_default-size + 6px;
|
|
|
43
41
|
|
|
44
42
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
45
43
|
@function get-color-tokens($theme) {
|
|
44
|
+
$system: m2-utils.get-system($theme);
|
|
45
|
+
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
46
|
+
$disabled-container : m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
46
47
|
$primary-color-tokens: private-get-color-palette-color-tokens($theme, primary);
|
|
47
|
-
$app-background: inspection.get-theme-color($theme, background, background);
|
|
48
|
-
$disabled-background: inspection.get-theme-color($theme, foreground, disabled-button);
|
|
49
|
-
|
|
50
|
-
// The disabled color usually has some kind of opacity, but because the badge is overlayed
|
|
51
|
-
// on top of something else, it won't look good if it's opaque. If it is a color *type*,
|
|
52
|
-
// we convert it into a solid color by taking the opacity from the rgba value and using
|
|
53
|
-
// the value to determine the percentage of the background to put into foreground when
|
|
54
|
-
// mixing the colors together.
|
|
55
|
-
@if (meta.type-of($disabled-background) == color and meta.type-of($app-background) == color) {
|
|
56
|
-
$badge-opacity: color.opacity($disabled-background);
|
|
57
|
-
$disabled-background: color.mix($app-background,
|
|
58
|
-
rgba($disabled-background, 1), (1 - $badge-opacity) * 100%);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
48
|
@return map.merge($primary-color-tokens, (
|
|
62
|
-
badge-disabled-state-background-color: $disabled-
|
|
63
|
-
badge-disabled-state-text-color:
|
|
49
|
+
badge-disabled-state-background-color: $disabled-container,
|
|
50
|
+
badge-disabled-state-text-color: $disabled,
|
|
64
51
|
));
|
|
65
52
|
}
|
|
66
53
|
|
|
67
54
|
// Generates the tokens used to theme the badge based on a palette.
|
|
68
|
-
@function private-get-color-palette-color-tokens($theme, $
|
|
55
|
+
@function private-get-color-palette-color-tokens($theme, $color-variant) {
|
|
56
|
+
$system: m2-utils.get-system($theme);
|
|
57
|
+
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
58
|
+
|
|
69
59
|
@return (
|
|
70
|
-
badge-background-color:
|
|
71
|
-
badge-text-color:
|
|
60
|
+
badge-background-color: map.get($system, primary),
|
|
61
|
+
badge-text-color: map.get($system, on-primary),
|
|
72
62
|
);
|
|
73
63
|
}
|
|
74
64
|
|
|
@@ -94,14 +84,3 @@ $_large-size: $_default-size + 6px;
|
|
|
94
84
|
@function get-density-tokens($theme) {
|
|
95
85
|
@return ();
|
|
96
86
|
}
|
|
97
|
-
|
|
98
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
99
|
-
// This is used to create token slots.
|
|
100
|
-
@function get-token-slots() {
|
|
101
|
-
@return sass-utils.deep-merge-all(
|
|
102
|
-
get-unthemable-tokens(),
|
|
103
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
104
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
105
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
106
|
-
);
|
|
107
|
-
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
@use '../core/tokens/m2-utils';
|
|
2
1
|
@use '../core/theming/inspection';
|
|
3
|
-
@use '../core/style/sass-utils';
|
|
4
2
|
|
|
5
3
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
6
4
|
// but may be in a future version of the theming API.
|
|
@@ -14,8 +12,8 @@
|
|
|
14
12
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
15
13
|
@function get-color-tokens($theme) {
|
|
16
14
|
@return (
|
|
17
|
-
bottom-sheet-container-text-color: inspection.get-theme-color($theme,
|
|
18
|
-
bottom-sheet-container-background-color: inspection.get-theme-color($theme,
|
|
15
|
+
bottom-sheet-container-text-color: inspection.get-theme-color($theme, system, on-surface),
|
|
16
|
+
bottom-sheet-container-background-color: inspection.get-theme-color($theme, system, surface),
|
|
19
17
|
);
|
|
20
18
|
}
|
|
21
19
|
|
|
@@ -37,14 +35,3 @@
|
|
|
37
35
|
@function get-density-tokens($theme) {
|
|
38
36
|
@return ();
|
|
39
37
|
}
|
|
40
|
-
|
|
41
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
42
|
-
// This is used to create token slots.
|
|
43
|
-
@function get-token-slots() {
|
|
44
|
-
@return sass-utils.deep-merge-all(
|
|
45
|
-
get-unthemable-tokens(),
|
|
46
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
47
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
48
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
49
|
-
);
|
|
50
|
-
}
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
&.mat-accent {
|
|
57
|
-
@include _m2-button-variant($theme,
|
|
57
|
+
@include _m2-button-variant($theme, secondary);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
&.mat-warn {
|
|
61
|
-
@include _m2-button-variant($theme,
|
|
61
|
+
@include _m2-button-variant($theme, error);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
}
|
package/button/_fab-theme.scss
CHANGED
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
&.mat-accent {
|
|
49
|
-
@include _m2-icon-button-variant($theme,
|
|
49
|
+
@include _m2-icon-button-variant($theme, secondary);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
&.mat-warn {
|
|
53
|
-
@include _m2-icon-button-variant($theme,
|
|
53
|
+
@include _m2-icon-button-variant($theme, error);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
package/button/_m2-button.scss
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
@use 'sass:meta';
|
|
2
1
|
@use 'sass:map';
|
|
3
2
|
@use '../core/tokens/m2-utils';
|
|
3
|
+
@use '../core/tokens/m3-utils';
|
|
4
4
|
@use '../core/theming/theming';
|
|
5
5
|
@use '../core/theming/inspection';
|
|
6
|
-
@use '../core/style/sass-utils';
|
|
7
6
|
@use '../core/style/elevation';
|
|
8
7
|
|
|
9
8
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
@@ -43,134 +42,97 @@
|
|
|
43
42
|
|
|
44
43
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
45
44
|
@function get-color-tokens($theme) {
|
|
45
|
+
$system: m2-utils.get-system($theme);
|
|
46
46
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
$outline: if(m2-utils.$private-is-internal-build,
|
|
51
|
-
rgba(if($is-dark, #fff, #000), 0.12),
|
|
52
|
-
inspection.get-theme-color($theme, foreground, divider)
|
|
53
|
-
);
|
|
47
|
+
$outline: inspection.get-theme-color($theme, system, outline);
|
|
48
|
+
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
49
|
+
$disabled-container : m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
54
50
|
|
|
55
51
|
@return (
|
|
56
|
-
button-filled-container-color:
|
|
57
|
-
button-filled-disabled-container-color:
|
|
58
|
-
|
|
59
|
-
button-filled-disabled-label-text-color:
|
|
60
|
-
inspection.get-theme-color($theme, foreground, disabled-button, if($is-dark, 0.5, 0.38)),
|
|
52
|
+
button-filled-container-color: map.get($system, surface),
|
|
53
|
+
button-filled-disabled-container-color: $disabled-container,
|
|
54
|
+
button-filled-disabled-label-text-color: $disabled,
|
|
61
55
|
button-filled-disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
62
|
-
button-filled-focus-state-layer-opacity:
|
|
63
|
-
button-filled-hover-state-layer-opacity:
|
|
64
|
-
button-filled-label-text-color: inspection.get-theme-color($theme, foreground,
|
|
65
|
-
button-filled-pressed-state-layer-opacity:
|
|
56
|
+
button-filled-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
57
|
+
button-filled-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
58
|
+
button-filled-label-text-color: inspection.get-theme-color($theme, foreground, base),
|
|
59
|
+
button-filled-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
66
60
|
button-filled-ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
|
|
67
61
|
button-filled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
68
|
-
button-outlined-disabled-label-text-color:
|
|
69
|
-
inspection.get-theme-color($theme, foreground, disabled-button, if($is-dark, 0.5, 0.38)),
|
|
62
|
+
button-outlined-disabled-label-text-color: $disabled,
|
|
70
63
|
button-outlined-disabled-outline-color: $outline,
|
|
71
64
|
button-outlined-disabled-state-layer-color:
|
|
72
65
|
inspection.get-theme-color($theme, foreground, base),
|
|
73
|
-
button-outlined-focus-state-layer-opacity:
|
|
74
|
-
button-outlined-hover-state-layer-opacity:
|
|
75
|
-
button-outlined-label-text-color: inspection.get-theme-color($theme, foreground,
|
|
66
|
+
button-outlined-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
67
|
+
button-outlined-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
68
|
+
button-outlined-label-text-color: inspection.get-theme-color($theme, foreground, base),
|
|
76
69
|
button-outlined-outline-color: $outline,
|
|
77
|
-
button-outlined-pressed-state-layer-opacity:
|
|
70
|
+
button-outlined-pressed-state-layer-opacity:
|
|
71
|
+
map.get($system, pressed-state-layer-opacity),
|
|
78
72
|
button-outlined-ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
|
|
79
73
|
button-outlined-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
80
|
-
button-protected-container-color:
|
|
81
|
-
button-protected-disabled-container-color:
|
|
82
|
-
|
|
83
|
-
button-protected-disabled-label-text-color:
|
|
84
|
-
inspection.get-theme-color($theme, foreground, disabled-button, if($is-dark, 0.5, 0.38)),
|
|
74
|
+
button-protected-container-color: map.get($system, surface),
|
|
75
|
+
button-protected-disabled-container-color: $disabled-container,
|
|
76
|
+
button-protected-disabled-label-text-color: $disabled,
|
|
85
77
|
button-protected-disabled-state-layer-color:
|
|
86
78
|
inspection.get-theme-color($theme, foreground, base),
|
|
87
|
-
button-protected-focus-state-layer-opacity:
|
|
88
|
-
button-protected-hover-state-layer-opacity:
|
|
89
|
-
button-protected-label-text-color: inspection.get-theme-color($theme, foreground,
|
|
90
|
-
button-protected-pressed-state-layer-opacity:
|
|
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: inspection.get-theme-color($theme, foreground, base),
|
|
82
|
+
button-protected-pressed-state-layer-opacity:
|
|
83
|
+
map.get($system, pressed-state-layer-opacity),
|
|
91
84
|
button-protected-ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
|
|
92
85
|
button-protected-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
93
|
-
button-text-disabled-label-text-color:
|
|
94
|
-
inspection.get-theme-color($theme, foreground, disabled-button, if($is-dark, 0.5, 0.38)),
|
|
86
|
+
button-text-disabled-label-text-color: $disabled,
|
|
95
87
|
button-text-disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
96
|
-
button-text-focus-state-layer-opacity:
|
|
97
|
-
button-text-hover-state-layer-opacity:
|
|
98
|
-
button-text-label-text-color: inspection.get-theme-color($theme, foreground,
|
|
99
|
-
button-text-pressed-state-layer-opacity:
|
|
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: inspection.get-theme-color($theme, foreground, base),
|
|
91
|
+
button-text-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
100
92
|
button-text-ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
|
|
101
93
|
button-text-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
102
|
-
button-tonal-container-color:
|
|
103
|
-
button-tonal-disabled-container-color:
|
|
104
|
-
|
|
105
|
-
button-tonal-disabled-label-text-color:
|
|
106
|
-
inspection.get-theme-color($theme, foreground, disabled-button, if($is-dark, 0.5, 0.38)),
|
|
94
|
+
button-tonal-container-color: map.get($system, surface),
|
|
95
|
+
button-tonal-disabled-container-color: $disabled-container,
|
|
96
|
+
button-tonal-disabled-label-text-color: $disabled,
|
|
107
97
|
button-tonal-disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
108
|
-
button-tonal-focus-state-layer-opacity:
|
|
109
|
-
button-tonal-hover-state-layer-opacity:
|
|
110
|
-
button-tonal-label-text-color: inspection.get-theme-color($theme, foreground,
|
|
111
|
-
button-tonal-pressed-state-layer-opacity:
|
|
98
|
+
button-tonal-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
99
|
+
button-tonal-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
100
|
+
button-tonal-label-text-color: inspection.get-theme-color($theme, foreground, base),
|
|
101
|
+
button-tonal-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
112
102
|
button-tonal-ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
|
|
113
103
|
button-tonal-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
114
104
|
);
|
|
115
105
|
}
|
|
116
106
|
|
|
117
107
|
// Generates the mapping for the properties that change based on the button palette color.
|
|
118
|
-
@function private-get-color-palette-color-tokens($theme, $
|
|
119
|
-
$
|
|
120
|
-
$
|
|
121
|
-
$ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1);
|
|
122
|
-
$contrast-color: inspection.get-theme-color($theme, $palette-name, default-contrast);
|
|
123
|
-
$container-color: inspection.get-theme-color($theme, $palette-name, default);
|
|
124
|
-
$label-text-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
|
|
125
|
-
$ripple-opacity: 0.1;
|
|
126
|
-
|
|
127
|
-
// Ideally we would derive all values directly from the theme, but it causes a lot of regressions
|
|
128
|
-
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
|
|
129
|
-
@if (m2-utils.$private-is-internal-build or
|
|
130
|
-
meta.type-of($contrast-color) != 'color') {
|
|
131
|
-
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
132
|
-
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
133
|
-
$contrast-tone: m2-utils.contrast-tone($container-color, $is-dark);
|
|
134
|
-
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
135
|
-
$state-layer-color: $color;
|
|
136
|
-
$ripple-color: rgba($color, 0.1);
|
|
137
|
-
$label-text-color: if($contrast-tone == 'dark', #000, #fff);
|
|
138
|
-
}
|
|
108
|
+
@function private-get-color-palette-color-tokens($theme, $color-variant) {
|
|
109
|
+
$system: m2-utils.get-system($theme);
|
|
110
|
+
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
139
111
|
|
|
140
112
|
// outlined-outline-color:
|
|
141
113
|
// TODO: we shouldn't have to set this since it's the same as the non-palette version, however
|
|
142
114
|
// there are a bunch of tests internally that depend on it. We should remove this and clean
|
|
143
115
|
// up the screenshots separately.
|
|
144
116
|
@return (
|
|
145
|
-
button-filled-container-color: $
|
|
146
|
-
button-filled-label-text-color: $
|
|
147
|
-
button-filled-ripple-color:
|
|
148
|
-
button-filled-state-layer-color: $
|
|
149
|
-
button-outlined-label-text-color:
|
|
117
|
+
button-filled-container-color: map.get($system, primary),
|
|
118
|
+
button-filled-label-text-color: map.get($system, on-primary),
|
|
119
|
+
button-filled-ripple-color: m3-utils.color-with-opacity(map.get($system, on-primary), 10%),
|
|
120
|
+
button-filled-state-layer-color: map.get($system, on-primary),
|
|
121
|
+
button-outlined-label-text-color: map.get($system, primary),
|
|
150
122
|
button-outlined-outline-color: map.get(get-color-tokens($theme), button-outlined-outline-color),
|
|
151
|
-
button-outlined-ripple-color:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
button-
|
|
157
|
-
button-
|
|
158
|
-
button-
|
|
159
|
-
button-
|
|
160
|
-
button-
|
|
161
|
-
button-
|
|
162
|
-
button-
|
|
163
|
-
|
|
164
|
-
rgba(inspection.get-theme-color($theme, $palette-name), $ripple-opacity),
|
|
165
|
-
inspection.get-theme-color($theme, foreground, base, $ripple-opacity)),
|
|
166
|
-
button-text-state-layer-color: inspection.get-theme-color($theme, $palette-name),
|
|
167
|
-
button-tonal-container-color: inspection.get-theme-color($theme, $palette-name, default),
|
|
168
|
-
button-tonal-label-text-color:
|
|
169
|
-
inspection.get-theme-color($theme, $palette-name, default-contrast, 1),
|
|
170
|
-
button-tonal-ripple-color:
|
|
171
|
-
inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1),
|
|
172
|
-
button-tonal-state-layer-color:
|
|
173
|
-
inspection.get-theme-color($theme, $palette-name, default-contrast, 1),
|
|
123
|
+
button-outlined-ripple-color: m3-utils.color-with-opacity(map.get($system, primary), 10%),
|
|
124
|
+
button-outlined-state-layer-color: map.get($system, primary),
|
|
125
|
+
button-protected-container-color: map.get($system, primary),
|
|
126
|
+
button-protected-label-text-color: map.get($system, on-primary),
|
|
127
|
+
button-protected-ripple-color: m3-utils.color-with-opacity(map.get($system, on-primary), 10%),
|
|
128
|
+
button-protected-state-layer-color: map.get($system, on-primary),
|
|
129
|
+
button-text-label-text-color: map.get($system, primary),
|
|
130
|
+
button-text-ripple-color: m3-utils.color-with-opacity(map.get($system, primary), 10%),
|
|
131
|
+
button-text-state-layer-color: map.get($system, primary),
|
|
132
|
+
button-tonal-container-color: map.get($system, primary),
|
|
133
|
+
button-tonal-label-text-color: map.get($system, on-primary),
|
|
134
|
+
button-tonal-ripple-color: m3-utils.color-with-opacity(map.get($system, on-primary), 10%),
|
|
135
|
+
button-tonal-state-layer-color: map.get($system, on-primary),
|
|
174
136
|
);
|
|
175
137
|
}
|
|
176
138
|
|
|
@@ -238,14 +200,3 @@
|
|
|
238
200
|
button-tonal-touch-target-display: $touch-target-display,
|
|
239
201
|
);
|
|
240
202
|
}
|
|
241
|
-
|
|
242
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
243
|
-
// This is used to create token slots.
|
|
244
|
-
@function get-token-slots() {
|
|
245
|
-
@return sass-utils.deep-merge-all(
|
|
246
|
-
get-unthemable-tokens(),
|
|
247
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
248
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
249
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
250
|
-
);
|
|
251
|
-
}
|
package/button/_m2-fab.scss
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
@use 'sass:
|
|
1
|
+
@use 'sass:map';
|
|
2
2
|
@use '../core/tokens/m2-utils';
|
|
3
|
+
@use '../core/tokens/m3-utils';
|
|
3
4
|
@use '../core/theming/theming';
|
|
4
5
|
@use '../core/theming/inspection';
|
|
5
|
-
@use '../core/style/sass-utils';
|
|
6
6
|
@use '../core/style/elevation';
|
|
7
7
|
|
|
8
8
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
@@ -30,30 +30,29 @@
|
|
|
30
30
|
|
|
31
31
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
32
32
|
@function get-color-tokens($theme) {
|
|
33
|
+
$system: m2-utils.get-system($theme);
|
|
33
34
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
35
|
+
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
36
|
+
$disabled-container : m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
34
37
|
|
|
35
38
|
@return (
|
|
36
|
-
fab-container-color:
|
|
37
|
-
fab-disabled-state-container-color:
|
|
38
|
-
|
|
39
|
-
fab-disabled-state-foreground-color:
|
|
40
|
-
inspection.get-theme-color($theme, foreground, disabled-button, if($is-dark, 0.5, 0.38)),
|
|
39
|
+
fab-container-color: map.get($system, surface),
|
|
40
|
+
fab-disabled-state-container-color: $disabled-container,
|
|
41
|
+
fab-disabled-state-foreground-color: $disabled,
|
|
41
42
|
fab-disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
42
|
-
fab-focus-state-layer-opacity:
|
|
43
|
+
fab-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
43
44
|
fab-foreground-color: inspection.get-theme-color($theme, foreground, base),
|
|
44
|
-
fab-hover-state-layer-opacity:
|
|
45
|
-
fab-pressed-state-layer-opacity:
|
|
45
|
+
fab-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
46
|
+
fab-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
46
47
|
fab-ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
|
|
47
|
-
fab-small-container-color:
|
|
48
|
-
fab-small-disabled-state-container-color:
|
|
49
|
-
|
|
50
|
-
fab-small-disabled-state-foreground-color:
|
|
51
|
-
inspection.get-theme-color($theme, foreground, disabled-button, if($is-dark, 0.5, 0.38)),
|
|
48
|
+
fab-small-container-color: map.get($system, surface),
|
|
49
|
+
fab-small-disabled-state-container-color: $disabled-container,
|
|
50
|
+
fab-small-disabled-state-foreground-color: $disabled,
|
|
52
51
|
fab-small-disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
53
|
-
fab-small-focus-state-layer-opacity:
|
|
52
|
+
fab-small-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
54
53
|
fab-small-foreground-color: inspection.get-theme-color($theme, foreground, base),
|
|
55
|
-
fab-small-hover-state-layer-opacity:
|
|
56
|
-
fab-small-pressed-state-layer-opacity:
|
|
54
|
+
fab-small-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
55
|
+
fab-small-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
57
56
|
fab-small-ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
|
|
58
57
|
fab-small-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
59
58
|
fab-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
@@ -61,39 +60,19 @@
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
// Generates the mapping for the properties that change based on the FAB palette color.
|
|
64
|
-
@function private-get-color-palette-color-tokens($theme, $
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
$foreground-color: null;
|
|
68
|
-
$state-layer-color: null;
|
|
69
|
-
$ripple-color: null;
|
|
70
|
-
$contrast-color: inspection.get-theme-color($theme, $palette-name, default-contrast);
|
|
71
|
-
|
|
72
|
-
@if (m2-utils.$private-is-internal-build or
|
|
73
|
-
meta.type-of($contrast-color) != 'color') {
|
|
74
|
-
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
75
|
-
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
76
|
-
$contrast-tone: m2-utils.contrast-tone($container-color, $is-dark);
|
|
77
|
-
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
78
|
-
$foreground-color: $color;
|
|
79
|
-
$state-layer-color: $color;
|
|
80
|
-
$ripple-color: rgba($color, 0.1);
|
|
81
|
-
}
|
|
82
|
-
@else {
|
|
83
|
-
$foreground-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
|
|
84
|
-
$state-layer-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
|
|
85
|
-
$ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1);
|
|
86
|
-
}
|
|
63
|
+
@function private-get-color-palette-color-tokens($theme, $color-variant) {
|
|
64
|
+
$system: m2-utils.get-system($theme);
|
|
65
|
+
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
87
66
|
|
|
88
67
|
@return (
|
|
89
|
-
fab-container-color:
|
|
90
|
-
fab-foreground-color: $
|
|
91
|
-
fab-ripple-color:
|
|
92
|
-
fab-small-container-color:
|
|
93
|
-
fab-small-foreground-color: $
|
|
94
|
-
fab-small-ripple-color:
|
|
95
|
-
fab-small-state-layer-color: $
|
|
96
|
-
fab-state-layer-color: $
|
|
68
|
+
fab-container-color: map.get($system, primary),
|
|
69
|
+
fab-foreground-color: map.get($system, on-primary),
|
|
70
|
+
fab-ripple-color: m3-utils.color-with-opacity(map.get($system, on-primary), 10%),
|
|
71
|
+
fab-small-container-color: map.get($system, primary),
|
|
72
|
+
fab-small-foreground-color: map.get($system, on-primary),
|
|
73
|
+
fab-small-ripple-color: m3-utils.color-with-opacity(map.get($system, on-primary), 10%),
|
|
74
|
+
fab-small-state-layer-color: map.get($system, on-primary),
|
|
75
|
+
fab-state-layer-color: map.get($system, on-primary),
|
|
97
76
|
);
|
|
98
77
|
}
|
|
99
78
|
|
|
@@ -117,14 +96,3 @@
|
|
|
117
96
|
fab-touch-target-display: if($density-scale < -1, none, block),
|
|
118
97
|
);
|
|
119
98
|
}
|
|
120
|
-
|
|
121
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
122
|
-
// This is used to create token slots.
|
|
123
|
-
@function get-token-slots() {
|
|
124
|
-
@return sass-utils.deep-merge-all(
|
|
125
|
-
get-unthemable-tokens(),
|
|
126
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
127
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
128
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
129
|
-
);
|
|
130
|
-
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
@use 'sass:meta';
|
|
2
1
|
@use 'sass:map';
|
|
3
|
-
@use '../core/tokens/m2-utils';
|
|
4
2
|
@use '../core/theming/theming';
|
|
5
3
|
@use '../core/theming/inspection';
|
|
6
|
-
@use '../core/
|
|
4
|
+
@use '../core/tokens/m2-utils';
|
|
5
|
+
@use '../core/tokens/m3-utils';
|
|
7
6
|
|
|
8
7
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
9
8
|
// but may be in a future version of the theming API.
|
|
@@ -16,32 +15,30 @@
|
|
|
16
15
|
|
|
17
16
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
17
|
@function get-color-tokens($theme) {
|
|
18
|
+
$system: m2-utils.get-system($theme);
|
|
19
19
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
20
20
|
|
|
21
21
|
@return (
|
|
22
22
|
icon-button-disabled-icon-color: if($is-dark, rgba(#fff, 0.5), rgba(#000, 0.38)),
|
|
23
23
|
icon-button-disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
24
|
-
icon-button-focus-state-layer-opacity:
|
|
25
|
-
icon-button-hover-state-layer-opacity:
|
|
24
|
+
icon-button-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
25
|
+
icon-button-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
26
26
|
icon-button-icon-color: inherit,
|
|
27
|
-
icon-button-pressed-state-layer-opacity:
|
|
27
|
+
icon-button-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
28
28
|
icon-button-ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
|
|
29
29
|
icon-button-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// Generates the mapping for the properties that change based on the button palette color.
|
|
34
|
-
@function private-get-color-palette-color-tokens($theme, $
|
|
35
|
-
$
|
|
36
|
-
$
|
|
34
|
+
@function private-get-color-palette-color-tokens($theme, $color-variant) {
|
|
35
|
+
$system: m2-utils.get-system($theme);
|
|
36
|
+
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
37
37
|
|
|
38
38
|
@return (
|
|
39
|
-
icon-button-icon-color:
|
|
40
|
-
icon-button-state-layer-color: $
|
|
41
|
-
icon-button-ripple-color:
|
|
42
|
-
meta.type-of($color) == color,
|
|
43
|
-
rgba($color, $ripple-opacity),
|
|
44
|
-
inspection.get-theme-color($theme, foreground, base, $ripple-opacity)),
|
|
39
|
+
icon-button-icon-color: map.get($system, primary),
|
|
40
|
+
icon-button-state-layer-color: map.get($system, primary),
|
|
41
|
+
icon-button-ripple-color: m3-utils.color-with-opacity(map.get($system, primary), 10%),
|
|
45
42
|
);
|
|
46
43
|
}
|
|
47
44
|
|
|
@@ -72,14 +69,3 @@
|
|
|
72
69
|
|
|
73
70
|
@return $tokens;
|
|
74
71
|
}
|
|
75
|
-
|
|
76
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
77
|
-
// This is used to create token slots.
|
|
78
|
-
@function get-token-slots() {
|
|
79
|
-
@return sass-utils.deep-merge-all(
|
|
80
|
-
get-unthemable-tokens(),
|
|
81
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
82
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
83
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
84
|
-
);
|
|
85
|
-
}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
@include token-utils.create-token-values(map.get(m3-button-toggle.get-tokens($theme), base));
|
|
16
16
|
} @else {
|
|
17
17
|
@include sass-utils.current-selector-or-root() {
|
|
18
|
-
@include token-utils.create-token-values-mixed(
|
|
18
|
+
@include token-utils.create-token-values-mixed(
|
|
19
|
+
m2-button-toggle.get-unthemable-tokens($theme));
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
}
|