@angular/material 20.0.4 → 20.1.0-next.1
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 +5 -15
- package/badge/_badge-theme.scss +2 -2
- package/badge/_m2-badge.scss +13 -34
- package/bottom-sheet/_m2-bottom-sheet.scss +6 -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 +83 -127
- package/button/_m2-fab.scss +40 -68
- package/button/_m2-icon-button.scss +18 -30
- package/button/testing/index.d.ts +0 -1
- 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 +33 -62
- package/chips/_chips-theme.scss +7 -4
- package/chips/_m2-chip.scss +22 -47
- 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 +89 -79
- package/core/option/_m2-optgroup.scss +3 -13
- package/core/option/_m2-option.scss +14 -21
- package/core/option/_option-theme.scss +3 -3
- package/core/ripple/_m2-ripple.scss +5 -22
- package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +11 -22
- 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 +10 -42
- package/{date-range-input-harness.d-CaEyN8dT.d.ts → date-range-input-harness.d-CJ4r85Uf.d.ts} +7 -4
- package/datepicker/_datepicker-theme.scss +16 -50
- package/datepicker/_m2-datepicker.scss +45 -137
- package/datepicker/testing/index.d.ts +3 -3
- package/dialog/_m2-dialog.scss +6 -25
- package/divider/_m2-divider.scss +3 -14
- package/expansion/_m2-expansion.scss +15 -25
- package/fesm2022/animation-DfMFjxHu.mjs.map +1 -1
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +1 -1
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button/testing.mjs +4 -7
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +2 -2
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips/testing.mjs +26 -1
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +132 -14
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/common-module-cKSwHniA.mjs.map +1 -1
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/date-formats-K6TQue-Y.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/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +1 -1
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/error-options-DCNQlTOA.mjs.map +1 -1
- package/fesm2022/error-state-Dtb1IHM-.mjs.map +1 -1
- package/fesm2022/expansion/testing.mjs.map +1 -1
- package/fesm2022/expansion.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/form-field/testing.mjs.map +1 -1
- package/fesm2022/{form-field-CFbrnFED.mjs → form-field-C9DZXojn.mjs} +3 -3
- package/fesm2022/form-field-C9DZXojn.mjs.map +1 -0
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon-button-DxiIc1ex.mjs.map +1 -1
- package/fesm2022/icon-registry-CwOTJ7YM.mjs.map +1 -1
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/index-BFRo2fUq.mjs.map +1 -1
- package/fesm2022/index-DwiL-HGk.mjs.map +1 -1
- 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/input-value-accessor-D1GvPuqO.mjs.map +1 -1
- package/fesm2022/input.mjs +27 -3
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/internal-form-field-D5iFxU6d.mjs.map +1 -1
- package/fesm2022/line-Bz5f9Cyx.mjs.map +1 -1
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +11 -2
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/{module-B0CLRw5e.mjs → module-BDiw_nWS.mjs} +3 -3
- package/fesm2022/module-BDiw_nWS.mjs.map +1 -0
- package/fesm2022/module-CWxMD37a.mjs.map +1 -1
- package/fesm2022/module-Ce6F7TNm.mjs.map +1 -1
- package/fesm2022/{module-B62K-792.mjs → module-DzZHEh7B.mjs} +2 -2
- package/fesm2022/module-DzZHEh7B.mjs.map +1 -0
- package/fesm2022/option-BzhYL_xC.mjs.map +1 -1
- package/fesm2022/option-harness-BFcc-M_4.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs +2 -3
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +3 -3
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/pseudo-checkbox-DDmgx3P4.mjs.map +1 -1
- package/fesm2022/pseudo-checkbox-module-4F8Up4PL.mjs.map +1 -1
- package/fesm2022/public-api-BoO5eSq-.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/ripple-BYgV4oZC.mjs.map +1 -1
- package/fesm2022/ripple-loader-BnMiRtmT.mjs.map +1 -1
- package/fesm2022/select/testing.mjs +8 -5
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select.mjs +3 -3
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav/testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper/testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +2 -2
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/structural-styles-CObeNzjn.mjs.map +1 -1
- package/fesm2022/table/testing.mjs.map +1 -1
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker/testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1 -1
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar/testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip/testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree/testing.mjs.map +1 -1
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +2 -2
- package/form-field/_m2-form-field.scss +59 -93
- 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/index.d.ts +11 -0
- 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 +19 -37
- package/menu/_m2-menu.scss +12 -23
- package/menu/index.d.ts +2 -0
- package/package.json +6 -6
- package/paginator/_m2-paginator.scss +7 -18
- package/paginator/testing/index.d.ts +2 -3
- 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 -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/_radio-theme.scss +6 -3
- package/schematics/ng-add/index.js +2 -2
- package/select/_m2-select.scss +14 -36
- package/select/_select-theme.scss +6 -3
- 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 +27 -39
- package/slider/_slider-theme.scss +2 -2
- package/snack-bar/_m2-snack-bar.scss +5 -22
- package/sort/_m2-sort.scss +3 -33
- 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 +6 -17
- package/tabs/_m2-tabs.scss +19 -36
- package/tabs/_tabs-theme.scss +4 -4
- package/timepicker/_m2-timepicker.scss +5 -15
- package/toolbar/_m2-toolbar.scss +4 -15
- package/tooltip/_m2-tooltip.scss +4 -14
- package/tree/_m2-tree.scss +4 -16
- package/core/tokens/_m2-tokens.scss +0 -131
- package/fesm2022/date-range-input-harness-Bp1T4oUe.mjs.map +0 -1
- package/fesm2022/form-field-CFbrnFED.mjs.map +0 -1
- package/fesm2022/input-harness-oQzj5EsQ.mjs.map +0 -1
- package/fesm2022/module-B0CLRw5e.mjs.map +0 -1
- package/fesm2022/module-B62K-792.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,6 @@
|
|
|
1
|
-
@use '../core/tokens/m2-utils';
|
|
2
|
-
@use '../core/theming/inspection';
|
|
3
1
|
@use '../core/style/elevation';
|
|
4
|
-
@use '../core/
|
|
2
|
+
@use '../core/tokens/m2-utils';
|
|
3
|
+
@use 'sass:map';
|
|
5
4
|
|
|
6
5
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
7
6
|
// but may be in a future version of the theming API.
|
|
@@ -14,8 +13,10 @@
|
|
|
14
13
|
|
|
15
14
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
16
15
|
@function get-color-tokens($theme) {
|
|
16
|
+
$system: m2-utils.get-system($theme);
|
|
17
|
+
|
|
17
18
|
@return (
|
|
18
|
-
autocomplete-background-color:
|
|
19
|
+
autocomplete-background-color: map.get($system, surface)
|
|
19
20
|
);
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -28,14 +29,3 @@
|
|
|
28
29
|
@function get-density-tokens($theme) {
|
|
29
30
|
@return ();
|
|
30
31
|
}
|
|
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,6 @@
|
|
|
1
|
-
@use '../core/tokens/m2-utils';
|
|
2
1
|
@use '../core/theming/inspection';
|
|
3
|
-
@use '../core/
|
|
2
|
+
@use '../core/tokens/m2-utils';
|
|
3
|
+
@use 'sass:map';
|
|
4
4
|
|
|
5
5
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
6
6
|
// but may be in a future version of the theming API.
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
|
|
14
14
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
15
15
|
@function get-color-tokens($theme) {
|
|
16
|
+
$system: m2-utils.get-system($theme);
|
|
17
|
+
|
|
16
18
|
@return (
|
|
17
|
-
bottom-sheet-container-text-color:
|
|
18
|
-
bottom-sheet-container-background-color:
|
|
19
|
+
bottom-sheet-container-text-color: map.get($system, on-surface),
|
|
20
|
+
bottom-sheet-container-background-color: map.get($system, surface),
|
|
19
21
|
);
|
|
20
22
|
}
|
|
21
23
|
|
|
@@ -37,14 +39,3 @@
|
|
|
37
39
|
@function get-density-tokens($theme) {
|
|
38
40
|
@return ();
|
|
39
41
|
}
|
|
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,102 @@
|
|
|
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
|
-
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
|
|
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
|
+
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
48
|
+
$disabled-container : m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
54
49
|
|
|
55
50
|
@return (
|
|
56
|
-
button-filled-container-color:
|
|
57
|
-
button-filled-disabled-container-color:
|
|
58
|
-
|
|
59
|
-
button-filled-disabled-
|
|
60
|
-
|
|
61
|
-
button-filled-
|
|
62
|
-
button-filled-
|
|
63
|
-
button-filled-
|
|
64
|
-
button-filled-
|
|
65
|
-
|
|
66
|
-
button-filled-
|
|
67
|
-
button-
|
|
68
|
-
button-outlined-disabled-
|
|
69
|
-
|
|
70
|
-
button-outlined-
|
|
71
|
-
button-outlined-
|
|
72
|
-
|
|
73
|
-
button-outlined-
|
|
74
|
-
button-outlined-
|
|
75
|
-
button-outlined-
|
|
76
|
-
|
|
77
|
-
button-outlined-
|
|
78
|
-
button-
|
|
79
|
-
button-
|
|
80
|
-
button-protected-
|
|
81
|
-
button-protected-disabled-
|
|
82
|
-
|
|
83
|
-
button-protected-
|
|
84
|
-
|
|
85
|
-
button-protected-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
button-protected-
|
|
89
|
-
button-
|
|
90
|
-
button-
|
|
91
|
-
button-
|
|
92
|
-
button-
|
|
93
|
-
button-text-
|
|
94
|
-
|
|
95
|
-
button-text-
|
|
96
|
-
|
|
97
|
-
button-text-
|
|
98
|
-
button-
|
|
99
|
-
button-
|
|
100
|
-
button-text-
|
|
101
|
-
button-
|
|
102
|
-
button-tonal-
|
|
103
|
-
button-tonal-
|
|
104
|
-
|
|
105
|
-
button-tonal-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
button-tonal-
|
|
109
|
-
button-tonal-hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
|
|
110
|
-
button-tonal-label-text-color: inspection.get-theme-color($theme, foreground, text, 1),
|
|
111
|
-
button-tonal-pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
|
|
112
|
-
button-tonal-ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
|
|
113
|
-
button-tonal-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
51
|
+
button-filled-container-color: map.get($system, surface),
|
|
52
|
+
button-filled-disabled-container-color: $disabled-container,
|
|
53
|
+
button-filled-disabled-label-text-color: $disabled,
|
|
54
|
+
button-filled-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
55
|
+
button-filled-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
56
|
+
button-filled-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
57
|
+
button-filled-label-text-color: map.get($system, on-surface),
|
|
58
|
+
button-filled-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
59
|
+
button-filled-ripple-color: m3-utils.color-with-opacity(
|
|
60
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
61
|
+
button-filled-state-layer-color: map.get($system, on-surface),
|
|
62
|
+
button-outlined-disabled-label-text-color: $disabled,
|
|
63
|
+
button-outlined-disabled-outline-color: map.get($system, outline),
|
|
64
|
+
button-outlined-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
65
|
+
button-outlined-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
66
|
+
button-outlined-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
67
|
+
button-outlined-label-text-color: map.get($system, on-surface),
|
|
68
|
+
button-outlined-outline-color: map.get($system, outline),
|
|
69
|
+
button-outlined-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
70
|
+
button-outlined-ripple-color: m3-utils.color-with-opacity(
|
|
71
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
72
|
+
button-outlined-state-layer-color: map.get($system, on-surface),
|
|
73
|
+
button-protected-container-color: map.get($system, surface),
|
|
74
|
+
button-protected-disabled-container-color: $disabled-container,
|
|
75
|
+
button-protected-disabled-label-text-color: $disabled,
|
|
76
|
+
button-protected-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
77
|
+
button-protected-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
78
|
+
button-protected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
79
|
+
button-protected-label-text-color: map.get($system, on-surface),
|
|
80
|
+
button-protected-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
81
|
+
button-protected-ripple-color: m3-utils.color-with-opacity(
|
|
82
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
83
|
+
button-protected-state-layer-color: map.get($system, on-surface),
|
|
84
|
+
button-text-disabled-label-text-color: $disabled,
|
|
85
|
+
button-text-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
86
|
+
button-text-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
87
|
+
button-text-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
88
|
+
button-text-label-text-color: map.get($system, on-surface),
|
|
89
|
+
button-text-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
90
|
+
button-text-ripple-color: m3-utils.color-with-opacity(
|
|
91
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
92
|
+
button-text-state-layer-color: map.get($system, on-surface),
|
|
93
|
+
button-tonal-container-color: map.get($system, surface),
|
|
94
|
+
button-tonal-disabled-container-color: $disabled-container,
|
|
95
|
+
button-tonal-disabled-label-text-color: $disabled,
|
|
96
|
+
button-tonal-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
97
|
+
button-tonal-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
98
|
+
button-tonal-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
99
|
+
button-tonal-label-text-color: map.get($system, on-surface),
|
|
100
|
+
button-tonal-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
101
|
+
button-tonal-ripple-color: m3-utils.color-with-opacity(
|
|
102
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
103
|
+
button-tonal-state-layer-color: map.get($system, on-surface),
|
|
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
|
-
|
|
149
|
-
button-
|
|
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(
|
|
120
|
+
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
|
|
121
|
+
button-filled-state-layer-color: map.get($system, on-primary),
|
|
122
|
+
button-outlined-label-text-color: map.get($system, primary),
|
|
150
123
|
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
|
-
|
|
158
|
-
button-protected-
|
|
159
|
-
button-
|
|
160
|
-
button-
|
|
161
|
-
|
|
162
|
-
button-text-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
button-tonal-
|
|
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),
|
|
124
|
+
button-outlined-ripple-color: m3-utils.color-with-opacity(
|
|
125
|
+
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
126
|
+
button-outlined-state-layer-color: map.get($system, primary),
|
|
127
|
+
button-protected-container-color: map.get($system, primary),
|
|
128
|
+
button-protected-label-text-color: map.get($system, on-primary),
|
|
129
|
+
button-protected-ripple-color: m3-utils.color-with-opacity(
|
|
130
|
+
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
|
|
131
|
+
button-protected-state-layer-color: map.get($system, on-primary),
|
|
132
|
+
button-text-label-text-color: map.get($system, primary),
|
|
133
|
+
button-text-ripple-color: m3-utils.color-with-opacity(
|
|
134
|
+
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
135
|
+
button-text-state-layer-color: map.get($system, primary),
|
|
136
|
+
button-tonal-container-color: map.get($system, primary),
|
|
137
|
+
button-tonal-label-text-color: map.get($system, on-primary),
|
|
138
|
+
button-tonal-ripple-color: m3-utils.color-with-opacity(
|
|
139
|
+
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
|
|
140
|
+
button-tonal-state-layer-color: map.get($system, on-primary),
|
|
174
141
|
);
|
|
175
142
|
}
|
|
176
143
|
|
|
@@ -238,14 +205,3 @@
|
|
|
238
205
|
button-tonal-touch-target-display: $touch-target-display,
|
|
239
206
|
);
|
|
240
207
|
}
|
|
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,70 +30,53 @@
|
|
|
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-
|
|
40
|
-
|
|
41
|
-
fab-
|
|
42
|
-
fab-
|
|
43
|
-
fab-
|
|
44
|
-
fab-
|
|
45
|
-
|
|
46
|
-
fab-
|
|
47
|
-
fab-small-container-color:
|
|
48
|
-
fab-small-disabled-state-
|
|
49
|
-
|
|
50
|
-
fab-small-
|
|
51
|
-
|
|
52
|
-
fab-small-
|
|
53
|
-
fab-small-
|
|
54
|
-
fab-small-
|
|
55
|
-
|
|
56
|
-
fab-small-
|
|
57
|
-
fab-
|
|
58
|
-
fab-small-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
59
|
-
fab-state-layer-color: inspection.get-theme-color($theme, foreground, base),
|
|
39
|
+
fab-container-color: map.get($system, surface),
|
|
40
|
+
fab-disabled-state-container-color: $disabled-container,
|
|
41
|
+
fab-disabled-state-foreground-color: $disabled,
|
|
42
|
+
fab-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
43
|
+
fab-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
44
|
+
fab-foreground-color: map.get($system, on-surface),
|
|
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),
|
|
47
|
+
fab-ripple-color: m3-utils.color-with-opacity(
|
|
48
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
49
|
+
fab-small-container-color: map.get($system, surface),
|
|
50
|
+
fab-small-disabled-state-container-color: $disabled-container,
|
|
51
|
+
fab-small-disabled-state-foreground-color: $disabled,
|
|
52
|
+
fab-small-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
53
|
+
fab-small-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
54
|
+
fab-small-foreground-color: map.get($system, on-surface),
|
|
55
|
+
fab-small-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
56
|
+
fab-small-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
57
|
+
fab-small-ripple-color: m3-utils.color-with-opacity(
|
|
58
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
59
|
+
fab-small-state-layer-color: map.get($system, on-surface),
|
|
60
|
+
fab-state-layer-color: map.get($system, on-surface),
|
|
60
61
|
);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
// 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
|
-
}
|
|
65
|
+
@function private-get-color-palette-color-tokens($theme, $color-variant) {
|
|
66
|
+
$system: m2-utils.get-system($theme);
|
|
67
|
+
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
87
68
|
|
|
88
69
|
@return (
|
|
89
|
-
fab-container-color:
|
|
90
|
-
fab-foreground-color: $
|
|
91
|
-
fab-ripple-color:
|
|
92
|
-
|
|
93
|
-
fab-small-
|
|
94
|
-
fab-small-
|
|
95
|
-
fab-small-
|
|
96
|
-
|
|
70
|
+
fab-container-color: map.get($system, primary),
|
|
71
|
+
fab-foreground-color: map.get($system, on-primary),
|
|
72
|
+
fab-ripple-color: m3-utils.color-with-opacity(
|
|
73
|
+
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
74
|
+
fab-small-container-color: map.get($system, primary),
|
|
75
|
+
fab-small-foreground-color: map.get($system, on-primary),
|
|
76
|
+
fab-small-ripple-color: m3-utils.color-with-opacity(
|
|
77
|
+
map.get($system, on-primary), map.get($system, pressed-state-layer-opacity)),
|
|
78
|
+
fab-small-state-layer-color: map.get($system, on-primary),
|
|
79
|
+
fab-state-layer-color: map.get($system, on-primary),
|
|
97
80
|
);
|
|
98
81
|
}
|
|
99
82
|
|
|
@@ -117,14 +100,3 @@
|
|
|
117
100
|
fab-touch-target-display: if($density-scale < -1, none, block),
|
|
118
101
|
);
|
|
119
102
|
}
|
|
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
|
-
}
|