@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,6 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../../../theming/
|
|
3
|
-
@use '../../../typography/typography-utils';
|
|
2
|
+
@use '../../../theming/inspection';
|
|
4
3
|
@use '../../../style/sass-utils';
|
|
5
4
|
@use '../../token-utils';
|
|
6
5
|
|
|
@@ -83,96 +82,99 @@ $prefix: (mdc, list);
|
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
86
|
-
@function get-color-tokens($
|
|
87
|
-
$
|
|
88
|
-
$
|
|
89
|
-
$foreground-
|
|
90
|
-
$text-
|
|
91
|
-
|
|
85
|
+
@function get-color-tokens($theme) {
|
|
86
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
87
|
+
$foreground-base: inspection.get-theme-color($theme, foreground, base);
|
|
88
|
+
$foreground-text: inspection.get-theme-color($theme, foreground, text);
|
|
89
|
+
$foreground-secondary-text: inspection.get-theme-color($theme, foreground, secondary-text);
|
|
90
|
+
$foreground-hint-text: inspection.get-theme-color($theme, foreground, hint-text);
|
|
91
|
+
$text-icon-on-background: sass-utils.safe-color-change(
|
|
92
|
+
$foreground-base, $alpha: if($is-dark, 0.5, 0.38));
|
|
92
93
|
|
|
93
94
|
@return (
|
|
94
95
|
// Text color of the list item primary text.
|
|
95
|
-
list-item-label-text-color:
|
|
96
|
+
list-item-label-text-color: $foreground-text,
|
|
96
97
|
// Text color of the list item supporting text.
|
|
97
|
-
list-item-supporting-text-color:
|
|
98
|
+
list-item-supporting-text-color: $foreground-secondary-text,
|
|
98
99
|
// Color of the list item's leading icon.
|
|
99
100
|
list-item-leading-icon-color: $text-icon-on-background,
|
|
100
101
|
// Text color of the list item's trailing text.
|
|
101
|
-
list-item-trailing-supporting-text-color:
|
|
102
|
-
$foreground, hint-text),
|
|
102
|
+
list-item-trailing-supporting-text-color: $foreground-hint-text,
|
|
103
103
|
// Color of the list item's trailing icon.
|
|
104
104
|
list-item-trailing-icon-color: $text-icon-on-background,
|
|
105
105
|
// Color of the list item's trailing icon when the item is selected.
|
|
106
106
|
list-item-selected-trailing-icon-color: $text-icon-on-background,
|
|
107
107
|
// Text color of the list item's primary text when the item is disabled.
|
|
108
|
-
list-item-disabled-label-text-color:
|
|
108
|
+
list-item-disabled-label-text-color: $foreground-base,
|
|
109
109
|
// Color of the list item's leading icon when the item is disabled.
|
|
110
|
-
list-item-disabled-leading-icon-color:
|
|
110
|
+
list-item-disabled-leading-icon-color: $foreground-base,
|
|
111
111
|
// Color of the list item's trailing icon when the item is disabled.
|
|
112
|
-
list-item-disabled-trailing-icon-color:
|
|
112
|
+
list-item-disabled-trailing-icon-color: $foreground-base,
|
|
113
113
|
// Color of the list item's primary text when the item is being hovered.
|
|
114
|
-
list-item-hover-label-text-color:
|
|
114
|
+
list-item-hover-label-text-color: $foreground-text,
|
|
115
115
|
// Color of the list item's leading icon when the item is being hovered.
|
|
116
116
|
list-item-hover-leading-icon-color: $text-icon-on-background,
|
|
117
117
|
// Color of the list item's trailing icon when the item is being hovered.
|
|
118
118
|
list-item-hover-trailing-icon-color: $text-icon-on-background,
|
|
119
119
|
// Color of the list item's primary text when the item is focused.
|
|
120
|
-
list-item-focus-label-text-color:
|
|
120
|
+
list-item-focus-label-text-color: $foreground-text,
|
|
121
121
|
// Color of the list item's overlay when the item is hovered.
|
|
122
|
-
list-item-hover-state-layer-color:
|
|
122
|
+
list-item-hover-state-layer-color: $foreground-base,
|
|
123
123
|
// Opacity of the list item's overlay when the item is hovered.
|
|
124
124
|
list-item-hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
|
|
125
125
|
// Color of the list item's overlay when the item is focused.
|
|
126
|
-
list-item-focus-state-layer-color:
|
|
126
|
+
list-item-focus-state-layer-color: $foreground-base,
|
|
127
127
|
// Opacity of the list item's overlay when the item is focused.
|
|
128
128
|
list-item-focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
133
|
-
@function get-typography-tokens($
|
|
133
|
+
@function get-typography-tokens($theme) {
|
|
134
134
|
@return (
|
|
135
135
|
// Font family of the list item primary text.
|
|
136
|
-
list-item-label-text-font:
|
|
137
|
-
or typography-utils.font-family($config),
|
|
136
|
+
list-item-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
138
137
|
// Line height of the list item primary text.
|
|
139
|
-
list-item-label-text-line-height:
|
|
138
|
+
list-item-label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
|
|
140
139
|
// Font size of the list item primary text.
|
|
141
|
-
list-item-label-text-size:
|
|
140
|
+
list-item-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
142
141
|
// Letter spacing of the list item primary text.
|
|
143
|
-
list-item-label-text-tracking:
|
|
142
|
+
list-item-label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
144
143
|
// Font weight of the list item primary text.
|
|
145
|
-
list-item-label-text-weight:
|
|
144
|
+
list-item-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
|
|
146
145
|
// Font family of the list item supporting text.
|
|
147
|
-
list-item-supporting-text-font:
|
|
148
|
-
or typography-utils.font-family($config),
|
|
146
|
+
list-item-supporting-text-font: inspection.get-theme-typography($theme, body-2, font-family),
|
|
149
147
|
// Line height of the list item supporting text.
|
|
150
|
-
list-item-supporting-text-line-height:
|
|
148
|
+
list-item-supporting-text-line-height:inspection.get-theme-typography(
|
|
149
|
+
$theme, body-2, line-height),
|
|
151
150
|
// Font size of the list item supporting text.
|
|
152
|
-
list-item-supporting-text-size:
|
|
151
|
+
list-item-supporting-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
153
152
|
// Letter spacing of the list item supporting text.
|
|
154
|
-
list-item-supporting-text-tracking:
|
|
153
|
+
list-item-supporting-text-tracking: inspection.get-theme-typography(
|
|
154
|
+
$theme, body-2, letter-spacing),
|
|
155
155
|
// Font weight of the list item supporting text.
|
|
156
|
-
list-item-supporting-text-weight:
|
|
156
|
+
list-item-supporting-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
|
|
157
157
|
// Font family of the list item's trailing text.
|
|
158
|
-
list-item-trailing-supporting-text-font:
|
|
159
|
-
|
|
158
|
+
list-item-trailing-supporting-text-font: inspection.get-theme-typography(
|
|
159
|
+
$theme, caption, font-family),
|
|
160
160
|
// Line height of the list item's trailing text.
|
|
161
|
-
list-item-trailing-supporting-text-line-height:
|
|
162
|
-
$
|
|
161
|
+
list-item-trailing-supporting-text-line-height: inspection.get-theme-typography(
|
|
162
|
+
$theme, caption, line-height),
|
|
163
163
|
// Font size of the list item's trailing text.
|
|
164
|
-
list-item-trailing-supporting-text-size:
|
|
164
|
+
list-item-trailing-supporting-text-size: inspection.get-theme-typography(
|
|
165
|
+
$theme, caption, font-size),
|
|
165
166
|
// Letter spacing color of the list item's trailing text.
|
|
166
|
-
list-item-trailing-supporting-text-tracking:
|
|
167
|
-
$
|
|
167
|
+
list-item-trailing-supporting-text-tracking: inspection.get-theme-typography(
|
|
168
|
+
$theme, caption, letter-spacing),
|
|
168
169
|
// Font weight of the list item's trailing text.
|
|
169
|
-
list-item-trailing-supporting-text-weight:
|
|
170
|
+
list-item-trailing-supporting-text-weight: inspection.get-theme-typography(
|
|
171
|
+
$theme, caption, font-weight),
|
|
170
172
|
);
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
174
|
-
@function get-density-tokens($
|
|
175
|
-
$scale:
|
|
176
|
+
@function get-density-tokens($theme) {
|
|
177
|
+
$scale: inspection.get-theme-density($theme);
|
|
176
178
|
|
|
177
179
|
@return (
|
|
178
180
|
// Height of one line list items.
|
|
@@ -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
|
|
|
@@ -51,16 +50,14 @@ $prefix: (mdc, outlined-card);
|
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
54
|
-
@function get-color-tokens($
|
|
55
|
-
$
|
|
56
|
-
$foreground: map.get($config, foreground);
|
|
57
|
-
$elevation: theming.get-color-from-palette($foreground, elevation);
|
|
53
|
+
@function get-color-tokens($theme) {
|
|
54
|
+
$elevation: inspection.get-theme-color($theme, foreground, elevation);
|
|
58
55
|
|
|
59
56
|
@return (
|
|
60
57
|
// The background color of the card.
|
|
61
|
-
container-color:
|
|
58
|
+
container-color: inspection.get-theme-color($theme, background, card),
|
|
62
59
|
// The border color of the card.
|
|
63
|
-
outline-color:
|
|
60
|
+
outline-color: rgba(inspection.get-theme-color($theme, foreground, base), 0.12),
|
|
64
61
|
// The elevation level of the card.
|
|
65
62
|
// (Part of the color tokens because it needs to be combined with the shadow color to generate
|
|
66
63
|
// the final box-shadow).
|
|
@@ -71,12 +68,12 @@ $prefix: (mdc, outlined-card);
|
|
|
71
68
|
}
|
|
72
69
|
|
|
73
70
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
74
|
-
@function get-typography-tokens($
|
|
71
|
+
@function get-typography-tokens($theme) {
|
|
75
72
|
@return ();
|
|
76
73
|
}
|
|
77
74
|
|
|
78
75
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
79
|
-
@function get-density-tokens($
|
|
76
|
+
@function get-density-tokens($theme) {
|
|
80
77
|
@return ();
|
|
81
78
|
}
|
|
82
79
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../../../theming/
|
|
2
|
+
@use '../../../theming/inspection';
|
|
3
3
|
@use '../../../style/sass-utils';
|
|
4
|
-
@use '../../../typography/typography-utils';
|
|
5
4
|
@use '../../token-utils';
|
|
6
5
|
|
|
7
6
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -87,13 +86,11 @@ $prefix: (mdc, outlined-text-field);
|
|
|
87
86
|
}
|
|
88
87
|
|
|
89
88
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
90
|
-
@function get-color-tokens($
|
|
91
|
-
$
|
|
92
|
-
$warn: map.get($config, warn);
|
|
93
|
-
$is-dark: map.get($config, is-dark);
|
|
89
|
+
@function get-color-tokens($theme) {
|
|
90
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
94
91
|
$on-surface: if($is-dark, #fff, #000);
|
|
95
|
-
$warn-color:
|
|
96
|
-
$color-tokens: private-get-color-palette-color-tokens($
|
|
92
|
+
$warn-color: inspection.get-theme-color($theme, warn);
|
|
93
|
+
$color-tokens: private-get-color-palette-color-tokens($theme, primary);
|
|
97
94
|
|
|
98
95
|
@return map.merge($color-tokens, (
|
|
99
96
|
label-text-color: rgba($on-surface, 0.6),
|
|
@@ -118,31 +115,28 @@ $prefix: (mdc, outlined-text-field);
|
|
|
118
115
|
}
|
|
119
116
|
|
|
120
117
|
// Generates the mapping for the properties that change based on the text field color.
|
|
121
|
-
@function private-get-color-palette-color-tokens($
|
|
122
|
-
$palette:
|
|
123
|
-
$palette-color: theming.get-color-from-palette($palette);
|
|
118
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
119
|
+
$palette-color: inspection.get-theme-color($theme, $palette-name);
|
|
124
120
|
|
|
125
121
|
@return (
|
|
126
122
|
caret-color: $palette-color,
|
|
127
123
|
focus-outline-color: $palette-color,
|
|
128
|
-
focus-label-text-color:
|
|
124
|
+
focus-label-text-color: sass-utils.safe-color-change($palette-color, $alpha: 0.87),
|
|
129
125
|
);
|
|
130
126
|
}
|
|
131
127
|
|
|
132
128
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
133
|
-
@function get-typography-tokens($
|
|
134
|
-
$fallback-font-family: typography-utils.font-family($config);
|
|
135
|
-
|
|
129
|
+
@function get-typography-tokens($theme) {
|
|
136
130
|
@return (
|
|
137
|
-
label-text-font:
|
|
138
|
-
label-text-size:
|
|
139
|
-
label-text-tracking:
|
|
140
|
-
label-text-weight:
|
|
131
|
+
label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
132
|
+
label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
133
|
+
label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
134
|
+
label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
|
|
141
135
|
);
|
|
142
136
|
}
|
|
143
137
|
|
|
144
138
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
145
|
-
@function get-density-tokens($
|
|
139
|
+
@function get-density-tokens($theme) {
|
|
146
140
|
@return ();
|
|
147
141
|
}
|
|
148
142
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
@use '
|
|
2
|
-
@use '../../../theming/theming';
|
|
3
|
-
@use '../../../typography/typography-utils';
|
|
4
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
1
|
+
@use '../../../theming/inspection';
|
|
5
2
|
@use '../../../style/sass-utils';
|
|
6
3
|
@use '../../token-utils';
|
|
7
4
|
|
|
@@ -26,42 +23,32 @@ $prefix: (mdc, plain-tooltip);
|
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
29
|
-
@function get-color-tokens($
|
|
30
|
-
$background: map.get($config, background);
|
|
26
|
+
@function get-color-tokens($theme) {
|
|
31
27
|
|
|
32
28
|
@return (
|
|
33
29
|
// Color of the tooltip container.
|
|
34
|
-
container-color:
|
|
30
|
+
container-color: inspection.get-theme-color($theme, background, tooltip),
|
|
35
31
|
// Color of the tooltip text.
|
|
36
32
|
supporting-text-color: #fff,
|
|
37
33
|
);
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
41
|
-
@function get-typography-tokens($
|
|
42
|
-
// TODO(amysorto): The earlier implementation of the tooltip used MDC's APIs to create the
|
|
43
|
-
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
|
|
44
|
-
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
|
|
45
|
-
// fallback.
|
|
46
|
-
@if ($config == null) {
|
|
47
|
-
$config: mdc-helpers.private-fallback-typography-from-mdc();
|
|
48
|
-
}
|
|
49
|
-
|
|
37
|
+
@function get-typography-tokens($theme) {
|
|
50
38
|
@return (
|
|
51
39
|
// Font for the tooltip text.
|
|
52
|
-
supporting-text-font:
|
|
53
|
-
or typography-utils.font-family($config),
|
|
40
|
+
supporting-text-font: inspection.get-theme-typography($theme, caption, font-family),
|
|
54
41
|
// Font size for the tooltip text.
|
|
55
|
-
supporting-text-size:
|
|
42
|
+
supporting-text-size: inspection.get-theme-typography($theme, caption, font-size),
|
|
56
43
|
// Font weight of the tooltip text.
|
|
57
|
-
supporting-text-weight:
|
|
44
|
+
supporting-text-weight: inspection.get-theme-typography($theme, caption, font-weight),
|
|
58
45
|
// Tracking (space between letters) of the tooltip text.
|
|
59
|
-
supporting-text-tracking:
|
|
46
|
+
supporting-text-tracking: inspection.get-theme-typography($theme, caption, letter-spacing),
|
|
60
47
|
);
|
|
61
48
|
}
|
|
62
49
|
|
|
63
50
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
64
|
-
@function get-density-tokens($
|
|
51
|
+
@function get-density-tokens($theme) {
|
|
65
52
|
@return ();
|
|
66
53
|
}
|
|
67
54
|
|
|
@@ -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
|
|
|
@@ -41,10 +42,9 @@ $prefix: (mdc, radio);
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
44
|
-
@function get-color-tokens($
|
|
45
|
-
$
|
|
46
|
-
$
|
|
47
|
-
$accent-color: theming.get-color-from-palette($accent, default);
|
|
45
|
+
@function get-color-tokens($theme, $palette-name: accent) {
|
|
46
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
47
|
+
$palette-color: inspection.get-theme-color($theme, $palette-name, default);
|
|
48
48
|
$on-surface: if($is-dark, #fff, #000);
|
|
49
49
|
$icon-color: theming.get-color-from-palette(palette.$gray-palette, if($is-dark, 200, 900));
|
|
50
50
|
|
|
@@ -54,21 +54,21 @@ $prefix: (mdc, radio);
|
|
|
54
54
|
unselected-hover-icon-color: $icon-color,
|
|
55
55
|
unselected-icon-color: rgba($on-surface, 0.54),
|
|
56
56
|
unselected-pressed-icon-color: rgba($on-surface, 0.54),
|
|
57
|
-
selected-focus-icon-color: $
|
|
58
|
-
selected-hover-icon-color: $
|
|
59
|
-
selected-icon-color: $
|
|
60
|
-
selected-pressed-icon-color: $
|
|
57
|
+
selected-focus-icon-color: $palette-color,
|
|
58
|
+
selected-hover-icon-color: $palette-color,
|
|
59
|
+
selected-icon-color: $palette-color,
|
|
60
|
+
selected-pressed-icon-color: $palette-color,
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
65
|
-
@function get-typography-tokens($
|
|
65
|
+
@function get-typography-tokens($theme) {
|
|
66
66
|
@return ();
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
70
|
-
@function get-density-tokens($
|
|
71
|
-
$scale: theming.clamp-density($
|
|
70
|
+
@function get-density-tokens($theme) {
|
|
71
|
+
$scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
72
72
|
|
|
73
73
|
@return (
|
|
74
74
|
// The diameter of the radio's ripple.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../../../theming/
|
|
2
|
+
@use '../../../theming/inspection';
|
|
3
3
|
@use '../../token-utils';
|
|
4
|
+
@use '../../../style/elevation';
|
|
4
5
|
@use '../../../style/sass-utils';
|
|
5
|
-
@use '../../../typography/typography-utils';
|
|
6
6
|
|
|
7
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
8
8
|
$prefix: (mdc, slider);
|
|
@@ -56,15 +56,13 @@ $prefix: (mdc, slider);
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
59
|
-
@function get-color-tokens($
|
|
60
|
-
$
|
|
61
|
-
$
|
|
62
|
-
$is-dark: map.get($config, is-dark);
|
|
59
|
+
@function get-color-tokens($theme) {
|
|
60
|
+
$elevation: inspection.get-theme-color($theme, foreground, elevation);
|
|
61
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
63
62
|
$on-surface: if($is-dark, #fff, #000);
|
|
64
63
|
|
|
65
64
|
// The default for tokens that rely on the theme will use the primary palette
|
|
66
|
-
$
|
|
67
|
-
$theme-color-tokens: private-get-color-palette-color-tokens($primary);
|
|
65
|
+
$theme-color-tokens: private-get-color-palette-color-tokens($theme, primary);
|
|
68
66
|
|
|
69
67
|
@return map.merge(
|
|
70
68
|
$theme-color-tokens,
|
|
@@ -94,9 +92,9 @@ $prefix: (mdc, slider);
|
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
// Generates tokens for the slider properties that change based on the theme.
|
|
97
|
-
@function private-get-color-palette-color-tokens($
|
|
98
|
-
$color:
|
|
99
|
-
$on-color:
|
|
95
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
96
|
+
$color: inspection.get-theme-color($theme, $palette-name);
|
|
97
|
+
$on-color: inspection.get-theme-color($theme, $palette-name, default-contrast);
|
|
100
98
|
|
|
101
99
|
@return (
|
|
102
100
|
// Color of handle.
|
|
@@ -117,28 +115,23 @@ $prefix: (mdc, slider);
|
|
|
117
115
|
}
|
|
118
116
|
|
|
119
117
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
120
|
-
@function get-typography-tokens($
|
|
121
|
-
@if ($config == null) {
|
|
122
|
-
$config: mdc-helpers.private-fallback-typography-from-mdc();
|
|
123
|
-
}
|
|
124
|
-
|
|
118
|
+
@function get-typography-tokens($theme) {
|
|
125
119
|
@return (
|
|
126
120
|
// Font for label text.
|
|
127
|
-
label-label-text-font:
|
|
128
|
-
or typography-utils.font-family($config),
|
|
121
|
+
label-label-text-font: inspection.get-theme-typography($theme, subtitle-2, font-family),
|
|
129
122
|
// Font size of label text.
|
|
130
|
-
label-label-text-size:
|
|
123
|
+
label-label-text-size: inspection.get-theme-typography($theme, subtitle-2, font-size),
|
|
131
124
|
// Line height of label text.
|
|
132
|
-
label-label-text-line-height:
|
|
125
|
+
label-label-text-line-height: inspection.get-theme-typography($theme, subtitle-2, line-height),
|
|
133
126
|
// Letter spacing of label text.
|
|
134
|
-
label-label-text-tracking:
|
|
127
|
+
label-label-text-tracking: inspection.get-theme-typography($theme, subtitle-2, letter-spacing),
|
|
135
128
|
// Font weight of label text.
|
|
136
|
-
label-label-text-weight:
|
|
129
|
+
label-label-text-weight: inspection.get-theme-typography($theme, subtitle-2, font-weight),
|
|
137
130
|
);
|
|
138
131
|
}
|
|
139
132
|
|
|
140
133
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
141
|
-
@function get-density-tokens($
|
|
134
|
+
@function get-density-tokens($theme) {
|
|
142
135
|
@return ();
|
|
143
136
|
}
|
|
144
137
|
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use 'sass:meta';
|
|
3
2
|
@use 'sass:color';
|
|
4
|
-
@use '../../../theming/
|
|
3
|
+
@use '../../../theming/inspection';
|
|
5
4
|
@use '../../token-utils';
|
|
6
|
-
@use '../../../typography/typography-utils';
|
|
7
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
8
5
|
@use '../../../style/sass-utils';
|
|
9
6
|
|
|
10
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -58,10 +55,9 @@ $prefix: (mdc, snackbar);
|
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
61
|
-
@function get-color-tokens($
|
|
62
|
-
$
|
|
63
|
-
$
|
|
64
|
-
$surface: theming.get-color-from-palette($background-palette, card);
|
|
58
|
+
@function get-color-tokens($theme) {
|
|
59
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
60
|
+
$surface: inspection.get-theme-color($theme, background, card);
|
|
65
61
|
|
|
66
62
|
@return (
|
|
67
63
|
container-color: if(meta.type-of($surface) == color,
|
|
@@ -71,26 +67,17 @@ $prefix: (mdc, snackbar);
|
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
74
|
-
@function get-typography-tokens($
|
|
75
|
-
// TODO(crisbeto): The earlier implementation of the snack bar used MDC's APIs to create the
|
|
76
|
-
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
|
|
77
|
-
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
|
|
78
|
-
// fallback.
|
|
79
|
-
@if ($config == null) {
|
|
80
|
-
$config: mdc-helpers.private-fallback-typography-from-mdc();
|
|
81
|
-
}
|
|
82
|
-
|
|
70
|
+
@function get-typography-tokens($theme) {
|
|
83
71
|
@return (
|
|
84
|
-
supporting-text-font:
|
|
85
|
-
|
|
86
|
-
supporting-text-
|
|
87
|
-
supporting-text-
|
|
88
|
-
supporting-text-weight: typography-utils.font-weight($config, body-2),
|
|
72
|
+
supporting-text-font: inspection.get-theme-typography($theme, body-2, font-family),
|
|
73
|
+
supporting-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
|
|
74
|
+
supporting-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
75
|
+
supporting-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
|
|
89
76
|
);
|
|
90
77
|
}
|
|
91
78
|
|
|
92
79
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
93
|
-
@function get-density-tokens($
|
|
80
|
+
@function get-density-tokens($theme) {
|
|
94
81
|
@return ();
|
|
95
82
|
}
|
|
96
83
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../../../style/elevation';
|
|
3
3
|
@use '../../../style/sass-utils';
|
|
4
|
-
@use '../../../theming/
|
|
4
|
+
@use '../../../theming/inspection';
|
|
5
5
|
@use '../../token-utils';
|
|
6
6
|
|
|
7
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -58,10 +58,9 @@ $prefix: (mdc, switch);
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
61
|
-
@function get-color-tokens($
|
|
62
|
-
$
|
|
63
|
-
$
|
|
64
|
-
$is-dark: map.get($config, is-dark);
|
|
61
|
+
@function get-color-tokens($theme) {
|
|
62
|
+
$elevation: inspection.get-theme-color($theme, foreground, elevation);
|
|
63
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
65
64
|
$on-surface: if($is-dark, #f5f5f5, #424242);
|
|
66
65
|
$hairline: if($is-dark, #616161, #e0e0e0);
|
|
67
66
|
$on-surface-variant: if($is-dark, #9e9e9e, #616161);
|
|
@@ -70,10 +69,7 @@ $prefix: (mdc, switch);
|
|
|
70
69
|
$icon-color: if($is-dark, #212121, #fff);
|
|
71
70
|
|
|
72
71
|
// The default for tokens that rely on the theme will use the primary palette
|
|
73
|
-
$theme-color-tokens: private-get-color-palette-color-tokens(
|
|
74
|
-
map.get($config, primary),
|
|
75
|
-
$is-dark
|
|
76
|
-
);
|
|
72
|
+
$theme-color-tokens: private-get-color-palette-color-tokens($theme, primary);
|
|
77
73
|
|
|
78
74
|
@return map.merge(
|
|
79
75
|
$theme-color-tokens,
|
|
@@ -129,20 +125,21 @@ $prefix: (mdc, switch);
|
|
|
129
125
|
}
|
|
130
126
|
|
|
131
127
|
// Generates the mapping for the properties that change based on the slide toggle color.
|
|
132
|
-
@function private-get-color-palette-color-tokens($
|
|
133
|
-
$
|
|
134
|
-
$
|
|
135
|
-
$
|
|
128
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
129
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
130
|
+
$palette-color: inspection.get-theme-color($theme, $palette-name, if($is-dark, 300, 600));
|
|
131
|
+
$state-content: inspection.get-theme-color($theme, $palette-name, if($is-dark, 200, 900));
|
|
132
|
+
$inverse: inspection.get-theme-color($theme, $palette-name, if($is-dark, 600, 300));
|
|
136
133
|
|
|
137
134
|
@return (
|
|
138
135
|
// Color of ripple when selected and focused.
|
|
139
|
-
selected-focus-state-layer-color: $
|
|
136
|
+
selected-focus-state-layer-color: $palette-color,
|
|
140
137
|
// Color of handle when selected
|
|
141
|
-
selected-handle-color: $
|
|
138
|
+
selected-handle-color: $palette-color,
|
|
142
139
|
// Color of ripple when selected and on hover.
|
|
143
|
-
selected-hover-state-layer-color: $
|
|
140
|
+
selected-hover-state-layer-color: $palette-color,
|
|
144
141
|
// Color of ripple when selected and pressed.
|
|
145
|
-
selected-pressed-state-layer-color: $
|
|
142
|
+
selected-pressed-state-layer-color: $palette-color,
|
|
146
143
|
// Color of handle when selected and focused.
|
|
147
144
|
selected-focus-handle-color: $state-content,
|
|
148
145
|
// Color of handle when selected and on hover.
|
|
@@ -161,12 +158,12 @@ $prefix: (mdc, switch);
|
|
|
161
158
|
}
|
|
162
159
|
|
|
163
160
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
164
|
-
@function get-typography-tokens($
|
|
161
|
+
@function get-typography-tokens($theme) {
|
|
165
162
|
@return ();
|
|
166
163
|
}
|
|
167
164
|
|
|
168
165
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
169
|
-
@function get-density-tokens($
|
|
166
|
+
@function get-density-tokens($theme) {
|
|
170
167
|
@return ();
|
|
171
168
|
}
|
|
172
169
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
@use '
|
|
2
|
-
@use '../../../theming/theming';
|
|
1
|
+
@use '../../../theming/inspection';
|
|
3
2
|
@use '../../../style/sass-utils';
|
|
4
3
|
@use '../../token-utils';
|
|
5
4
|
|
|
@@ -21,21 +20,19 @@ $prefix: (mdc, tab-indicator);
|
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
24
|
-
@function get-color-tokens($
|
|
25
|
-
$primary: map.get($config, primary);
|
|
26
|
-
|
|
23
|
+
@function get-color-tokens($theme, $palette-name: primary) {
|
|
27
24
|
@return (
|
|
28
|
-
active-indicator-color:
|
|
25
|
+
active-indicator-color: inspection.get-theme-color($theme, $palette-name, default),
|
|
29
26
|
);
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
33
|
-
@function get-typography-tokens($
|
|
30
|
+
@function get-typography-tokens($theme) {
|
|
34
31
|
@return ();
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
38
|
-
@function get-density-tokens($
|
|
35
|
+
@function get-density-tokens($theme) {
|
|
39
36
|
@return ();
|
|
40
37
|
}
|
|
41
38
|
|