@angular/material 17.0.0-next.0 → 17.0.0-next.2
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 +3 -4
- package/autocomplete/_autocomplete-theme.scss +12 -18
- package/autocomplete/index.d.ts +15 -24
- package/badge/_badge-theme.scss +15 -27
- package/badge/index.d.ts +9 -17
- package/bottom-sheet/_bottom-sheet-theme.scss +13 -22
- 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/button-toggle/_button-toggle-theme.scss +17 -28
- package/button-toggle/index.d.ts +15 -18
- package/card/_card-theme.scss +27 -38
- package/checkbox/_checkbox-theme.scss +28 -45
- package/checkbox/index.d.ts +21 -27
- package/chips/_chips-theme.scss +18 -56
- package/core/_core-theme.scss +24 -39
- package/core/color/_all-color.scss +7 -15
- package/core/density/private/_all-density.scss +34 -39
- package/core/focus-indicators/_focus-indicators-theme.scss +6 -8
- package/core/focus-indicators/_private.scss +22 -26
- package/core/index.d.ts +7 -11
- 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/_form-common.scss +7 -7
- package/core/style/_private.scss +5 -7
- package/core/style/_sass-utils.scss +7 -0
- package/core/testing/index.d.ts +2 -1
- package/core/theming/_all-theme.scss +41 -41
- package/core/theming/_inspection.scss +133 -59
- package/core/theming/_m2-inspection.scss +268 -0
- package/core/theming/_theming.scss +59 -20
- package/core/tokens/m2/mat/_autocomplete.scss +5 -8
- package/core/tokens/m2/mat/_badge.scss +12 -15
- package/core/tokens/m2/mat/_bottom-sheet.scss +11 -17
- package/core/tokens/m2/mat/_card.scss +15 -21
- package/core/tokens/m2/mat/_datepicker.scss +28 -38
- package/core/tokens/m2/mat/_divider.scss +5 -8
- package/core/tokens/m2/mat/_expansion.scss +24 -28
- package/core/tokens/m2/mat/_form-field.scss +21 -25
- package/core/tokens/m2/mat/_grid-list.scss +8 -8
- package/core/tokens/m2/mat/_icon.scss +3 -3
- package/core/tokens/m2/mat/_legacy-button-toggle.scss +15 -19
- package/core/tokens/m2/mat/_menu.scss +12 -17
- 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/_select.scss +15 -29
- package/core/tokens/m2/mat/_sidenav.scss +12 -14
- package/core/tokens/m2/mat/_slide-toggle.scss +9 -17
- package/core/tokens/m2/mat/_slider.scss +5 -5
- package/core/tokens/m2/mat/_snack-bar.scss +7 -8
- package/core/tokens/m2/mat/_standard-button-toggle.scss +23 -22
- package/core/tokens/m2/mat/_stepper.scss +30 -33
- package/core/tokens/m2/mat/_tab-header-with-background.scss +6 -8
- package/core/tokens/m2/mat/_tab-header.scss +13 -18
- package/core/tokens/m2/mat/_table.scss +19 -23
- package/core/tokens/m2/mat/_toolbar.scss +12 -16
- package/core/tokens/m2/mdc/_checkbox.scss +21 -20
- package/core/tokens/m2/mdc/_chip.scss +38 -24
- package/core/tokens/m2/mdc/_circular-progress.scss +5 -6
- package/core/tokens/m2/mdc/_dialog.scss +16 -30
- 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 +3 -3
- 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/_plain-tooltip.scss +9 -22
- package/core/tokens/m2/mdc/_radio.scss +11 -11
- package/core/tokens/m2/mdc/_slider.scss +16 -23
- package/core/tokens/m2/mdc/_snack-bar.scss +10 -23
- package/core/tokens/m2/mdc/_switch.scss +16 -19
- package/core/tokens/m2/mdc/_tab-indicator.scss +5 -8
- package/core/tokens/m2/mdc/_tab.scss +5 -4
- package/core/typography/_all-typography.scss +44 -47
- 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 +38 -494
- package/core/typography/_versioning.scss +91 -0
- package/datepicker/_datepicker-theme.scss +20 -34
- package/datepicker/index.d.ts +3 -3
- package/dialog/_dialog-theme.scss +22 -23
- package/dialog/_mdc-dialog-structure-overrides.scss +12 -10
- package/dialog/index.d.ts +2 -0
- package/divider/_divider-theme.scss +12 -18
- package/esm2022/autocomplete/autocomplete-trigger.mjs +5 -17
- package/esm2022/autocomplete/autocomplete.mjs +23 -50
- package/esm2022/badge/badge.mjs +11 -29
- 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/button-toggle/button-toggle.mjs +25 -33
- package/esm2022/checkbox/checkbox.mjs +32 -39
- package/esm2022/core/option/optgroup.mjs +10 -11
- package/esm2022/core/option/option.mjs +6 -6
- package/esm2022/core/testing/option-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 +16 -3
- package/esm2022/form-field/form-field.mjs +3 -3
- package/esm2022/menu/menu-item.mjs +15 -11
- package/esm2022/menu/menu.mjs +9 -22
- package/esm2022/paginator/paginator.mjs +1 -1
- package/esm2022/select/select.mjs +3 -3
- package/esm2022/slide-toggle/slide-toggle.mjs +33 -37
- 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/esm2022/tabs/tab-group.mjs +3 -3
- package/expansion/_expansion-theme.scss +16 -24
- package/fesm2022/autocomplete.mjs +25 -63
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +11 -28
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/button/testing.mjs +2 -2
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +25 -32
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +59 -61
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +31 -38
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/core/testing.mjs +2 -2
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +14 -13
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +6 -6
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +15 -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/menu.mjs +23 -31
- package/fesm2022/menu.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/slide-toggle.mjs +33 -36
- package/fesm2022/slide-toggle.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/fesm2022/tabs.mjs +2 -2
- package/fesm2022/tabs.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-sizing.scss +1 -1
- package/form-field/_form-field-theme.scss +24 -34
- package/grid-list/_grid-list-theme.scss +12 -19
- package/icon/_icon-theme.scss +17 -25
- package/input/_input-theme.scss +11 -23
- package/list/_list-theme.scss +27 -42
- package/menu/_menu-theme.scss +13 -22
- package/menu/index.d.ts +12 -18
- 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 +18 -24
- package/radio/_radio-theme.scss +23 -38
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
- package/schematics/ng-generate/mdc-migration/index_bundled.js.map +1 -1
- package/schematics/ng-update/index_bundled.js +25 -25
- package/select/_select-theme.scss +17 -31
- package/sidenav/_sidenav-theme.scss +12 -18
- package/slide-toggle/_slide-toggle-theme.scss +23 -40
- package/slide-toggle/index.d.ts +20 -23
- package/slider/_slider-theme.scss +25 -42
- package/snack-bar/_snack-bar-theme.scss +17 -26
- package/sort/_sort-theme.scss +13 -22
- package/stepper/_stepper-theme.scss +16 -34
- package/table/_table-theme.scss +14 -25
- package/tabs/_tabs-theme.scss +31 -45
- package/toolbar/_toolbar-theme.scss +22 -31
- package/tooltip/_tooltip-theme.scss +15 -23
- package/tree/_tree-theme.scss +20 -29
- package/button-toggle/_button-toggle-variables.scss +0 -16
- package/core/typography/_typography-deprecated.scss +0 -39
- package/paginator/_paginator-variables.scss +0 -15
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
@use '../../token-utils';
|
|
2
|
-
@use '../../../
|
|
2
|
+
@use '../../../theming/inspection';
|
|
3
3
|
@use '../../../style/sass-utils';
|
|
4
4
|
|
|
5
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -12,25 +12,25 @@ $prefix: (mat, grid-list);
|
|
|
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($
|
|
20
|
+
@function get-typography-tokens($theme) {
|
|
21
21
|
@return (
|
|
22
22
|
// TODO(crisbeto): other components have tokens for all typography dimensions.
|
|
23
23
|
// Here we only set the font size to maintain the same appearance as the pre-tokens
|
|
24
24
|
// theming API. Consider adding more tokens for letter spacing, font weight etc.
|
|
25
|
-
tile-header-primary-text-size:
|
|
26
|
-
tile-header-secondary-text-size:
|
|
27
|
-
tile-footer-primary-text-size:
|
|
28
|
-
tile-footer-secondary-text-size:
|
|
25
|
+
tile-header-primary-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
26
|
+
tile-header-secondary-text-size: inspection.get-theme-typography($theme, caption, font-size),
|
|
27
|
+
tile-footer-primary-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
28
|
+
tile-footer-secondary-text-size: inspection.get-theme-typography($theme, caption, font-size),
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
33
|
-
@function get-density-tokens($
|
|
33
|
+
@function get-density-tokens($theme) {
|
|
34
34
|
@return ();
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -11,18 +11,18 @@ $prefix: (mat, icon);
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
14
|
-
@function get-color-tokens($
|
|
14
|
+
@function get-color-tokens($theme) {
|
|
15
15
|
// Default the icon to `inherit` so it matches the text around it.
|
|
16
16
|
@return private-get-icon-color-tokens(inherit);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
20
|
-
@function get-typography-tokens($
|
|
20
|
+
@function get-typography-tokens($theme) {
|
|
21
21
|
@return ();
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
25
|
-
@function get-density-tokens($
|
|
25
|
+
@function get-density-tokens($theme) {
|
|
26
26
|
@return ();
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../
|
|
4
|
-
@use '../../../theming/theming';
|
|
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.
|
|
@@ -18,36 +16,34 @@ $prefix: (mat, legacy-button-toggle);
|
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
21
|
-
@function get-color-tokens($
|
|
22
|
-
$foreground: map.get($config, foreground);
|
|
23
|
-
$background: map.get($config, background);
|
|
24
|
-
|
|
19
|
+
@function get-color-tokens($theme) {
|
|
25
20
|
@return (
|
|
26
|
-
text-color:
|
|
27
|
-
state-layer-color:
|
|
28
|
-
selected-state-text-color:
|
|
29
|
-
selected-state-background-color:
|
|
30
|
-
|
|
31
|
-
disabled-state-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
text-color: inspection.get-theme-color($theme, foreground, hint-text),
|
|
22
|
+
state-layer-color: inspection.get-theme-color($theme, background, focused-button),
|
|
23
|
+
selected-state-text-color: inspection.get-theme-color($theme, foreground, secondary-text),
|
|
24
|
+
selected-state-background-color: inspection.get-theme-color(
|
|
25
|
+
$theme, background, selected-button),
|
|
26
|
+
disabled-state-text-color: inspection.get-theme-color($theme, foreground, disabled-button),
|
|
27
|
+
disabled-state-background-color: inspection.get-theme-color(
|
|
28
|
+
$theme, background, disabled-button-toggle),
|
|
29
|
+
disabled-selected-state-background-color: inspection.get-theme-color(
|
|
30
|
+
$theme, background, selected-disabled-button)
|
|
35
31
|
);
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
39
|
-
@function get-typography-tokens($
|
|
35
|
+
@function get-typography-tokens($theme) {
|
|
40
36
|
@return (
|
|
41
37
|
// TODO(crisbeto): other components have tokens for all typography dimensions (font weight,
|
|
42
38
|
// letter spacing etc). The button toggle only has the font to match what it had in the
|
|
43
39
|
// old theming API and to reduce internal breakages. We should introduce more typography
|
|
44
40
|
// tokens at some point.
|
|
45
|
-
text-font: typography-
|
|
41
|
+
text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
46
42
|
);
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
50
|
-
@function get-density-tokens($
|
|
46
|
+
@function get-density-tokens($theme) {
|
|
51
47
|
@return ();
|
|
52
48
|
}
|
|
53
49
|
|
|
@@ -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
|
|
|
7
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
8
6
|
$prefix: (mat, menu);
|
|
@@ -16,37 +14,34 @@ $prefix: (mat, menu);
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
19
|
-
@function get-color-tokens($
|
|
20
|
-
$is-dark:
|
|
21
|
-
$foreground: map.get($config, foreground);
|
|
22
|
-
$background: map.get($config, background);
|
|
17
|
+
@function get-color-tokens($theme) {
|
|
18
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
23
19
|
$on-surface: if($is-dark, #fff, #000);
|
|
24
20
|
$active-state-layer-color: rgba($on-surface, if($is-dark, 0.08, 0.04));
|
|
25
|
-
$text-color:
|
|
21
|
+
$text-color: inspection.get-theme-color($theme, foreground, text);
|
|
26
22
|
|
|
27
23
|
@return (
|
|
28
24
|
item-label-text-color: $text-color,
|
|
29
25
|
item-icon-color: $text-color,
|
|
30
26
|
item-hover-state-layer-color: $active-state-layer-color,
|
|
31
27
|
item-focus-state-layer-color: $active-state-layer-color,
|
|
32
|
-
container-color:
|
|
28
|
+
container-color: inspection.get-theme-color($theme, background, card),
|
|
33
29
|
);
|
|
34
30
|
}
|
|
35
31
|
|
|
36
32
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
37
|
-
@function get-typography-tokens($
|
|
33
|
+
@function get-typography-tokens($theme) {
|
|
38
34
|
@return (
|
|
39
|
-
item-label-text-font:
|
|
40
|
-
|
|
41
|
-
item-label-text-
|
|
42
|
-
item-label-text-
|
|
43
|
-
item-label-text-
|
|
44
|
-
item-label-text-weight: typography-utils.font-weight($config, body-1),
|
|
35
|
+
item-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
36
|
+
item-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
37
|
+
item-label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
38
|
+
item-label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
|
|
39
|
+
item-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
|
|
45
40
|
);
|
|
46
41
|
}
|
|
47
42
|
|
|
48
43
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
49
|
-
@function get-density-tokens($
|
|
44
|
+
@function get-density-tokens($theme) {
|
|
50
45
|
@return ();
|
|
51
46
|
}
|
|
52
47
|
|
|
@@ -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,8 +1,5 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../
|
|
4
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
5
|
-
@use '../../../theming/theming';
|
|
2
|
+
@use '../../../theming/inspection';
|
|
6
3
|
@use '../../../style/sass-utils';
|
|
7
4
|
|
|
8
5
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -15,48 +12,37 @@ $prefix: (mat, select);
|
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
// 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
|
-
$background: map.get($config, background);
|
|
22
|
-
$primary: map.get($config, primary);
|
|
23
|
-
$warn: map.get($config, warn);
|
|
15
|
+
@function get-color-tokens($theme, $palette-name: primary) {
|
|
16
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
24
17
|
$on-surface: if($is-dark, #fff, #000);
|
|
25
18
|
|
|
26
19
|
@return (
|
|
27
|
-
panel-background-color:
|
|
20
|
+
panel-background-color: inspection.get-theme-color($theme, background, card),
|
|
28
21
|
enabled-trigger-text-color: rgba($on-surface, 0.87),
|
|
29
22
|
disabled-trigger-text-color: rgba($on-surface, 0.38),
|
|
30
23
|
placeholder-text-color: rgba($on-surface, 0.6),
|
|
31
24
|
enabled-arrow-color: rgba($on-surface, 0.54),
|
|
32
25
|
disabled-arrow-color: rgba($on-surface, 0.38),
|
|
33
|
-
focused-arrow-color:
|
|
34
|
-
|
|
26
|
+
focused-arrow-color: sass-utils.safe-color-change(
|
|
27
|
+
inspection.get-theme-color($theme, $palette-name, default), $alpha: 0.87),
|
|
28
|
+
invalid-arrow-color: sass-utils.safe-color-change(
|
|
29
|
+
inspection.get-theme-color($theme, warn, default), $alpha: 0.87),
|
|
35
30
|
);
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
39
|
-
@function get-typography-tokens($
|
|
40
|
-
// TODO(crisbeto): The earlier implementation of the select used MDC's APIs to create the
|
|
41
|
-
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
|
|
42
|
-
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
|
|
43
|
-
// fallback.
|
|
44
|
-
@if ($config == null) {
|
|
45
|
-
$config: mdc-helpers.private-fallback-typography-from-mdc();
|
|
46
|
-
}
|
|
47
|
-
|
|
34
|
+
@function get-typography-tokens($theme) {
|
|
48
35
|
@return (
|
|
49
|
-
trigger-text-font:
|
|
50
|
-
|
|
51
|
-
trigger-text-
|
|
52
|
-
trigger-text-
|
|
53
|
-
trigger-text-
|
|
54
|
-
trigger-text-weight: typography-utils.font-weight($config, body-1)
|
|
36
|
+
trigger-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
37
|
+
trigger-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
|
|
38
|
+
trigger-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
39
|
+
trigger-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
40
|
+
trigger-text-weight: inspection.get-theme-typography($theme, body-1, font-weight)
|
|
55
41
|
);
|
|
56
42
|
}
|
|
57
43
|
|
|
58
44
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
59
|
-
@function get-density-tokens($
|
|
45
|
+
@function get-density-tokens($theme) {
|
|
60
46
|
@return ();
|
|
61
47
|
}
|
|
62
48
|
|