@angular/material 20.0.0-rc.0 → 20.0.0-rc.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/badge/_badge-theme.scss +27 -14
- package/badge/_m3-badge.scss +39 -67
- package/button-toggle/_m3-button-toggle.scss +1 -1
- package/core/color/_all-color.scss +1 -1
- package/core/theming/_all-theme.scss +41 -0
- package/core/theming/_color-api-backwards-compatibility.scss +3 -6
- package/core/theming/_definition.scss +72 -72
- package/core/theming/_inspection.scss +24 -22
- package/core/tokens/_m3-system.scss +112 -69
- package/core/tokens/_m3-tokens.scss +30 -226
- package/core/tokens/_m3-utils.scss +35 -0
- package/core/tokens/_token-utils.scss +22 -1
- package/core/tokens/m3/_index.scss +6 -8
- package/core/tokens/m3/_md-sys-color.scss +125 -137
- package/core/tokens/m3/_md-sys-elevation.scss +7 -7
- package/core/tokens/m3/_md-sys-motion.scss +27 -38
- package/core/tokens/m3/_md-sys-shape.scss +13 -16
- package/core/tokens/m3/_md-sys-state.scss +5 -5
- package/core/tokens/m3/_md-sys-typescale.scss +107 -306
- package/fesm2022/autocomplete.mjs +23 -23
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +11 -11
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +11 -11
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +16 -16
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +21 -21
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +47 -47
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +11 -11
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +47 -47
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/{common-module-DZl8g1kc.mjs → common-module-CF0eSYO4.mjs} +5 -5
- package/fesm2022/{common-module-DZl8g1kc.mjs.map → common-module-CF0eSYO4.mjs.map} +1 -1
- package/fesm2022/core.mjs +24 -24
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +90 -90
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +2 -2
- package/fesm2022/dialog.mjs +2 -2
- package/fesm2022/divider.mjs +8 -8
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/{error-options-BWOa3B4G.mjs → error-options-CbAHLQL5.mjs} +7 -7
- package/fesm2022/{error-options-BWOa3B4G.mjs.map → error-options-CbAHLQL5.mjs.map} +1 -1
- package/fesm2022/expansion.mjs +27 -27
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/{form-field-B3aq6ikj.mjs → form-field-sL9_TuE-.mjs} +68 -60
- package/fesm2022/form-field-sL9_TuE-.mjs.map +1 -0
- package/fesm2022/form-field.mjs +3 -3
- package/fesm2022/grid-list.mjs +24 -24
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +8 -8
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/{icon-button-DH8TBWWr.mjs → icon-button-BASP1JI8.mjs} +10 -10
- package/fesm2022/{icon-button-DH8TBWWr.mjs.map → icon-button-BASP1JI8.mjs.map} +1 -1
- package/fesm2022/{icon-registry-Bk5cM8Z5.mjs → icon-registry-DVLYRZv3.mjs} +4 -4
- package/fesm2022/{icon-registry-Bk5cM8Z5.mjs.map → icon-registry-DVLYRZv3.mjs.map} +1 -1
- package/fesm2022/icon.mjs +10 -10
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/index-BNtCg9r0.mjs +22 -0
- package/fesm2022/{index-BHJ4tVIe.mjs.map → index-BNtCg9r0.mjs.map} +1 -1
- package/fesm2022/index-DxCSjCL3.mjs +20 -0
- package/fesm2022/{index-D2rZ0V78.mjs.map → index-DxCSjCL3.mjs.map} +1 -1
- package/fesm2022/input.mjs +12 -12
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/{internal-form-field-DVvKYBKJ.mjs → internal-form-field-_OHaksOO.mjs} +4 -4
- package/fesm2022/{internal-form-field-DVvKYBKJ.mjs.map → internal-form-field-_OHaksOO.mjs.map} +1 -1
- package/fesm2022/{line-Dwrcg_t9.mjs → line-CtAKiRo6.mjs} +9 -9
- package/fesm2022/{line-Dwrcg_t9.mjs.map → line-CtAKiRo6.mjs.map} +1 -1
- package/fesm2022/list.mjs +55 -55
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +20 -20
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/{module-B-ci3hbc.mjs → module-ChwDH6BC.mjs} +27 -27
- package/fesm2022/{module-B-ci3hbc.mjs.map → module-ChwDH6BC.mjs.map} +1 -1
- package/fesm2022/{module-hX_hFZhs.mjs → module-DToxyW7l.mjs} +7 -7
- package/fesm2022/{module-hX_hFZhs.mjs.map → module-DToxyW7l.mjs.map} +1 -1
- package/fesm2022/{module-D9IKGg_w.mjs → module-DqTK2swA.mjs} +17 -17
- package/fesm2022/{module-D9IKGg_w.mjs.map → module-DqTK2swA.mjs.map} +1 -1
- package/fesm2022/{module-X29xYsIk.mjs → module-m5vWw9-5.mjs} +12 -12
- package/fesm2022/{module-X29xYsIk.mjs.map → module-m5vWw9-5.mjs.map} +1 -1
- package/fesm2022/{option-MOeehkAg.mjs → option-hkPAbXDN.mjs} +10 -10
- package/fesm2022/{option-MOeehkAg.mjs.map → option-hkPAbXDN.mjs.map} +1 -1
- package/fesm2022/paginator.mjs +25 -25
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +8 -8
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +8 -8
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/{pseudo-checkbox-BFGIaGxz.mjs → pseudo-checkbox-Ddidc23S.mjs} +4 -4
- package/fesm2022/{pseudo-checkbox-BFGIaGxz.mjs.map → pseudo-checkbox-Ddidc23S.mjs.map} +1 -1
- package/fesm2022/pseudo-checkbox-module--am9-RIA.mjs +20 -0
- package/fesm2022/{pseudo-checkbox-module-Dxth-mPi.mjs.map → pseudo-checkbox-module--am9-RIA.mjs.map} +1 -1
- package/fesm2022/radio.mjs +15 -15
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/{ripple-CuyVtN3V.mjs → ripple-DUGA2BAa.mjs} +7 -7
- package/fesm2022/{ripple-CuyVtN3V.mjs.map → ripple-DUGA2BAa.mjs.map} +1 -1
- package/fesm2022/{ripple-loader-pOctSZby.mjs → ripple-loader-Xy4bv6Xh.mjs} +5 -5
- package/fesm2022/{ripple-loader-pOctSZby.mjs.map → ripple-loader-Xy4bv6Xh.mjs.map} +1 -1
- package/fesm2022/select.mjs +12 -12
- package/fesm2022/sidenav.mjs +23 -23
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +11 -11
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +20 -20
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +28 -28
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort.mjs +15 -15
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper.mjs +37 -37
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/{structural-styles-CasigI3l.mjs → structural-styles-DA18Hchc.mjs} +4 -4
- package/fesm2022/{structural-styles-CasigI3l.mjs.map → structural-styles-DA18Hchc.mjs.map} +1 -1
- package/fesm2022/table.mjs +56 -56
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs.mjs +46 -46
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +20 -20
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +11 -11
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +2 -2
- package/fesm2022/tree.mjs +26 -26
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/index.d.ts +2 -2
- package/{form-field.d-CIxjiZIX.d.ts → form-field.d-C6p5uYjG.d.ts} +4 -2
- package/input/index.d.ts +4 -4
- package/{module.d-CDrqNC7Q.d.ts → module.d-D1Ym5Wf2.d.ts} +1 -1
- package/{module.d-DZ8DPHcV.d.ts → module.d-DMabQ4_c.d.ts} +2 -2
- package/package.json +2 -2
- package/paginator/index.d.ts +5 -5
- package/{paginator.d-Ci_wE-RV.d.ts → paginator.d-DuJ-oYgT.d.ts} +1 -1
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-generate/theme-color/index_bundled.js +2 -2
- package/schematics/ng-generate/theme-color/index_bundled.js.map +1 -1
- package/schematics/ng-update/index_bundled.js +54 -2
- package/schematics/ng-update/index_bundled.js.map +1 -1
- package/select/index.d.ts +3 -3
- package/table/index.d.ts +2 -2
- package/core/tokens/m3/_md-ref-palette.scss +0 -100
- package/core/tokens/m3/_md-ref-typeface.scss +0 -14
- package/fesm2022/form-field-B3aq6ikj.mjs.map +0 -1
- package/fesm2022/index-BHJ4tVIe.mjs +0 -22
- package/fesm2022/index-D2rZ0V78.mjs +0 -20
- package/fesm2022/pseudo-checkbox-module-Dxth-mPi.mjs +0 -20
package/badge/_badge-theme.scss
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
@use 'sass
|
|
2
|
-
@use '../core/theming/theming';
|
|
1
|
+
@use '../core/style/sass-utils';
|
|
3
2
|
@use '../core/theming/inspection';
|
|
3
|
+
@use '../core/theming/theming';
|
|
4
4
|
@use '../core/theming/validation';
|
|
5
|
+
@use '../core/tokens/token-utils';
|
|
5
6
|
@use '../core/typography/typography';
|
|
6
7
|
@use './m2-badge';
|
|
7
|
-
@use '
|
|
8
|
-
@use '
|
|
8
|
+
@use './m3-badge';
|
|
9
|
+
@use 'sass:color';
|
|
10
|
+
@use 'sass:map';
|
|
9
11
|
|
|
10
12
|
/// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
|
|
11
13
|
/// for the mat-badge.
|
|
12
14
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
13
15
|
@mixin base($theme) {
|
|
14
16
|
@if inspection.get-theme-version($theme) == 1 {
|
|
15
|
-
@include
|
|
17
|
+
@include token-utils.create-token-values(
|
|
18
|
+
m3-badge.$prefix,
|
|
19
|
+
map.get(m3-badge.get-tokens($theme), base));
|
|
16
20
|
} @else {
|
|
17
21
|
@include sass-utils.current-selector-or-root() {
|
|
18
22
|
@include token-utils.create-token-values-mixed(
|
|
@@ -25,12 +29,14 @@
|
|
|
25
29
|
|
|
26
30
|
/// Outputs color theme styles for the mat-badge.
|
|
27
31
|
/// @param {Map} $theme The theme to generate color styles for.
|
|
28
|
-
/// @param {
|
|
29
|
-
///
|
|
30
|
-
///
|
|
31
|
-
@mixin color($theme, $
|
|
32
|
+
/// @param {String} $color-variant The color variant to use for
|
|
33
|
+
/// the badge: primary, secondary, tertiary, or error (If not specified,
|
|
34
|
+
/// default error color will be used).
|
|
35
|
+
@mixin color($theme, $color-variant: null) {
|
|
32
36
|
@if inspection.get-theme-version($theme) == 1 {
|
|
33
|
-
@include
|
|
37
|
+
@include token-utils.create-token-values(
|
|
38
|
+
m3-badge.$prefix,
|
|
39
|
+
map.get(m3-badge.get-tokens($theme, $color-variant), color));
|
|
34
40
|
} @else {
|
|
35
41
|
@include sass-utils.current-selector-or-root() {
|
|
36
42
|
@include token-utils.create-token-values-mixed(
|
|
@@ -59,7 +65,9 @@
|
|
|
59
65
|
/// @param {Map} $theme The theme to generate typography styles for.
|
|
60
66
|
@mixin typography($theme) {
|
|
61
67
|
@if inspection.get-theme-version($theme) == 1 {
|
|
62
|
-
@include
|
|
68
|
+
@include token-utils.create-token-values(
|
|
69
|
+
m3-badge.$prefix,
|
|
70
|
+
map.get(m3-badge.get-tokens($theme), typography));
|
|
63
71
|
} @else {
|
|
64
72
|
@include sass-utils.current-selector-or-root() {
|
|
65
73
|
@include token-utils.create-token-values-mixed(
|
|
@@ -74,7 +82,9 @@
|
|
|
74
82
|
/// @param {Map} $theme The theme to generate density styles for.
|
|
75
83
|
@mixin density($theme) {
|
|
76
84
|
@if inspection.get-theme-version($theme) == 1 {
|
|
77
|
-
|
|
85
|
+
@include token-utils.create-token-values(
|
|
86
|
+
m3-badge.$prefix,
|
|
87
|
+
map.get(m3-badge.get-tokens($theme), density));
|
|
78
88
|
} @else {
|
|
79
89
|
}
|
|
80
90
|
}
|
|
@@ -100,10 +110,13 @@
|
|
|
100
110
|
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
101
111
|
/// $color-variant: The color variant to use for the badge: primary, secondary, tertiary,
|
|
102
112
|
/// or error (If not specified, default error color will be used).
|
|
103
|
-
@mixin theme($theme, $
|
|
113
|
+
@mixin theme($theme, $color-variant: null) {
|
|
104
114
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-badge') {
|
|
105
115
|
@if inspection.get-theme-version($theme) == 1 {
|
|
106
|
-
@include
|
|
116
|
+
@include base($theme);
|
|
117
|
+
@include color($theme, $color-variant);
|
|
118
|
+
@include density($theme);
|
|
119
|
+
@include typography($theme);
|
|
107
120
|
} @else {
|
|
108
121
|
@include base($theme);
|
|
109
122
|
@if inspection.theme-has($theme, color) {
|
package/badge/_m3-badge.scss
CHANGED
|
@@ -1,81 +1,53 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../core/style/sass-utils';
|
|
3
2
|
@use '../core/tokens/m3-utils';
|
|
4
3
|
|
|
5
4
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
6
5
|
$prefix: (mat, badge);
|
|
7
6
|
|
|
8
7
|
/// Generates custom tokens for the mat-badge.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
$tokens: (
|
|
15
|
-
background-color: map.get($systems, md-sys-color, error),
|
|
16
|
-
text-color: map.get($systems, md-sys-color, on-error),
|
|
17
|
-
disabled-state-background-color: sass-utils.safe-color-change(
|
|
18
|
-
map.get($systems, md-sys-color, error),
|
|
19
|
-
$alpha: 0.38),
|
|
20
|
-
disabled-state-text-color: map.get($systems, md-sys-color, on-error),
|
|
21
|
-
text-font: map.get($systems, md-sys-typescale, label-small-font),
|
|
22
|
-
text-size: map.get($systems, md-sys-typescale, label-small-size),
|
|
23
|
-
text-weight: map.get($systems, md-sys-typescale, label-small-weight),
|
|
24
|
-
small-size-text-size: m3-utils.hardcode(0, $exclude-hardcoded),
|
|
25
|
-
container-shape: map.get($systems, md-sys-shape, corner-full),
|
|
26
|
-
container-size: m3-utils.hardcode(16px, $exclude-hardcoded),
|
|
27
|
-
line-height: m3-utils.hardcode(16px, $exclude-hardcoded),
|
|
28
|
-
legacy-container-size: m3-utils.hardcode(unset, $exclude-hardcoded),
|
|
29
|
-
legacy-small-size-container-size: m3-utils.hardcode(unset, $exclude-hardcoded),
|
|
30
|
-
small-size-container-size: m3-utils.hardcode(6px, $exclude-hardcoded),
|
|
31
|
-
small-size-line-height: m3-utils.hardcode(6px, $exclude-hardcoded),
|
|
32
|
-
container-padding: m3-utils.hardcode(0 4px, $exclude-hardcoded),
|
|
33
|
-
small-size-container-padding: m3-utils.hardcode(0, $exclude-hardcoded),
|
|
34
|
-
container-offset: m3-utils.hardcode(-12px 0, $exclude-hardcoded),
|
|
35
|
-
small-size-container-offset: m3-utils.hardcode(-6px 0, $exclude-hardcoded),
|
|
36
|
-
container-overlap-offset: m3-utils.hardcode(-12px, $exclude-hardcoded),
|
|
37
|
-
small-size-container-overlap-offset: m3-utils.hardcode(-6px, $exclude-hardcoded),
|
|
38
|
-
|
|
39
|
-
// This size isn't in the M3 spec so we emit the same values as for `medium`.
|
|
40
|
-
large-size-container-size: m3-utils.hardcode(16px, $exclude-hardcoded),
|
|
41
|
-
large-size-line-height: m3-utils.hardcode(16px, $exclude-hardcoded),
|
|
42
|
-
large-size-container-offset: m3-utils.hardcode(-12px 0, $exclude-hardcoded),
|
|
43
|
-
large-size-container-overlap-offset: m3-utils.hardcode(-12px, $exclude-hardcoded),
|
|
44
|
-
large-size-text-size: map.get($systems, md-sys-typescale, label-small-size),
|
|
45
|
-
large-size-container-padding: m3-utils.hardcode(0 4px, $exclude-hardcoded),
|
|
46
|
-
legacy-large-size-container-size: m3-utils.hardcode(unset, $exclude-hardcoded),
|
|
47
|
-
);
|
|
8
|
+
@function get-tokens($theme, $color-variant: null) {
|
|
9
|
+
$system: m3-utils.get-system($theme);
|
|
10
|
+
@if $color-variant {
|
|
11
|
+
$system: m3-utils.replace-colors-with-variant($system, error, $color-variant);
|
|
12
|
+
}
|
|
48
13
|
|
|
49
|
-
$
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
14
|
+
$tokens: (
|
|
15
|
+
base: (
|
|
16
|
+
container-shape: map.get($system, corner-full),
|
|
17
|
+
container-size: 16px,
|
|
18
|
+
legacy-container-size: unset,
|
|
19
|
+
legacy-small-size-container-size: unset,
|
|
20
|
+
small-size-container-size: 6px,
|
|
21
|
+
container-padding: 0 4px,
|
|
22
|
+
small-size-container-padding: 0,
|
|
23
|
+
container-offset: -12px 0,
|
|
24
|
+
small-size-container-offset: -6px 0,
|
|
25
|
+
container-overlap-offset: -12px,
|
|
26
|
+
small-size-container-overlap-offset: -6px,
|
|
27
|
+
large-size-container-size: 16px,
|
|
28
|
+
large-size-container-offset: -12px 0,
|
|
29
|
+
large-size-container-overlap-offset: -12px,
|
|
30
|
+
large-size-container-padding: 0 4px,
|
|
31
|
+
legacy-large-size-container-size: unset,
|
|
58
32
|
),
|
|
59
|
-
|
|
60
|
-
background-color: map.get($
|
|
61
|
-
text-color: map.get($
|
|
62
|
-
disabled-state-background-color:
|
|
63
|
-
|
|
64
|
-
$alpha: 0.38,
|
|
65
|
-
),
|
|
66
|
-
disabled-state-text-color: map.get($systems, md-sys-color, on-secondary),
|
|
33
|
+
color: (
|
|
34
|
+
background-color: map.get($system, error),
|
|
35
|
+
text-color: map.get($system, on-error),
|
|
36
|
+
disabled-state-background-color: m3-utils.color-with-opacity(map.get($system, error), 38%),
|
|
37
|
+
disabled-state-text-color: map.get($system, on-error),
|
|
67
38
|
),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
text-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
39
|
+
typography: (
|
|
40
|
+
text-font: map.get($system, label-small-font),
|
|
41
|
+
text-size: map.get($system, label-small-size),
|
|
42
|
+
text-weight: map.get($system, label-small-weight),
|
|
43
|
+
large-size-text-size: map.get($system, label-small-size),
|
|
44
|
+
small-size-text-size: 0,
|
|
45
|
+
line-height: 16px,
|
|
46
|
+
small-size-line-height: 6px,
|
|
47
|
+
large-size-line-height: 16px,
|
|
76
48
|
),
|
|
77
|
-
|
|
49
|
+
density: (),
|
|
78
50
|
);
|
|
79
51
|
|
|
80
|
-
@return
|
|
52
|
+
@return $tokens;
|
|
81
53
|
}
|
|
@@ -17,7 +17,7 @@ $prefix: (mat, button-toggle);
|
|
|
17
17
|
$tokens: sass-utils.merge-all(
|
|
18
18
|
m3-utils.generate-typography-tokens($systems, label-text, label-large),
|
|
19
19
|
(
|
|
20
|
-
shape: map.get($systems, md-sys-shape, corner-
|
|
20
|
+
shape: map.get($systems, md-sys-shape, corner-extra-large),
|
|
21
21
|
hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
|
|
22
22
|
focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
|
|
23
23
|
text-color: map.get($systems, md-sys-color, on-surface),
|
|
@@ -125,6 +125,47 @@
|
|
|
125
125
|
@include timepicker-theme.base($theme);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
@mixin all-component-colors($theme) {
|
|
129
|
+
@include core-theme.color($theme);
|
|
130
|
+
@include card-theme.color($theme);
|
|
131
|
+
@include progress-bar-theme.color($theme);
|
|
132
|
+
@include tooltip-theme.color($theme);
|
|
133
|
+
@include form-field-theme.color($theme);
|
|
134
|
+
@include input-theme.color($theme);
|
|
135
|
+
@include select-theme.color($theme);
|
|
136
|
+
@include autocomplete-theme.color($theme);
|
|
137
|
+
@include dialog-theme.color($theme);
|
|
138
|
+
@include chips-theme.color($theme);
|
|
139
|
+
@include slide-toggle-theme.color($theme);
|
|
140
|
+
@include radio-theme.color($theme);
|
|
141
|
+
@include slider-theme.color($theme);
|
|
142
|
+
@include menu-theme.color($theme);
|
|
143
|
+
@include list-theme.color($theme);
|
|
144
|
+
@include paginator-theme.color($theme);
|
|
145
|
+
@include tabs-theme.color($theme);
|
|
146
|
+
@include checkbox-theme.color($theme);
|
|
147
|
+
@include button-theme.color($theme);
|
|
148
|
+
@include icon-button-theme.color($theme);
|
|
149
|
+
@include fab-theme.color($theme);
|
|
150
|
+
@include snack-bar-theme.color($theme);
|
|
151
|
+
@include table-theme.color($theme);
|
|
152
|
+
@include progress-spinner-theme.color($theme);
|
|
153
|
+
@include badge-theme.color($theme);
|
|
154
|
+
@include bottom-sheet-theme.color($theme);
|
|
155
|
+
@include button-toggle-theme.color($theme);
|
|
156
|
+
@include datepicker-theme.color($theme);
|
|
157
|
+
@include divider-theme.color($theme);
|
|
158
|
+
@include expansion-theme.color($theme);
|
|
159
|
+
@include grid-list-theme.color($theme);
|
|
160
|
+
@include icon-theme.color($theme);
|
|
161
|
+
@include sidenav-theme.color($theme);
|
|
162
|
+
@include stepper-theme.color($theme);
|
|
163
|
+
@include sort-theme.color($theme);
|
|
164
|
+
@include toolbar-theme.color($theme);
|
|
165
|
+
@include tree-theme.color($theme);
|
|
166
|
+
@include timepicker-theme.color($theme);
|
|
167
|
+
}
|
|
168
|
+
|
|
128
169
|
// @deprecated Use `all-component-themes`.
|
|
129
170
|
@mixin angular-material-theme($theme) {
|
|
130
171
|
@include all-component-themes($theme);
|
|
@@ -119,23 +119,20 @@ $_overrides-only: true;
|
|
|
119
119
|
@include _color-variant-styles($theme, primary);
|
|
120
120
|
}
|
|
121
121
|
.mat-badge {
|
|
122
|
-
@include badge-theme.color($theme, $color-variant: primary
|
|
123
|
-
$emit-overrides-only: $_overrides-only);
|
|
122
|
+
@include badge-theme.color($theme, $color-variant: primary);
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
.mat-accent {
|
|
127
126
|
@include _color-variant-styles($theme, tertiary);
|
|
128
127
|
}
|
|
129
128
|
.mat-badge-accent {
|
|
130
|
-
@include badge-theme.color($theme, $color-variant: tertiary
|
|
131
|
-
$emit-overrides-only: $_overrides-only);
|
|
129
|
+
@include badge-theme.color($theme, $color-variant: tertiary);
|
|
132
130
|
}
|
|
133
131
|
|
|
134
132
|
.mat-warn {
|
|
135
133
|
@include _color-variant-styles($theme, error);
|
|
136
134
|
}
|
|
137
135
|
.mat-badge-warn {
|
|
138
|
-
@include badge-theme.color($theme, $color-variant: error
|
|
139
|
-
$emit-overrides-only: $_overrides-only);
|
|
136
|
+
@include badge-theme.color($theme, $color-variant: error);
|
|
140
137
|
}
|
|
141
138
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@use './palettes';
|
|
6
6
|
@use '../tokens/m3-tokens';
|
|
7
7
|
@use './config-validation';
|
|
8
|
+
@use '../tokens/m3';
|
|
8
9
|
|
|
9
10
|
// Prefix used for component token fallback variables, e.g.
|
|
10
11
|
// `color: var(--mat-text-button-label-text-color, var(--mat-sys-primary));`
|
|
@@ -18,6 +19,7 @@ $system-level-prefix: mat-sys;
|
|
|
18
19
|
|
|
19
20
|
/// Map key used to store internals of theme config.
|
|
20
21
|
$internals: _mat-theming-internals-do-not-access;
|
|
22
|
+
|
|
21
23
|
/// The theme version of generated themes.
|
|
22
24
|
$theme-version: 1;
|
|
23
25
|
|
|
@@ -30,97 +32,95 @@ $theme-version: 1;
|
|
|
30
32
|
@error $err;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
$color-config: map.get($config, color) or ();
|
|
36
|
+
$typography-config: map.get($config, typography) or ();
|
|
37
|
+
$density-config: map.get($config, density) or ();
|
|
38
|
+
|
|
39
|
+
// colors
|
|
40
|
+
$type: map.get($color-config, theme-type) or light;
|
|
41
|
+
$primary: map.get($color-config, primary) or palettes.$violet-palette;
|
|
42
|
+
$tertiary: map.get($color-config, tertiary) or $primary;
|
|
43
|
+
$color-system-variables-prefix:
|
|
44
|
+
map.get($color-config, system-variables-prefix) or $system-level-prefix;
|
|
45
|
+
sass-utils.$use-system-color-variables: map.get($color-config, use-system-variables) or false;
|
|
46
|
+
|
|
47
|
+
$palettes: (
|
|
48
|
+
primary: map.remove($primary, neutral, neutral-variant, secondary),
|
|
49
|
+
secondary: map.get($primary, secondary),
|
|
50
|
+
tertiary: map.remove($tertiary, neutral, neutral-variant, secondary, error),
|
|
51
|
+
neutral: map.get($primary, neutral),
|
|
52
|
+
neutral-variant: map.get($primary, neutral-variant),
|
|
53
|
+
error: map.get($primary, error),
|
|
38
54
|
);
|
|
39
|
-
}
|
|
40
55
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
$
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
// typography
|
|
57
|
+
$default-plain: (Roboto, sans-serif);
|
|
58
|
+
$default-brand: $default-plain;
|
|
59
|
+
$plain: map.get($typography-config, plain-family) or $default-plain;
|
|
60
|
+
$brand: map.get($typography-config, brand-family) or $default-brand;
|
|
61
|
+
$bold: map.get($typography-config, bold-weight) or 700;
|
|
62
|
+
$medium: map.get($typography-config, medium-weight) or 500;
|
|
63
|
+
$regular: map.get($typography-config, regular-weight) or 400;
|
|
64
|
+
$typography-system-variables-prefix: map.get($typography-config, system-variables-prefix) or
|
|
65
|
+
$system-level-prefix;
|
|
66
|
+
sass-utils.$use-system-typography-variables:
|
|
67
|
+
map.get($typography-config, use-system-variables) or false;
|
|
68
|
+
$typography: (
|
|
69
|
+
plain: $plain,
|
|
70
|
+
brand: $brand,
|
|
71
|
+
bold: $bold,
|
|
72
|
+
medium: $medium,
|
|
73
|
+
regular: $regular,
|
|
74
|
+
);
|
|
49
75
|
|
|
50
|
-
|
|
51
|
-
$
|
|
52
|
-
$tertiary: map.get($config, tertiary) or $primary;
|
|
53
|
-
$system-variables-prefix: map.get($config, system-variables-prefix) or $system-level-prefix;
|
|
54
|
-
sass-utils.$use-system-color-variables: map.get($config, use-system-variables) or false;
|
|
76
|
+
// density
|
|
77
|
+
$density-scale: map.get($density-config, scale) or 0;
|
|
55
78
|
|
|
56
79
|
@return (
|
|
57
80
|
$internals: (
|
|
58
|
-
|
|
81
|
+
base-tokens: m3-tokens.generate-base-tokens(),
|
|
82
|
+
color-system-variables-prefix: $color-system-variables-prefix,
|
|
83
|
+
color-tokens:
|
|
84
|
+
m3-tokens.generate-color-tokens($type, $palettes, $color-system-variables-prefix),
|
|
85
|
+
density-scale: $density-scale,
|
|
86
|
+
font-definition: $typography,
|
|
87
|
+
md-sys-color: m3-tokens.get-sys-color($type, $palettes, $color-system-variables-prefix),
|
|
88
|
+
md-sys-elevation: m3.md-sys-elevation-values(),
|
|
89
|
+
md-sys-motion: m3.md-sys-motion-values(),
|
|
90
|
+
md-sys-shape: m3.md-sys-shape-values(),
|
|
91
|
+
md-sys-state: m3.md-sys-state-values(),
|
|
92
|
+
md-sys-typescale:
|
|
93
|
+
m3-tokens.get-sys-typeface($typography, $typography-system-variables-prefix),
|
|
94
|
+
palettes: $palettes,
|
|
59
95
|
theme-type: $type,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
neutral: map.get($primary, neutral),
|
|
65
|
-
neutral-variant: map.get($primary, neutral-variant),
|
|
66
|
-
error: map.get($primary, error),
|
|
67
|
-
),
|
|
68
|
-
color-system-variables-prefix: $system-variables-prefix,
|
|
69
|
-
color-tokens: m3-tokens.generate-color-tokens(
|
|
70
|
-
$type, $primary, $tertiary, map.get($primary, error), $system-variables-prefix)
|
|
96
|
+
theme-version: $theme-version,
|
|
97
|
+
typography-system-variables-prefix: $typography-system-variables-prefix,
|
|
98
|
+
typography-tokens:
|
|
99
|
+
m3-tokens.generate-typography-tokens($typography, $typography-system-variables-prefix),
|
|
71
100
|
)
|
|
72
101
|
);
|
|
73
102
|
}
|
|
74
103
|
|
|
104
|
+
/// Defines an Angular Material theme object with color settings.
|
|
105
|
+
/// @param {Map} $config The color configuration
|
|
106
|
+
/// @return {Map} A theme object
|
|
107
|
+
/// @deprecated Use define-theme with a map using the "color" key
|
|
108
|
+
@function define-colors($config: ()) {
|
|
109
|
+
@return define-theme((color: $config));
|
|
110
|
+
}
|
|
111
|
+
|
|
75
112
|
/// Defines an Angular Material theme object with typography settings.
|
|
76
113
|
/// @param {Map} $config The typography configuration
|
|
77
114
|
/// @return {Map} A theme object
|
|
115
|
+
/// @deprecated Use define-theme with a map using the "typography" key
|
|
78
116
|
@function define-typography($config: ()) {
|
|
79
|
-
|
|
80
|
-
@if $err {
|
|
81
|
-
@error $err;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
$plain: map.get($config, plain-family) or (Roboto, sans-serif);
|
|
85
|
-
$brand: map.get($config, brand-family) or $plain;
|
|
86
|
-
$bold: map.get($config, bold-weight) or 700;
|
|
87
|
-
$medium: map.get($config, medium-weight) or 500;
|
|
88
|
-
$regular: map.get($config, regular-weight) or 400;
|
|
89
|
-
$system-variables-prefix: map.get($config, system-variables-prefix) or $system-level-prefix;
|
|
90
|
-
sass-utils.$use-system-typography-variables: map.get($config, use-system-variables) or false;
|
|
91
|
-
|
|
92
|
-
@return (
|
|
93
|
-
$internals: (
|
|
94
|
-
theme-version: $theme-version,
|
|
95
|
-
font-definition: (
|
|
96
|
-
plain: $plain,
|
|
97
|
-
brand: $brand,
|
|
98
|
-
bold: $bold,
|
|
99
|
-
medium: $medium,
|
|
100
|
-
regular: $regular,
|
|
101
|
-
),
|
|
102
|
-
typography-system-variables-prefix: $system-variables-prefix,
|
|
103
|
-
typography-tokens: m3-tokens.generate-typography-tokens(
|
|
104
|
-
$brand, $plain, $bold, $medium, $regular, $system-variables-prefix)
|
|
105
|
-
)
|
|
106
|
-
);
|
|
117
|
+
@return define-theme((typography: $config));
|
|
107
118
|
}
|
|
108
119
|
|
|
109
120
|
/// Defines an Angular Material theme object with density settings.
|
|
110
121
|
/// @param {Map} $config The density configuration
|
|
111
122
|
/// @return {Map} A theme object
|
|
123
|
+
/// @deprecated Use define-theme with a map using the "density" key
|
|
112
124
|
@function define-density($config: ()) {
|
|
113
|
-
|
|
114
|
-
@if $err {
|
|
115
|
-
@error $err;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
$density-scale: map.get($config, scale) or 0;
|
|
119
|
-
|
|
120
|
-
@return (
|
|
121
|
-
$internals: (
|
|
122
|
-
theme-version: $theme-version,
|
|
123
|
-
density-scale: $density-scale,
|
|
124
|
-
)
|
|
125
|
-
);
|
|
125
|
+
@return define-theme((density: $config));
|
|
126
126
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@use '../style/validation';
|
|
4
4
|
@use './m2-inspection';
|
|
5
5
|
|
|
6
|
-
$
|
|
6
|
+
$internals: _mat-theming-internals-do-not-access;
|
|
7
7
|
|
|
8
8
|
$_m3-typescales: (
|
|
9
9
|
display-large,
|
|
@@ -30,7 +30,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
30
30
|
/// @return {Boolean|Null} true if the theme has errors, else null.
|
|
31
31
|
@function _validate-theme-object($theme) {
|
|
32
32
|
$err: validation.validate-type($theme, 'map') or
|
|
33
|
-
map.get($theme, $
|
|
33
|
+
map.get($theme, $internals, theme-version) == null;
|
|
34
34
|
@return if($err, true, null);
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -40,7 +40,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
40
40
|
/// @return {Number} The version number of the theme (0 if unknown).
|
|
41
41
|
@function get-theme-version($theme) {
|
|
42
42
|
$err: _validate-theme-object($theme);
|
|
43
|
-
@return if($err, 0, map.get($theme, $
|
|
43
|
+
@return if($err, 0, map.get($theme, $internals, theme-version) or 0);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/// Gets the type of theme represented by a theme object (light or dark).
|
|
@@ -55,13 +55,15 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
55
55
|
@if not theme-has($theme, color) {
|
|
56
56
|
@error 'Color information is not available on this theme.';
|
|
57
57
|
}
|
|
58
|
-
@return map.get($theme, $
|
|
58
|
+
@return map.get($theme, $internals, theme-type) or light;
|
|
59
59
|
}
|
|
60
60
|
@else {
|
|
61
61
|
@error #{'Unrecognized theme version:'} $version;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
|
|
66
|
+
|
|
65
67
|
/// Gets a color from a theme object. This function take a different amount of arguments depending
|
|
66
68
|
/// on if it's working with an M2 or M3 theme:
|
|
67
69
|
/// - With an M3 theme it accepts either 2 or 3 arguments. If 2 arguments are passed, the second
|
|
@@ -119,7 +121,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
119
121
|
@if not theme-has($theme, color) {
|
|
120
122
|
@error 'Color information is not available on this theme.';
|
|
121
123
|
}
|
|
122
|
-
$color-roles: map.get($theme, $
|
|
124
|
+
$color-roles: map.get($theme, $internals, color-tokens, (mat, theme));
|
|
123
125
|
$result: map.get($color-roles, $color-role-name);
|
|
124
126
|
@if not $result {
|
|
125
127
|
@error #{'Valid color roles are: #{map.keys($color-roles)}. Got:'} $color-role-name;
|
|
@@ -141,7 +143,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
141
143
|
@if not theme-has($theme, color) {
|
|
142
144
|
@error 'Color information is not available on this theme.';
|
|
143
145
|
}
|
|
144
|
-
$palettes: map.get($theme, $
|
|
146
|
+
$palettes: map.get($theme, $internals, palettes);
|
|
145
147
|
$palette: map.get($palettes, $palette-name);
|
|
146
148
|
@if not $palette {
|
|
147
149
|
$supported-palettes: map.keys($palettes);
|
|
@@ -185,7 +187,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
185
187
|
font-weight: '-weight'
|
|
186
188
|
), $property);
|
|
187
189
|
$token-name: '#{$typescale}#{$property-key}';
|
|
188
|
-
@return map.get($theme, $
|
|
190
|
+
@return map.get($theme, $internals, typography-tokens, (mat, typography), $token-name);
|
|
189
191
|
}
|
|
190
192
|
@else {
|
|
191
193
|
@error #{'Unrecognized theme version:'} $version;
|
|
@@ -204,7 +206,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
204
206
|
@if not theme-has($theme, density) {
|
|
205
207
|
@error 'Density information is not available on this theme.';
|
|
206
208
|
}
|
|
207
|
-
@return map.get($theme, $
|
|
209
|
+
@return map.get($theme, $internals, density-scale);
|
|
208
210
|
}
|
|
209
211
|
@else {
|
|
210
212
|
@error #{'Unrecognized theme version:'} $version;
|
|
@@ -222,18 +224,18 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
222
224
|
}
|
|
223
225
|
@else if $version == 1 {
|
|
224
226
|
@if $system == base {
|
|
225
|
-
@return map.get($theme, $
|
|
227
|
+
@return map.get($theme, $internals, base-tokens) != null;
|
|
226
228
|
}
|
|
227
229
|
@if $system == color {
|
|
228
|
-
@return map.get($theme, $
|
|
229
|
-
map.get($theme, $
|
|
230
|
-
map.get($theme, $
|
|
230
|
+
@return map.get($theme, $internals, color-tokens) != null and
|
|
231
|
+
map.get($theme, $internals, theme-type) != null and
|
|
232
|
+
map.get($theme, $internals, palettes) != null;
|
|
231
233
|
}
|
|
232
234
|
@if $system == typography {
|
|
233
|
-
@return map.get($theme, $
|
|
235
|
+
@return map.get($theme, $internals, typography-tokens) != null;
|
|
234
236
|
}
|
|
235
237
|
@if $system == density {
|
|
236
|
-
@return map.get($theme, $
|
|
238
|
+
@return map.get($theme, $internals, density-scale) != null;
|
|
237
239
|
}
|
|
238
240
|
@error 'Valid systems are: base, color, typography, density. Got:' $system;
|
|
239
241
|
}
|
|
@@ -259,19 +261,19 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
259
261
|
@else if $version == 1 {
|
|
260
262
|
@each $system in $systems {
|
|
261
263
|
@if $system == base {
|
|
262
|
-
$theme: map.deep-remove($theme, $
|
|
264
|
+
$theme: map.deep-remove($theme, $internals, base-tokens);
|
|
263
265
|
}
|
|
264
266
|
@else if $system == color {
|
|
265
|
-
$theme: map.deep-remove($theme, $
|
|
266
|
-
$theme: map.deep-remove($theme, $
|
|
267
|
-
$theme: map.deep-remove($theme, $
|
|
267
|
+
$theme: map.deep-remove($theme, $internals, color-tokens);
|
|
268
|
+
$theme: map.deep-remove($theme, $internals, theme-type);
|
|
269
|
+
$theme: map.deep-remove($theme, $internals, palettes);
|
|
268
270
|
}
|
|
269
271
|
@else if $system == typography {
|
|
270
|
-
$theme: map.deep-remove($theme, $
|
|
272
|
+
$theme: map.deep-remove($theme, $internals, typography-tokens);
|
|
271
273
|
}
|
|
272
274
|
@else if $system == density {
|
|
273
|
-
$theme: map.deep-remove($theme, $
|
|
274
|
-
$theme: map.deep-remove($theme, $
|
|
275
|
+
$theme: map.deep-remove($theme, $internals, density-scale);
|
|
276
|
+
$theme: map.deep-remove($theme, $internals, density-tokens);
|
|
275
277
|
}
|
|
276
278
|
}
|
|
277
279
|
@return $theme;
|
|
@@ -297,7 +299,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
|
|
|
297
299
|
}
|
|
298
300
|
$result: ();
|
|
299
301
|
@each $system in $systems {
|
|
300
|
-
$result: map.deep-merge($result, map.get($theme, $
|
|
302
|
+
$result: map.deep-merge($result, map.get($theme, $internals, '#{$system}-tokens') or ());
|
|
301
303
|
}
|
|
302
304
|
|
|
303
305
|
@return $result;
|