@angular/material 17.0.0-next.0 → 17.0.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 +2 -2
- package/button/_button-base.scss +3 -3
- package/button/_button-theme-private.scss +3 -2
- package/button/_button-theme.scss +18 -25
- package/button/_fab-theme.scss +31 -49
- package/button/_icon-button-theme.scss +19 -26
- package/button/index.d.ts +22 -31
- package/card/_card-theme.scss +27 -38
- package/checkbox/_checkbox-theme.scss +28 -45
- package/core/_core-theme.scss +24 -39
- package/core/mdc-helpers/_mdc-helpers.scss +19 -22
- package/core/option/_optgroup-theme.scss +13 -23
- package/core/option/_option-theme.scss +23 -37
- package/core/ripple/_ripple-theme.scss +6 -10
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +17 -24
- package/core/style/_private.scss +3 -3
- package/core/style/_sass-utils.scss +7 -0
- package/core/theming/_inspection.scss +87 -60
- package/core/theming/_m2-inspection.scss +211 -0
- package/core/theming/_theming.scss +59 -6
- package/core/tokens/m2/mat/_card.scss +15 -21
- package/core/tokens/m2/mat/_form-field.scss +21 -25
- package/core/tokens/m2/mat/_optgroup.scss +12 -17
- package/core/tokens/m2/mat/_option.scss +16 -28
- package/core/tokens/m2/mat/_paginator.scss +16 -18
- package/core/tokens/m2/mat/_radio.scss +7 -10
- package/core/tokens/m2/mat/_slide-toggle.scss +9 -17
- package/core/tokens/m2/mat/_slider.scss +5 -5
- package/core/tokens/m2/mdc/_checkbox.scss +21 -20
- package/core/tokens/m2/mdc/_elevated-card.scss +6 -9
- package/core/tokens/m2/mdc/_extended-fab.scss +8 -17
- package/core/tokens/m2/mdc/_fab.scss +6 -7
- package/core/tokens/m2/mdc/_filled-text-field.scss +16 -22
- package/core/tokens/m2/mdc/_icon-button.scss +1 -1
- package/core/tokens/m2/mdc/_linear-progress.scss +9 -10
- package/core/tokens/m2/mdc/_list.scss +44 -42
- package/core/tokens/m2/mdc/_outlined-card.scss +7 -10
- package/core/tokens/m2/mdc/_outlined-text-field.scss +14 -20
- package/core/tokens/m2/mdc/_radio.scss +11 -11
- package/core/tokens/m2/mdc/_slider.scss +16 -23
- package/core/tokens/m2/mdc/_switch.scss +16 -19
- package/core/typography/_definition.scss +258 -0
- package/core/typography/_property-getters.scss +63 -0
- package/core/typography/_typography-utils.scss +9 -69
- package/core/typography/_typography.scss +10 -343
- package/core/typography/_versioning.scss +86 -0
- package/datepicker/index.d.ts +3 -3
- package/dialog/_dialog-theme.scss +10 -0
- package/esm2022/autocomplete/autocomplete.mjs +1 -1
- package/esm2022/button/button-base.mjs +32 -27
- package/esm2022/button/button.mjs +6 -6
- package/esm2022/button/fab.mjs +23 -31
- package/esm2022/button/icon-button.mjs +6 -6
- package/esm2022/button/testing/button-harness.mjs +3 -3
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar.mjs +1 -1
- package/esm2022/datepicker/datepicker-base.mjs +2 -2
- package/esm2022/datepicker/datepicker-toggle.mjs +1 -1
- package/esm2022/datepicker/month-view.mjs +2 -2
- package/esm2022/datepicker/multi-year-view.mjs +2 -2
- package/esm2022/datepicker/year-view.mjs +2 -2
- package/esm2022/dialog/dialog-container.mjs +2 -2
- package/esm2022/form-field/form-field.mjs +3 -3
- package/esm2022/paginator/paginator.mjs +1 -1
- package/esm2022/select/select.mjs +3 -3
- package/esm2022/slider/slider-input.mjs +19 -9
- package/esm2022/slider/slider.mjs +2 -2
- package/esm2022/snack-bar/simple-snack-bar.mjs +1 -1
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/button/testing.mjs +2 -2
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button.mjs +59 -61
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +6 -6
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +2 -2
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/paginator.mjs +1 -1
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/select.mjs +2 -2
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/slider.mjs +20 -10
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +1 -1
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/form-field/_form-field-density.scss +3 -4
- package/form-field/_form-field-focus-overlay.scss +1 -1
- package/form-field/_form-field-theme.scss +24 -34
- package/input/_input-theme.scss +11 -23
- package/list/_list-theme.scss +26 -41
- package/package.json +2 -2
- package/paginator/_paginator-theme.scss +15 -24
- 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/_progress-bar-theme.scss +17 -24
- package/progress-spinner/_progress-spinner-theme.scss +3 -3
- package/radio/_radio-theme.scss +23 -38
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/slide-toggle/_slide-toggle-theme.scss +23 -40
- package/slider/_slider-theme.scss +25 -42
- package/snack-bar/_snack-bar-theme.scss +2 -2
- package/button-toggle/_button-toggle-variables.scss +0 -16
- package/paginator/_paginator-variables.scss +0 -15
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../theming/
|
|
4
|
-
@use '../../../typography/typography-utils';
|
|
2
|
+
@use '../../../theming/inspection';
|
|
5
3
|
@use '../../../style/sass-utils';
|
|
6
4
|
|
|
7
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -14,45 +12,41 @@ $prefix: (mat, card);
|
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
17
|
-
@function get-color-tokens($
|
|
18
|
-
$foreground: map.get($config, foreground);
|
|
19
|
-
|
|
15
|
+
@function get-color-tokens($theme) {
|
|
20
16
|
@return (
|
|
21
17
|
// Text color of the card's subtitle.
|
|
22
|
-
subtitle-text-color:
|
|
18
|
+
subtitle-text-color: inspection.get-theme-color($theme, foreground, secondary-text),
|
|
23
19
|
);
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
27
|
-
@function get-typography-tokens($
|
|
23
|
+
@function get-typography-tokens($theme) {
|
|
28
24
|
@return (
|
|
29
25
|
// Font family of the card's title.
|
|
30
|
-
title-text-font:
|
|
31
|
-
or typography-utils.font-family($config),
|
|
26
|
+
title-text-font: inspection.get-theme-typography($theme, headline-6, font-family),
|
|
32
27
|
// Line height of the card's title.
|
|
33
|
-
title-text-line-height:
|
|
28
|
+
title-text-line-height: inspection.get-theme-typography($theme, headline-6, line-height),
|
|
34
29
|
// Font size of the card's title.
|
|
35
|
-
title-text-size:
|
|
30
|
+
title-text-size: inspection.get-theme-typography($theme, headline-6, font-size),
|
|
36
31
|
// Letter spacing of the card's title.
|
|
37
|
-
title-text-tracking:
|
|
32
|
+
title-text-tracking: inspection.get-theme-typography($theme, headline-6, letter-spacing),
|
|
38
33
|
// Font weight of the card's title.
|
|
39
|
-
title-text-weight:
|
|
34
|
+
title-text-weight: inspection.get-theme-typography($theme, headline-6, font-weight),
|
|
40
35
|
// Font family of the card's subtitle.
|
|
41
|
-
subtitle-text-font:
|
|
42
|
-
or typography-utils.font-family($config),
|
|
36
|
+
subtitle-text-font: inspection.get-theme-typography($theme, subtitle-2, font-family),
|
|
43
37
|
// Line height of the card's subtitle.
|
|
44
|
-
subtitle-text-line-height:
|
|
38
|
+
subtitle-text-line-height: inspection.get-theme-typography($theme, subtitle-2, line-height),
|
|
45
39
|
// Font size of the card's subtitle.
|
|
46
|
-
subtitle-text-size:
|
|
40
|
+
subtitle-text-size: inspection.get-theme-typography($theme, subtitle-2, font-size),
|
|
47
41
|
// Letter spacing of the card's subtitle.
|
|
48
|
-
subtitle-text-tracking:
|
|
42
|
+
subtitle-text-tracking: inspection.get-theme-typography($theme, subtitle-2, letter-spacing),
|
|
49
43
|
// Font weight of the card's subtitle.
|
|
50
|
-
subtitle-text-weight:
|
|
44
|
+
subtitle-text-weight: inspection.get-theme-typography($theme, subtitle-2, font-weight),
|
|
51
45
|
);
|
|
52
46
|
}
|
|
53
47
|
|
|
54
48
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
55
|
-
@function get-density-tokens($
|
|
49
|
+
@function get-density-tokens($theme) {
|
|
56
50
|
@return ();
|
|
57
51
|
}
|
|
58
52
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../../token-utils';
|
|
3
3
|
@use '../../../style/sass-utils';
|
|
4
|
-
@use '../../../theming/
|
|
4
|
+
@use '../../../theming/inspection';
|
|
5
5
|
@use '../../../theming/palette';
|
|
6
|
-
@use '../../../typography/typography-utils';
|
|
7
6
|
|
|
8
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
8
|
$prefix: (mat, form-field);
|
|
@@ -15,17 +14,16 @@ $prefix: (mat, form-field);
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
-
@function get-color-tokens($
|
|
19
|
-
$
|
|
20
|
-
$is-dark: map.get($config, is-dark);
|
|
17
|
+
@function get-color-tokens($theme) {
|
|
18
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
21
19
|
$on-surface: if($is-dark, #fff, #000);
|
|
22
|
-
$color-tokens: private-get-color-palette-color-tokens($
|
|
20
|
+
$color-tokens: private-get-color-palette-color-tokens($theme, primary);
|
|
23
21
|
|
|
24
22
|
@return map.merge($color-tokens, (
|
|
25
23
|
// MDC has a token for the enabled placeholder, but not for the disabled one.
|
|
26
24
|
disabled-input-text-placeholder-color: rgba($on-surface, 0.38),
|
|
27
25
|
state-layer-color: rgba($on-surface, 0.87),
|
|
28
|
-
error-text-color:
|
|
26
|
+
error-text-color: inspection.get-theme-color($theme, warn),
|
|
29
27
|
|
|
30
28
|
// On dark themes we set the native `select` color to some shade of white,
|
|
31
29
|
// however the color propagates to all of the `option` elements, which are
|
|
@@ -48,27 +46,25 @@ $prefix: (mat, form-field);
|
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
// Generates the mapping for the properties that change based on the form field color.
|
|
51
|
-
@function private-get-color-palette-color-tokens($
|
|
52
|
-
$palette:
|
|
49
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
50
|
+
$palette-color: inspection.get-theme-color($theme, $palette-name);
|
|
53
51
|
|
|
54
52
|
@return (
|
|
55
|
-
focus-select-arrow-color:
|
|
53
|
+
focus-select-arrow-color: sass-utils.safe-color-change($palette-color, $alpha: 0.87),
|
|
56
54
|
);
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
60
|
-
@function get-typography-tokens($
|
|
61
|
-
$fallback-font-family: typography-utils.font-family($config);
|
|
62
|
-
|
|
58
|
+
@function get-typography-tokens($theme) {
|
|
63
59
|
@return (
|
|
64
60
|
// MDC uses `subtitle1` for the input value, placeholder and floating label. The spec
|
|
65
61
|
// shows `body1` for text fields though, so we manually override the typography.
|
|
66
62
|
// Note: Form controls inherit the typography from the parent form field.
|
|
67
|
-
container-text-font:
|
|
68
|
-
container-text-line-height:
|
|
69
|
-
container-text-size:
|
|
70
|
-
container-text-tracking:
|
|
71
|
-
container-text-weight:
|
|
63
|
+
container-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
64
|
+
container-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
|
|
65
|
+
container-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
66
|
+
container-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
67
|
+
container-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
|
|
72
68
|
|
|
73
69
|
// In the container styles, we updated the floating label to use the `body-1` typography level.
|
|
74
70
|
// The MDC notched outline overrides this accidentally (only when the label floats) to a
|
|
@@ -78,18 +74,18 @@ $prefix: (mat, form-field);
|
|
|
78
74
|
// https://github.com/material-components/material-components-web/blob/master/packages/mdc-notched-outline/_mixins.scss#L272-L292.
|
|
79
75
|
// This is why we can't use their `label-text-populated-size` token and we have to declare
|
|
80
76
|
// our own version of it.
|
|
81
|
-
outlined-label-text-populated-size:
|
|
77
|
+
outlined-label-text-populated-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
82
78
|
|
|
83
|
-
subscript-text-font:
|
|
84
|
-
subscript-text-line-height:
|
|
85
|
-
subscript-text-size:
|
|
86
|
-
subscript-text-tracking:
|
|
87
|
-
subscript-text-weight:
|
|
79
|
+
subscript-text-font: inspection.get-theme-typography($theme, caption, font-family),
|
|
80
|
+
subscript-text-line-height: inspection.get-theme-typography($theme, caption, line-height),
|
|
81
|
+
subscript-text-size: inspection.get-theme-typography($theme, caption, font-size),
|
|
82
|
+
subscript-text-tracking: inspection.get-theme-typography($theme, caption, letter-spacing),
|
|
83
|
+
subscript-text-weight: inspection.get-theme-typography($theme, caption, font-weight),
|
|
88
84
|
);
|
|
89
85
|
}
|
|
90
86
|
|
|
91
87
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
92
|
-
@function get-density-tokens($
|
|
88
|
+
@function get-density-tokens($theme) {
|
|
93
89
|
@return ();
|
|
94
90
|
}
|
|
95
91
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../theming/
|
|
2
|
+
@use '../../../theming/inspection';
|
|
4
3
|
@use '../../../style/sass-utils';
|
|
5
|
-
@use '../../../typography/typography-utils';
|
|
6
4
|
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
5
|
|
|
8
6
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -15,36 +13,33 @@ $prefix: (mat, optgroup);
|
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
-
@function get-color-tokens($
|
|
19
|
-
$foreground: map.get($config, foreground);
|
|
20
|
-
|
|
16
|
+
@function get-color-tokens($theme) {
|
|
21
17
|
@return (
|
|
22
|
-
label-text-color:
|
|
18
|
+
label-text-color: inspection.get-theme-color($theme, foreground, text),
|
|
23
19
|
);
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
27
|
-
@function get-typography-tokens($
|
|
23
|
+
@function get-typography-tokens($theme) {
|
|
28
24
|
// TODO(crisbeto): The earlier implementation of the option used MDC's APIs to create the
|
|
29
25
|
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
|
|
30
26
|
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
|
|
31
27
|
// fallback.
|
|
32
|
-
@if ($
|
|
33
|
-
$
|
|
28
|
+
@if ($theme == null) {
|
|
29
|
+
$theme: mdc-helpers.private-fallback-typography-from-mdc();
|
|
34
30
|
}
|
|
35
31
|
|
|
36
32
|
@return (
|
|
37
|
-
label-text-font:
|
|
38
|
-
|
|
39
|
-
label-text-
|
|
40
|
-
label-text-
|
|
41
|
-
label-text-
|
|
42
|
-
label-text-weight: typography-utils.font-weight($config, body-1)
|
|
33
|
+
label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
34
|
+
label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
|
|
35
|
+
label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
36
|
+
label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
37
|
+
label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight)
|
|
43
38
|
);
|
|
44
39
|
}
|
|
45
40
|
|
|
46
41
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
47
|
-
@function get-density-tokens($
|
|
42
|
+
@function get-density-tokens($theme) {
|
|
48
43
|
@return ();
|
|
49
44
|
}
|
|
50
45
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../theming/
|
|
2
|
+
@use '../../../theming/inspection';
|
|
4
3
|
@use '../../../style/sass-utils';
|
|
5
|
-
@use '../../../typography/typography-utils';
|
|
6
4
|
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
5
|
|
|
8
6
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -15,51 +13,41 @@ $prefix: (mat, option);
|
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
-
@function get-color-tokens($
|
|
19
|
-
$is-dark:
|
|
20
|
-
$foreground: map.get($config, foreground);
|
|
21
|
-
$primary: map.get($config, primary);
|
|
16
|
+
@function get-color-tokens($theme, $palette-name: primary) {
|
|
17
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
22
18
|
$on-surface: if($is-dark, #fff, #000);
|
|
23
19
|
$active-state-layer-color: rgba($on-surface, if($is-dark, 0.08, 0.04));
|
|
24
|
-
$palette-tokens: private-get-color-palette-color-tokens($primary);
|
|
25
20
|
|
|
26
|
-
@return
|
|
27
|
-
label-text-color:
|
|
21
|
+
@return (
|
|
22
|
+
selected-state-label-text-color: inspection.get-theme-color($theme, $palette-name),
|
|
23
|
+
label-text-color: inspection.get-theme-color($theme, foreground, text),
|
|
28
24
|
hover-state-layer-color: $active-state-layer-color,
|
|
29
25
|
focus-state-layer-color: $active-state-layer-color,
|
|
30
26
|
selected-state-layer-color: $active-state-layer-color,
|
|
31
|
-
)
|
|
27
|
+
);
|
|
32
28
|
}
|
|
33
29
|
|
|
34
30
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
35
|
-
@function get-typography-tokens($
|
|
31
|
+
@function get-typography-tokens($theme) {
|
|
36
32
|
// TODO(crisbeto): The earlier implementation of the option used MDC's APIs to create the
|
|
37
33
|
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
|
|
38
34
|
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
|
|
39
35
|
// fallback.
|
|
40
|
-
@if ($
|
|
41
|
-
$
|
|
36
|
+
@if ($theme == null) {
|
|
37
|
+
$theme: mdc-helpers.private-fallback-typography-from-mdc();
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
@return (
|
|
45
|
-
label-text-font:
|
|
46
|
-
|
|
47
|
-
label-text-
|
|
48
|
-
label-text-
|
|
49
|
-
label-text-
|
|
50
|
-
label-text-weight: typography-utils.font-weight($config, body-1)
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Generates the tokens used to theme the option based on a palette.
|
|
55
|
-
@function private-get-color-palette-color-tokens($palette) {
|
|
56
|
-
@return (
|
|
57
|
-
selected-state-label-text-color: theming.get-color-from-palette($palette),
|
|
41
|
+
label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
42
|
+
label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
|
|
43
|
+
label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
44
|
+
label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
45
|
+
label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight)
|
|
58
46
|
);
|
|
59
47
|
}
|
|
60
48
|
|
|
61
49
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
62
|
-
@function get-density-tokens($
|
|
50
|
+
@function get-density-tokens($theme) {
|
|
63
51
|
@return ();
|
|
64
52
|
}
|
|
65
53
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../typography/typography-utils';
|
|
4
3
|
@use '../../../theming/theming';
|
|
4
|
+
@use '../../../theming/inspection';
|
|
5
5
|
@use '../../../style/sass-utils';
|
|
6
6
|
|
|
7
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -14,34 +14,32 @@ $prefix: (mat, paginator);
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
17
|
-
@function get-color-tokens($
|
|
18
|
-
$foreground:
|
|
19
|
-
$background: map.get($config, background);
|
|
17
|
+
@function get-color-tokens($theme) {
|
|
18
|
+
$foreground-base: inspection.get-theme-color($theme, foreground, base);
|
|
20
19
|
|
|
21
20
|
@return (
|
|
22
|
-
container-text-color:
|
|
23
|
-
container-background-color:
|
|
24
|
-
enabled-icon-color:
|
|
25
|
-
disabled-icon-color:
|
|
21
|
+
container-text-color: sass-utils.safe-color-change($foreground-base, $alpha: 0.87),
|
|
22
|
+
container-background-color: inspection.get-theme-color($theme, background, card),
|
|
23
|
+
enabled-icon-color: sass-utils.safe-color-change($foreground-base, $alpha: 0.54),
|
|
24
|
+
disabled-icon-color: sass-utils.safe-color-change($foreground-base, $alpha: 0.12),
|
|
26
25
|
);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
30
|
-
@function get-typography-tokens($
|
|
29
|
+
@function get-typography-tokens($theme) {
|
|
31
30
|
@return (
|
|
32
|
-
container-text-font:
|
|
33
|
-
|
|
34
|
-
container-text-
|
|
35
|
-
container-text-
|
|
36
|
-
container-text-
|
|
37
|
-
|
|
38
|
-
select-trigger-text-size: typography-utils.font-size($config, caption),
|
|
31
|
+
container-text-font: inspection.get-theme-typography($theme, caption, font-family),
|
|
32
|
+
container-text-line-height: inspection.get-theme-typography($theme, caption, line-height),
|
|
33
|
+
container-text-size: inspection.get-theme-typography($theme, caption, font-size),
|
|
34
|
+
container-text-tracking: inspection.get-theme-typography($theme, caption, letter-spacing),
|
|
35
|
+
container-text-weight: inspection.get-theme-typography($theme, caption, font-weight),
|
|
36
|
+
select-trigger-text-size: inspection.get-theme-typography($theme, caption, font-size),
|
|
39
37
|
);
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
43
|
-
@function get-density-tokens($
|
|
44
|
-
$density-scale: theming.clamp-density($
|
|
41
|
+
@function get-density-tokens($theme) {
|
|
42
|
+
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
45
43
|
$size-scale: (
|
|
46
44
|
0: 56px,
|
|
47
45
|
-1: 52px,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../theming/
|
|
2
|
+
@use '../../../theming/inspection';
|
|
4
3
|
@use '../../../style/sass-utils';
|
|
5
4
|
|
|
6
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -13,25 +12,23 @@ $prefix: (mat, radio);
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
16
|
-
@function get-color-tokens($
|
|
17
|
-
$
|
|
18
|
-
$is-dark: map.get($config, is-dark);
|
|
19
|
-
$accent: map.get($config, accent);
|
|
15
|
+
@function get-color-tokens($theme, $palette-name: accent) {
|
|
16
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
20
17
|
|
|
21
18
|
@return (
|
|
22
19
|
ripple-color: if($is-dark, #fff, #000),
|
|
23
|
-
checked-ripple-color:
|
|
24
|
-
disabled-label-color:
|
|
20
|
+
checked-ripple-color: inspection.get-theme-color($theme, $palette-name, default),
|
|
21
|
+
disabled-label-color: inspection.get-theme-color($theme, foreground, disabled-text),
|
|
25
22
|
);
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
29
|
-
@function get-typography-tokens($
|
|
26
|
+
@function get-typography-tokens($theme) {
|
|
30
27
|
@return ();
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
34
|
-
@function get-density-tokens($
|
|
31
|
+
@function get-density-tokens($theme) {
|
|
35
32
|
@return ();
|
|
36
33
|
}
|
|
37
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use '../../token-utils';
|
|
2
2
|
@use '../../../style/sass-utils';
|
|
3
|
-
@use '../../../
|
|
3
|
+
@use '../../../theming/inspection';
|
|
4
4
|
|
|
5
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
6
6
|
$prefix: (mat, slide-toggle);
|
|
@@ -12,31 +12,23 @@ $prefix: (mat, slide-toggle);
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
15
|
-
@function get-color-tokens($
|
|
15
|
+
@function get-color-tokens($theme) {
|
|
16
16
|
@return ();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
20
|
-
@function get-typography-tokens($
|
|
21
|
-
// TODO(amysorto): The earlier implementation of the slide-toggle used MDC's APIs to create the
|
|
22
|
-
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
|
|
23
|
-
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
|
|
24
|
-
// fallback.
|
|
25
|
-
@if ($config == null) {
|
|
26
|
-
$config: mdc-helpers.private-fallback-typography-from-mdc();
|
|
27
|
-
}
|
|
28
|
-
|
|
20
|
+
@function get-typography-tokens($theme) {
|
|
29
21
|
@return (
|
|
30
|
-
label-text-font: typography-
|
|
31
|
-
label-text-size:
|
|
32
|
-
label-text-tracking:
|
|
33
|
-
label-text-line-height:
|
|
34
|
-
label-text-weight:
|
|
22
|
+
label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
|
|
23
|
+
label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
24
|
+
label-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
|
|
25
|
+
label-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
|
|
26
|
+
label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
|
|
35
27
|
);
|
|
36
28
|
}
|
|
37
29
|
|
|
38
30
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
39
|
-
@function get-density-tokens($
|
|
31
|
+
@function get-density-tokens($theme) {
|
|
40
32
|
@return ();
|
|
41
33
|
}
|
|
42
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
2
|
@use '../../../style/sass-utils';
|
|
3
|
+
@use '../../../theming/inspection';
|
|
4
4
|
|
|
5
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
6
6
|
$prefix: (mat, slider);
|
|
@@ -12,8 +12,8 @@ $prefix: (mat, slider);
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
15
|
-
@function get-color-tokens($
|
|
16
|
-
$is-dark:
|
|
15
|
+
@function get-color-tokens($theme) {
|
|
16
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
17
17
|
|
|
18
18
|
@return (
|
|
19
19
|
// Opacity of value indicator text container
|
|
@@ -22,12 +22,12 @@ $prefix: (mat, slider);
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
25
|
-
@function get-typography-tokens($
|
|
25
|
+
@function get-typography-tokens($theme) {
|
|
26
26
|
@return ();
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
30
|
-
@function get-density-tokens($
|
|
30
|
+
@function get-density-tokens($theme) {
|
|
31
31
|
@return ();
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../../../theming/palette';
|
|
3
3
|
@use '../../../theming/theming';
|
|
4
|
+
@use '../../../theming/inspection';
|
|
4
5
|
@use '../../../style/sass-utils';
|
|
5
6
|
@use '../../token-utils';
|
|
6
7
|
@use '@material/theme/theme-color' as mdc-theme-color;
|
|
@@ -50,15 +51,15 @@ $prefix: (mdc, checkbox);
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
53
|
-
@function get-color-tokens($
|
|
54
|
-
$
|
|
55
|
-
$
|
|
56
|
-
$
|
|
57
|
-
$
|
|
58
|
-
|
|
59
|
-
$
|
|
60
|
-
$
|
|
61
|
-
|
|
54
|
+
@function get-color-tokens($theme, $palette-name: accent) {
|
|
55
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
56
|
+
$foreground-base: inspection.get-theme-color($theme, foreground, base);
|
|
57
|
+
$palette-default: inspection.get-theme-color($theme, $palette-name, default);
|
|
58
|
+
$disabled-color: sass-utils.safe-color-change(
|
|
59
|
+
inspection.get-theme-color($theme, foreground, base), $alpha: 0.38);
|
|
60
|
+
$palette-selected: inspection.get-theme-color($theme, $palette-name);
|
|
61
|
+
$border-color: sass-utils.safe-color-change(
|
|
62
|
+
inspection.get-theme-color($theme, foreground, base), $alpha: 0.54);
|
|
62
63
|
$active-border-color:
|
|
63
64
|
theming.get-color-from-palette(palette.$gray-palette, if($is-dark, 200, 900));
|
|
64
65
|
|
|
@@ -68,15 +69,15 @@ $prefix: (mdc, checkbox);
|
|
|
68
69
|
// The color of the checkbox border when the checkbox is unselected and disabled.
|
|
69
70
|
disabled-unselected-icon-color: $disabled-color,
|
|
70
71
|
// The color of the checkmark when the checkbox is selected.
|
|
71
|
-
selected-checkmark-color: _contrast-tone($selected
|
|
72
|
+
selected-checkmark-color: _contrast-tone($palette-selected, $is-dark),
|
|
72
73
|
// The color of the checkbox fill when the checkbox is selected and focused.
|
|
73
|
-
selected-focus-icon-color: $selected
|
|
74
|
+
selected-focus-icon-color: $palette-selected,
|
|
74
75
|
// The color of the checkbox fill when the checkbox is selected and hovered.
|
|
75
|
-
selected-hover-icon-color: $selected
|
|
76
|
+
selected-hover-icon-color: $palette-selected,
|
|
76
77
|
// The color of the checkbox fill when the checkbox is selected.
|
|
77
|
-
selected-icon-color: $selected
|
|
78
|
+
selected-icon-color: $palette-selected,
|
|
78
79
|
// The color of the checkbox fill when the checkbox is selected an pressed.
|
|
79
|
-
selected-pressed-icon-color: $selected
|
|
80
|
+
selected-pressed-icon-color: $palette-selected,
|
|
80
81
|
// The color of the checkbox border when the checkbox is unselected and focused.
|
|
81
82
|
unselected-focus-icon-color: $active-border-color,
|
|
82
83
|
// The color of the checkbox border when the checkbox is unselected and hovered.
|
|
@@ -86,11 +87,11 @@ $prefix: (mdc, checkbox);
|
|
|
86
87
|
// The color of the checkbox border when the checkbox is unselected and pressed.
|
|
87
88
|
unselected-pressed-icon-color: $border-color,
|
|
88
89
|
// The color of the ripple when the checkbox is selected and focused.
|
|
89
|
-
selected-focus-state-layer-color: $
|
|
90
|
+
selected-focus-state-layer-color: $palette-default,
|
|
90
91
|
// The color of the ripple when the checkbox is selected and hovered.
|
|
91
|
-
selected-hover-state-layer-color: $
|
|
92
|
+
selected-hover-state-layer-color: $palette-default,
|
|
92
93
|
// The color of the ripple when the checkbox is selected and pressed.
|
|
93
|
-
selected-pressed-state-layer-color: $
|
|
94
|
+
selected-pressed-state-layer-color: $palette-default,
|
|
94
95
|
// The color of the ripple when the checkbox is unselected and focused.
|
|
95
96
|
unselected-focus-state-layer-color: $foreground-base,
|
|
96
97
|
// The color of the ripple when the checkbox is unselected and hovered.
|
|
@@ -101,13 +102,13 @@ $prefix: (mdc, checkbox);
|
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
104
|
-
@function get-typography-tokens($
|
|
105
|
+
@function get-typography-tokens($theme) {
|
|
105
106
|
@return ();
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
109
|
-
@function get-density-tokens($
|
|
110
|
-
$scale: theming.clamp-density($
|
|
110
|
+
@function get-density-tokens($theme) {
|
|
111
|
+
$scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
111
112
|
|
|
112
113
|
@return (
|
|
113
114
|
// The diameter of the checkbox's ripple.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../../style/elevation';
|
|
3
|
-
@use '../../../theming/
|
|
2
|
+
@use '../../../theming/inspection';
|
|
4
3
|
@use '../../../style/sass-utils';
|
|
5
4
|
@use '../../token-utils';
|
|
6
5
|
|
|
@@ -45,14 +44,12 @@ $prefix: (mdc, elevated-card);
|
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
48
|
-
@function get-color-tokens($
|
|
49
|
-
$
|
|
50
|
-
$foreground: map.get($config, foreground);
|
|
51
|
-
$elevation: theming.get-color-from-palette($foreground, elevation);
|
|
47
|
+
@function get-color-tokens($theme) {
|
|
48
|
+
$elevation: inspection.get-theme-color($theme, foreground, elevation);
|
|
52
49
|
|
|
53
50
|
@return (
|
|
54
51
|
// The background color of the card.
|
|
55
|
-
container-color:
|
|
52
|
+
container-color: inspection.get-theme-color($theme, background, card),
|
|
56
53
|
// The elevation level of the card.
|
|
57
54
|
// (Part of the color tokens because it needs to be combined with the shadow color to generate
|
|
58
55
|
// the final box-shadow).
|
|
@@ -63,12 +60,12 @@ $prefix: (mdc, elevated-card);
|
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
66
|
-
@function get-typography-tokens($
|
|
63
|
+
@function get-typography-tokens($theme) {
|
|
67
64
|
@return ();
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
71
|
-
@function get-density-tokens($
|
|
68
|
+
@function get-density-tokens($theme) {
|
|
72
69
|
@return ();
|
|
73
70
|
}
|
|
74
71
|
|