@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
|
@@ -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,32 @@
|
|
|
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
|
-
icon-button-disabled-icon-color:
|
|
23
|
-
icon-button-disabled-state-layer-color:
|
|
24
|
-
icon-button-focus-state-layer-opacity:
|
|
25
|
-
icon-button-hover-state-layer-opacity:
|
|
22
|
+
icon-button-disabled-icon-color: m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
23
|
+
icon-button-disabled-state-layer-color: map.get($system, on-surface-variant),
|
|
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:
|
|
28
|
-
icon-button-ripple-color:
|
|
29
|
-
|
|
27
|
+
icon-button-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
28
|
+
icon-button-ripple-color: m3-utils.color-with-opacity(
|
|
29
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
30
|
+
icon-button-state-layer-color: map.get($system, on-surface),
|
|
30
31
|
);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
// 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
|
-
$
|
|
35
|
+
@function private-get-color-palette-color-tokens($theme, $color-variant) {
|
|
36
|
+
$system: m2-utils.get-system($theme);
|
|
37
|
+
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
37
38
|
|
|
38
39
|
@return (
|
|
39
|
-
icon-button-icon-color:
|
|
40
|
-
icon-button-state-layer-color: $
|
|
41
|
-
icon-button-ripple-color:
|
|
42
|
-
|
|
43
|
-
rgba($color, $ripple-opacity),
|
|
44
|
-
inspection.get-theme-color($theme, foreground, base, $ripple-opacity)),
|
|
40
|
+
icon-button-icon-color: map.get($system, primary),
|
|
41
|
+
icon-button-state-layer-color: map.get($system, primary),
|
|
42
|
+
icon-button-ripple-color: m3-utils.color-with-opacity(
|
|
43
|
+
map.get($system, primary), map.get($system, pressed-state-layer-opacity)),
|
|
45
44
|
);
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -72,14 +71,3 @@
|
|
|
72
71
|
|
|
73
72
|
@return $tokens;
|
|
74
73
|
}
|
|
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
|
-
}
|
|
@@ -18,7 +18,6 @@ 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. */
|
|
22
21
|
static hostSelector: string;
|
|
23
22
|
/**
|
|
24
23
|
* Gets a `HarnessPredicate` that can be used to search for a button with specific attributes.
|
|
@@ -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
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use 'sass:meta';
|
|
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.
|
|
10
|
-
@function get-unthemable-tokens() {
|
|
9
|
+
@function get-unthemable-tokens($theme) {
|
|
10
|
+
$system: m2-utils.get-system($theme);
|
|
11
11
|
@return (
|
|
12
|
-
button-toggle-focus-state-layer-opacity:
|
|
13
|
-
button-toggle-hover-state-layer-opacity:
|
|
12
|
+
button-toggle-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
13
|
+
button-toggle-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
14
14
|
button-toggle-legacy-focus-state-layer-opacity: 1,
|
|
15
15
|
button-toggle-legacy-height: 36px,
|
|
16
16
|
button-toggle-legacy-shape: 2px,
|
|
@@ -20,48 +20,34 @@
|
|
|
20
20
|
|
|
21
21
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
22
22
|
@function get-color-tokens($theme) {
|
|
23
|
-
$
|
|
24
|
-
|
|
25
|
-
// By default the theme usually has an rgba color for the dividers, which can
|
|
26
|
-
// stack up with the background of a button toggle. This can cause the border
|
|
27
|
-
// of a selected toggle to look different from an unselected one. We use a solid
|
|
28
|
-
// color to ensure that the border always stays the same.
|
|
29
|
-
$divider-color: if(
|
|
30
|
-
meta.type-of($theme-divider-color) == color,
|
|
31
|
-
theming.private-rgba-to-hex(
|
|
32
|
-
$theme-divider-color, inspection.get-theme-color($theme, background, card)),
|
|
33
|
-
$theme-divider-color);
|
|
23
|
+
$system: m2-utils.get-system($theme);
|
|
34
24
|
|
|
35
25
|
@return (
|
|
36
|
-
button-toggle-background-color:
|
|
26
|
+
button-toggle-background-color: map.get($system, surface),
|
|
37
27
|
button-toggle-disabled-selected-state-background-color:
|
|
38
|
-
|
|
28
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
39
29
|
button-toggle-disabled-selected-state-text-color:
|
|
40
|
-
|
|
41
|
-
button-toggle-disabled-state-background-color:
|
|
42
|
-
inspection.get-theme-color($theme, background, card),
|
|
30
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
31
|
+
button-toggle-disabled-state-background-color: map.get($system, surface),
|
|
43
32
|
button-toggle-disabled-state-text-color:
|
|
44
|
-
|
|
45
|
-
button-toggle-divider-color: $
|
|
33
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
34
|
+
button-toggle-divider-color: map.get($system, outline),
|
|
46
35
|
button-toggle-legacy-disabled-selected-state-background-color:
|
|
47
|
-
|
|
48
|
-
button-toggle-legacy-disabled-state-background-color:
|
|
49
|
-
inspection.get-theme-color($theme, background, disabled-button-toggle),
|
|
36
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
37
|
+
button-toggle-legacy-disabled-state-background-color: map.get($system, surface),
|
|
50
38
|
button-toggle-legacy-disabled-state-text-color:
|
|
51
|
-
|
|
39
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
52
40
|
button-toggle-legacy-selected-state-background-color:
|
|
53
|
-
|
|
54
|
-
button-toggle-legacy-selected-state-text-color:
|
|
55
|
-
inspection.get-theme-color($theme, foreground, secondary-text),
|
|
41
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
42
|
+
button-toggle-legacy-selected-state-text-color: map.get($system, on-surface),
|
|
56
43
|
button-toggle-legacy-state-layer-color:
|
|
57
|
-
|
|
58
|
-
button-toggle-legacy-text-color:
|
|
44
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
45
|
+
button-toggle-legacy-text-color: map.get($system, on-surface),
|
|
59
46
|
button-toggle-selected-state-background-color:
|
|
60
|
-
|
|
61
|
-
button-toggle-selected-state-text-color:
|
|
62
|
-
button-toggle-state-layer-color:
|
|
63
|
-
|
|
64
|
-
button-toggle-text-color: inspection.get-theme-color($theme, foreground, text),
|
|
47
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
|
|
48
|
+
button-toggle-selected-state-text-color: map.get($system, on-surface),
|
|
49
|
+
button-toggle-state-layer-color: map.get($system, on-surface),
|
|
50
|
+
button-toggle-text-color: map.get($system, on-surface),
|
|
65
51
|
);
|
|
66
52
|
}
|
|
67
53
|
|
|
@@ -103,14 +89,3 @@
|
|
|
103
89
|
button-toggle-height: map.get($size-scale, $density-scale)
|
|
104
90
|
);
|
|
105
91
|
}
|
|
106
|
-
|
|
107
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
108
|
-
// This is used to create token slots.
|
|
109
|
-
@function get-token-slots() {
|
|
110
|
-
@return sass-utils.deep-merge-all(
|
|
111
|
-
get-unthemable-tokens(),
|
|
112
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
113
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
114
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
115
|
-
);
|
|
116
|
-
}
|
package/card/_m2-card.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@use '../core/tokens/m2-utils';
|
|
2
1
|
@use '../core/theming/inspection';
|
|
3
|
-
@use '../core/style/sass-utils';
|
|
4
2
|
@use '../core/style/elevation';
|
|
3
|
+
@use '../core/tokens/m2-utils';
|
|
4
|
+
@use 'sass:map';
|
|
5
5
|
|
|
6
6
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
7
7
|
// but may be in a future version of the theming API.
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
|
|
17
17
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
18
|
@function get-color-tokens($theme) {
|
|
19
|
+
$system: m2-utils.get-system($theme);
|
|
20
|
+
|
|
19
21
|
@return (
|
|
20
|
-
card-elevated-container-color:
|
|
22
|
+
card-elevated-container-color: map.get($system, surface),
|
|
21
23
|
card-elevated-container-elevation: elevation.get-box-shadow(1),
|
|
22
|
-
card-outlined-container-color:
|
|
24
|
+
card-outlined-container-color: map.get($system, surface),
|
|
23
25
|
card-outlined-container-elevation: elevation.get-box-shadow(0),
|
|
24
|
-
card-outlined-outline-color:
|
|
25
|
-
card-subtitle-text-color:
|
|
26
|
-
card-filled-container-color:
|
|
26
|
+
card-outlined-outline-color: map.get($system, outline),
|
|
27
|
+
card-subtitle-text-color: map.get($system, on-surface-variant),
|
|
28
|
+
card-filled-container-color: map.get($system, surface),
|
|
27
29
|
card-filled-container-elevation: elevation.get-box-shadow(0)
|
|
28
30
|
);
|
|
29
31
|
}
|
|
@@ -50,14 +52,3 @@
|
|
|
50
52
|
@function get-density-tokens($theme) {
|
|
51
53
|
@return ();
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
55
|
-
// This is used to create token slots.
|
|
56
|
-
@function get-token-slots() {
|
|
57
|
-
@return sass-utils.deep-merge-all(
|
|
58
|
-
get-unthemable-tokens(),
|
|
59
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
60
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
61
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
62
|
-
);
|
|
63
|
-
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
@include token-utils.create-token-values(map.get(m3-checkbox.get-tokens($theme), base));
|
|
16
16
|
} @else {
|
|
17
17
|
@include sass-utils.current-selector-or-root() {
|
|
18
|
-
@include token-utils.create-token-values-mixed(m2-checkbox.get-unthemable-tokens());
|
|
18
|
+
@include token-utils.create-token-values-mixed(m2-checkbox.get-unthemable-tokens($theme));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
map.get(m3-checkbox.get-tokens($theme, $color-variant), color));
|
|
30
30
|
} @else {
|
|
31
31
|
@include sass-utils.current-selector-or-root() {
|
|
32
|
-
@include token-utils.create-token-values-mixed(
|
|
32
|
+
@include token-utils.create-token-values-mixed(
|
|
33
|
+
m2-checkbox.get-color-tokens($theme, secondary));
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
.mat-mdc-checkbox {
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
|
|
43
44
|
&.mat-warn {
|
|
44
45
|
@include token-utils.create-token-values-mixed(
|
|
45
|
-
m2-checkbox.get-color-tokens($theme,
|
|
46
|
+
m2-checkbox.get-color-tokens($theme, error,
|
|
46
47
|
$exclude: (checkbox-disabled-label-color, checkbox-label-text-color))
|
|
47
48
|
);
|
|
48
49
|
}
|
|
@@ -1,69 +1,51 @@
|
|
|
1
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
|
-
@use '../core/m2/theming' as m2-theming;
|
|
7
|
-
@use '../core/m2/palette' as m2-palette;
|
|
8
6
|
|
|
9
7
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
10
8
|
// but may be in a future version of the theming API.
|
|
11
|
-
@function get-unthemable-tokens() {
|
|
9
|
+
@function get-unthemable-tokens($theme) {
|
|
10
|
+
$system: m2-utils.get-system($theme);
|
|
11
|
+
|
|
12
12
|
@return (
|
|
13
|
-
checkbox-disabled-selected-checkmark-color:
|
|
14
|
-
checkbox-selected-focus-state-layer-opacity:
|
|
15
|
-
checkbox-selected-hover-state-layer-opacity:
|
|
16
|
-
checkbox-selected-pressed-state-layer-opacity:
|
|
17
|
-
checkbox-unselected-focus-state-layer-opacity:
|
|
18
|
-
checkbox-unselected-hover-state-layer-opacity:
|
|
19
|
-
checkbox-unselected-pressed-state-layer-opacity:
|
|
13
|
+
checkbox-disabled-selected-checkmark-color: map.get($system, surface),
|
|
14
|
+
checkbox-selected-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
15
|
+
checkbox-selected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
16
|
+
checkbox-selected-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
17
|
+
checkbox-unselected-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
18
|
+
checkbox-unselected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
19
|
+
checkbox-unselected-pressed-state-layer-opacity: map.get($system, pressed-state-layer-opacity),
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
24
|
-
@function get-color-tokens($theme, $
|
|
24
|
+
@function get-color-tokens($theme, $color-variant, $exclude: ()) {
|
|
25
|
+
$system: m2-utils.get-system($theme);
|
|
26
|
+
$system: m3-utils.replace-colors-with-variant($system, secondary, $color-variant);
|
|
25
27
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
26
|
-
$
|
|
27
|
-
$palette-default: inspection.get-theme-color($theme, $palette-name, default);
|
|
28
|
-
$disabled-color: sass-utils.safe-color-change(
|
|
29
|
-
inspection.get-theme-color($theme, foreground, base), $alpha: 0.38);
|
|
30
|
-
$palette-selected: inspection.get-theme-color($theme, $palette-name);
|
|
31
|
-
$border-color: sass-utils.safe-color-change(
|
|
32
|
-
inspection.get-theme-color($theme, foreground, base), $alpha: 0.54);
|
|
33
|
-
$active-border-color:
|
|
34
|
-
m2-theming.get-color-from-palette(m2-palette.$gray-palette, if($is-dark, 200, 900));
|
|
35
|
-
$selected-checkmark-color: null;
|
|
36
|
-
|
|
37
|
-
// Ideally we would derive all values directly from the theme, but it causes a lot of regressions
|
|
38
|
-
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
|
|
39
|
-
@if (m2-utils.$private-is-internal-build) {
|
|
40
|
-
$contrast-tone: m2-utils.contrast-tone($palette-selected, $is-dark);
|
|
41
|
-
$selected-checkmark-color: if($contrast-tone == 'dark', #000, #fff);
|
|
42
|
-
}
|
|
43
|
-
@else {
|
|
44
|
-
$selected-checkmark-color:
|
|
45
|
-
inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
|
|
46
|
-
}
|
|
28
|
+
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
|
|
47
29
|
|
|
48
30
|
$tokens: (
|
|
49
|
-
checkbox-disabled-label-color:
|
|
50
|
-
checkbox-label-text-color:
|
|
51
|
-
checkbox-disabled-selected-icon-color: $disabled
|
|
52
|
-
checkbox-disabled-unselected-icon-color: $disabled
|
|
53
|
-
checkbox-selected-checkmark-color: $
|
|
54
|
-
checkbox-selected-focus-icon-color: $
|
|
55
|
-
checkbox-selected-hover-icon-color: $
|
|
56
|
-
checkbox-selected-icon-color: $
|
|
57
|
-
checkbox-selected-pressed-icon-color: $
|
|
58
|
-
checkbox-unselected-focus-icon-color: $
|
|
59
|
-
checkbox-unselected-hover-icon-color: $
|
|
60
|
-
checkbox-unselected-icon-color: $
|
|
61
|
-
checkbox-selected-focus-state-layer-color: $
|
|
62
|
-
checkbox-selected-hover-state-layer-color: $
|
|
63
|
-
checkbox-selected-pressed-state-layer-color: $
|
|
64
|
-
checkbox-unselected-focus-state-layer-color: $
|
|
65
|
-
checkbox-unselected-hover-state-layer-color: $
|
|
66
|
-
checkbox-unselected-pressed-state-layer-color: $
|
|
31
|
+
checkbox-disabled-label-color: $disabled,
|
|
32
|
+
checkbox-label-text-color: map.get($system, on-surface),
|
|
33
|
+
checkbox-disabled-selected-icon-color: $disabled,
|
|
34
|
+
checkbox-disabled-unselected-icon-color: $disabled,
|
|
35
|
+
checkbox-selected-checkmark-color: map.get($system, on-secondary),
|
|
36
|
+
checkbox-selected-focus-icon-color: map.get($system, secondary),
|
|
37
|
+
checkbox-selected-hover-icon-color: map.get($system, secondary),
|
|
38
|
+
checkbox-selected-icon-color: map.get($system, secondary),
|
|
39
|
+
checkbox-selected-pressed-icon-color: map.get($system, secondary),
|
|
40
|
+
checkbox-unselected-focus-icon-color: map.get($system, on-surface),
|
|
41
|
+
checkbox-unselected-hover-icon-color: map.get($system, on-surface),
|
|
42
|
+
checkbox-unselected-icon-color: map.get($system, on-surface-variant),
|
|
43
|
+
checkbox-selected-focus-state-layer-color: map.get($system, secondary),
|
|
44
|
+
checkbox-selected-hover-state-layer-color: map.get($system, secondary),
|
|
45
|
+
checkbox-selected-pressed-state-layer-color: map.get($system, secondary),
|
|
46
|
+
checkbox-unselected-focus-state-layer-color: map.get($system, on-surface),
|
|
47
|
+
checkbox-unselected-hover-state-layer-color: map.get($system, on-surface),
|
|
48
|
+
checkbox-unselected-pressed-state-layer-color: map.get($system, on-surface),
|
|
67
49
|
);
|
|
68
50
|
|
|
69
51
|
@each $token in $exclude {
|
|
@@ -98,14 +80,3 @@
|
|
|
98
80
|
), $scale)
|
|
99
81
|
);
|
|
100
82
|
}
|
|
101
|
-
|
|
102
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
103
|
-
// This is used to create token slots.
|
|
104
|
-
@function get-token-slots() {
|
|
105
|
-
@return sass-utils.deep-merge-all(
|
|
106
|
-
get-unthemable-tokens(),
|
|
107
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
108
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
109
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
110
|
-
);
|
|
111
|
-
}
|
package/chips/_chips-theme.scss
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
@include token-utils.create-token-values(map.get(m3-chip.get-tokens($theme), base));
|
|
16
16
|
} @else {
|
|
17
17
|
.mat-mdc-standard-chip {
|
|
18
|
-
@include token-utils.create-token-values-mixed(m2-chip.get-unthemable-tokens());
|
|
18
|
+
@include token-utils.create-token-values-mixed(m2-chip.get-unthemable-tokens($theme));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -34,15 +34,18 @@
|
|
|
34
34
|
&.mat-mdc-chip-selected,
|
|
35
35
|
&.mat-mdc-chip-highlighted {
|
|
36
36
|
&.mat-primary {
|
|
37
|
-
@include token-utils.create-token-values-mixed(
|
|
37
|
+
@include token-utils.create-token-values-mixed(
|
|
38
|
+
m2-chip.get-color-tokens($theme, primary));
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
&.mat-accent {
|
|
41
|
-
@include token-utils.create-token-values-mixed(
|
|
42
|
+
@include token-utils.create-token-values-mixed(
|
|
43
|
+
m2-chip.get-color-tokens($theme, secondary));
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
&.mat-warn {
|
|
45
|
-
@include token-utils.create-token-values-mixed(
|
|
47
|
+
@include token-utils.create-token-values-mixed(
|
|
48
|
+
m2-chip.get-color-tokens($theme, error));
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
}
|
package/chips/_m2-chip.scss
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use 'sass:meta';
|
|
3
|
-
@use 'sass:color';
|
|
4
|
-
@use '../core/tokens/m2-utils';
|
|
5
2
|
@use '../core/theming/inspection';
|
|
6
|
-
@use '../core/style/sass-utils';
|
|
7
|
-
@use '../core/m2/palette' as m2-palette;
|
|
8
3
|
@use '../core/theming/theming';
|
|
4
|
+
@use '../core/tokens/m2-utils';
|
|
5
|
+
@use '../core/tokens/m3-utils';
|
|
9
6
|
|
|
10
7
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
11
8
|
// but may be in a future version of the theming API.
|
|
12
|
-
@function get-unthemable-tokens() {
|
|
9
|
+
@function get-unthemable-tokens($theme) {
|
|
10
|
+
$system: m2-utils.get-system($theme);
|
|
11
|
+
|
|
13
12
|
@return (
|
|
14
13
|
chip-container-shape-radius: 16px,
|
|
15
14
|
chip-disabled-container-opacity: 0.4,
|
|
16
15
|
chip-disabled-outline-color: transparent,
|
|
17
16
|
chip-flat-selected-outline-width: 0,
|
|
18
17
|
chip-focus-outline-color: transparent,
|
|
19
|
-
chip-hover-state-layer-opacity:
|
|
18
|
+
chip-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
20
19
|
chip-outline-color: transparent,
|
|
21
20
|
chip-outline-width: 0,
|
|
22
|
-
chip-selected-hover-state-layer-opacity:
|
|
21
|
+
chip-selected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
|
|
23
22
|
chip-selected-trailing-action-state-layer-color: transparent,
|
|
24
23
|
chip-trailing-action-focus-opacity: 1,
|
|
25
24
|
chip-trailing-action-focus-state-layer-opacity: 0,
|
|
@@ -36,44 +35,31 @@
|
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
39
|
-
@function get-color-tokens($theme, $
|
|
40
|
-
$
|
|
41
|
-
$background:
|
|
42
|
-
$
|
|
43
|
-
$state-layer-opacity: 0.12; // 0.12 is a common value in Material Design for opacity.
|
|
44
|
-
$surface: inspection.get-theme-color($theme, background, card);
|
|
38
|
+
@function get-color-tokens($theme, $color-variant: null) {
|
|
39
|
+
$system: m2-utils.get-system($theme);
|
|
40
|
+
$background: m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
41
|
+
$foreground: map.get($system, on-surface);
|
|
45
42
|
|
|
46
|
-
@if $
|
|
47
|
-
$
|
|
48
|
-
$
|
|
49
|
-
$
|
|
50
|
-
$foreground: if($is-dark, $grey-50, $grey-900);
|
|
51
|
-
|
|
52
|
-
$surface: inspection.get-theme-color($theme, background, card);
|
|
53
|
-
$background: if(
|
|
54
|
-
meta.type-of($state-layer-color) == color and meta.type-of($surface) == color,
|
|
55
|
-
color.mix($state-layer-color, $surface, 12%),
|
|
56
|
-
$state-layer-color
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
@else {
|
|
60
|
-
$background: inspection.get-theme-color($theme, $palette-name);
|
|
61
|
-
$foreground: inspection.get-theme-color($theme, $palette-name, default-contrast);
|
|
43
|
+
@if $color-variant {
|
|
44
|
+
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
45
|
+
$background: map.get($system, primary);
|
|
46
|
+
$foreground: map.get($system, on-primary);
|
|
62
47
|
}
|
|
48
|
+
|
|
63
49
|
@return (
|
|
64
50
|
chip-disabled-label-text-color: $foreground,
|
|
65
51
|
chip-elevated-container-color: $background,
|
|
66
52
|
chip-elevated-disabled-container-color: $background,
|
|
67
53
|
chip-elevated-selected-container-color: $background,
|
|
68
54
|
chip-flat-disabled-selected-container-color: $background,
|
|
69
|
-
chip-focus-state-layer-color: $
|
|
70
|
-
chip-focus-state-layer-opacity: $state-layer-opacity,
|
|
71
|
-
chip-hover-state-layer-color: $
|
|
55
|
+
chip-focus-state-layer-color: map.get($system, on-surface),
|
|
56
|
+
chip-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
57
|
+
chip-hover-state-layer-color: map.get($system, on-surface),
|
|
72
58
|
chip-label-text-color: $foreground,
|
|
73
59
|
chip-selected-disabled-trailing-icon-color: $foreground,
|
|
74
|
-
chip-selected-focus-state-layer-color: $state-layer-
|
|
75
|
-
chip-selected-focus-state-layer-opacity: $state-layer-opacity,
|
|
76
|
-
chip-selected-hover-state-layer-color: $state-layer-
|
|
60
|
+
chip-selected-focus-state-layer-color: map.get($system, focus-state-layer-opacity),
|
|
61
|
+
chip-selected-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
62
|
+
chip-selected-hover-state-layer-color: map.get($system, hover-state-layer-opacity),
|
|
77
63
|
chip-selected-label-text-color: $foreground,
|
|
78
64
|
chip-selected-trailing-icon-color: $foreground,
|
|
79
65
|
chip-with-icon-disabled-icon-color: $foreground,
|
|
@@ -110,14 +96,3 @@
|
|
|
110
96
|
)
|
|
111
97
|
);
|
|
112
98
|
}
|
|
113
|
-
|
|
114
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
115
|
-
// This is used to create token slots.
|
|
116
|
-
@function get-token-slots() {
|
|
117
|
-
@return sass-utils.deep-merge-all(
|
|
118
|
-
get-unthemable-tokens(),
|
|
119
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
120
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
121
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
122
|
-
);
|
|
123
|
-
}
|