@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,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,9 +1,12 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
1
2
|
@use 'sass:map';
|
|
3
|
+
@use 'sass:meta';
|
|
2
4
|
@use '../../token-utils';
|
|
3
5
|
@use '../../../mdc-helpers/mdc-helpers';
|
|
4
6
|
@use '../../../style/sass-utils';
|
|
5
7
|
@use '../../../theming/theming';
|
|
6
|
-
@use '../../../
|
|
8
|
+
@use '../../../theming/inspection';
|
|
9
|
+
@use '../../../theming/palette';
|
|
7
10
|
|
|
8
11
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
12
|
$prefix: (mdc, chip);
|
|
@@ -228,14 +231,34 @@ $prefix: (mdc, chip);
|
|
|
228
231
|
}
|
|
229
232
|
|
|
230
233
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
231
|
-
@function get-color-tokens($
|
|
232
|
-
$
|
|
234
|
+
@function get-color-tokens($theme, $palette-name: null) {
|
|
235
|
+
$foreground: null;
|
|
236
|
+
$background: null;
|
|
237
|
+
$state-layer-color: inspection.get-theme-color($theme, foreground, base);
|
|
238
|
+
$state-layer-opacity: 0.12; // 0.12 is a common value in Material Design for opacity.
|
|
233
239
|
|
|
234
|
-
|
|
235
|
-
|
|
240
|
+
@if $palette-name == null {
|
|
241
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
242
|
+
$grey-50: map.get(palette.$grey-palette, 50);
|
|
243
|
+
$grey-900: map.get(palette.$grey-palette, 900);
|
|
244
|
+
$foreground: if($is-dark, $grey-50, $grey-900);
|
|
236
245
|
|
|
237
|
-
|
|
238
|
-
|
|
246
|
+
$surface: inspection.get-theme-color($theme, background, card);
|
|
247
|
+
$on-surface: if(
|
|
248
|
+
mdc-helpers.variable-safe-contrast-tone($surface, $is-dark) == 'dark',
|
|
249
|
+
#000,
|
|
250
|
+
#fff
|
|
251
|
+
);
|
|
252
|
+
$background: if(
|
|
253
|
+
meta.type-of($on-surface) == color and meta.type-of($surface) == color,
|
|
254
|
+
color.mix($on-surface, $surface, 12%),
|
|
255
|
+
$on-surface
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
@else {
|
|
259
|
+
$background: inspection.get-theme-color($theme, $palette-name);
|
|
260
|
+
$foreground: inspection.get-theme-color($theme, $palette-name, default-contrast);
|
|
261
|
+
}
|
|
239
262
|
|
|
240
263
|
@return (
|
|
241
264
|
// The text color of a disabled chip.
|
|
@@ -264,33 +287,24 @@ $prefix: (mdc, chip);
|
|
|
264
287
|
}
|
|
265
288
|
|
|
266
289
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
267
|
-
@function get-typography-tokens($
|
|
268
|
-
// TODO(wagnermaciel): The earlier implementation of the chip used MDC's APIs to create the
|
|
269
|
-
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
|
|
270
|
-
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
|
|
271
|
-
// fallback.
|
|
272
|
-
@if ($config == null) {
|
|
273
|
-
$config: mdc-helpers.private-fallback-typography-from-mdc();
|
|
274
|
-
}
|
|
275
|
-
|
|
290
|
+
@function get-typography-tokens($theme) {
|
|
276
291
|
@return (
|
|
277
292
|
// The font family of the chip text.
|
|
278
|
-
label-text-font:
|
|
279
|
-
typography-utils.font-family($config),
|
|
293
|
+
label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
|
|
280
294
|
// The line height of the chip text.
|
|
281
|
-
label-text-line-height:
|
|
295
|
+
label-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
|
|
282
296
|
// The font size of the chip text.
|
|
283
|
-
label-text-size:
|
|
297
|
+
label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
|
|
284
298
|
// The letter spacing of the chip label.
|
|
285
|
-
label-text-tracking:
|
|
299
|
+
label-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
|
|
286
300
|
// The font weight of the chip text.
|
|
287
|
-
label-text-weight:
|
|
301
|
+
label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight)
|
|
288
302
|
);
|
|
289
303
|
}
|
|
290
304
|
|
|
291
305
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
292
|
-
@function get-density-tokens($
|
|
293
|
-
$scale: theming.clamp-density($
|
|
306
|
+
@function get-density-tokens($theme) {
|
|
307
|
+
$scale: theming.clamp-density(inspection.get-theme-density($theme), -2);
|
|
294
308
|
@return (
|
|
295
309
|
// The height of the chip.
|
|
296
310
|
container-height:
|
|
@@ -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
|
|
|
@@ -33,20 +32,20 @@ $prefix: (mdc, circular-progress);
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
36
|
-
@function get-color-tokens($
|
|
35
|
+
@function get-color-tokens($theme) {
|
|
37
36
|
@return (
|
|
38
37
|
// The color of the progress spinner's active indicator.
|
|
39
|
-
active-indicator-color:
|
|
38
|
+
active-indicator-color: inspection.get-theme-color($theme, primary)
|
|
40
39
|
);
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
44
|
-
@function get-typography-tokens($
|
|
43
|
+
@function get-typography-tokens($theme) {
|
|
45
44
|
@return ();
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
49
|
-
@function get-density-tokens($
|
|
48
|
+
@function get-density-tokens($theme) {
|
|
50
49
|
@return ();
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -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
|
|
|
@@ -56,14 +53,13 @@ $prefix: (mdc, dialog);
|
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
59
|
-
@function get-color-tokens($
|
|
60
|
-
$is-dark:
|
|
61
|
-
$background: map.get($config, background);
|
|
56
|
+
@function get-color-tokens($theme) {
|
|
57
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
62
58
|
$on-surface: if($is-dark, #fff, #000);
|
|
63
59
|
|
|
64
60
|
@return (
|
|
65
61
|
// Background color of the container.
|
|
66
|
-
container-color:
|
|
62
|
+
container-color: inspection.get-theme-color($theme, background, dialog),
|
|
67
63
|
// Color of the dialog header.
|
|
68
64
|
subhead-color: rgba($on-surface, 0.87),
|
|
69
65
|
// Color of the dialog body text.
|
|
@@ -72,35 +68,25 @@ $prefix: (mdc, dialog);
|
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
75
|
-
@function get-typography-tokens($
|
|
76
|
-
// TODO(crisbeto): The earlier implementation of the dialog used MDC's APIs to create the
|
|
77
|
-
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
|
|
78
|
-
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
|
|
79
|
-
// fallback.
|
|
80
|
-
@if ($config == null) {
|
|
81
|
-
$config: mdc-helpers.private-fallback-typography-from-mdc();
|
|
82
|
-
}
|
|
83
|
-
|
|
71
|
+
@function get-typography-tokens($theme) {
|
|
84
72
|
@return (
|
|
85
73
|
// Typography of the dialog header.
|
|
86
|
-
subhead-font:
|
|
87
|
-
|
|
88
|
-
subhead-
|
|
89
|
-
subhead-
|
|
90
|
-
subhead-
|
|
91
|
-
subhead-tracking: typography-utils.letter-spacing($config, headline-6),
|
|
74
|
+
subhead-font: inspection.get-theme-typography($theme, headline-6, font-family),
|
|
75
|
+
subhead-line-height: inspection.get-theme-typography($theme, headline-6, line-height),
|
|
76
|
+
subhead-size: inspection.get-theme-typography($theme, headline-6, font-size),
|
|
77
|
+
subhead-weight: inspection.get-theme-typography($theme, headline-6, font-weight),
|
|
78
|
+
subhead-tracking: inspection.get-theme-typography($theme, headline-6, letter-spacing),
|
|
92
79
|
// Typography of the dialog body text.
|
|
93
|
-
supporting-text-font:
|
|
94
|
-
|
|
95
|
-
supporting-text-
|
|
96
|
-
supporting-text-
|
|
97
|
-
supporting-text-
|
|
98
|
-
supporting-text-tracking: typography-utils.letter-spacing($config, body-1),
|
|
80
|
+
supporting-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
81
|
+
supporting-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
|
|
82
|
+
supporting-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
83
|
+
supporting-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
|
|
84
|
+
supporting-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
99
85
|
);
|
|
100
86
|
}
|
|
101
87
|
|
|
102
88
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
103
|
-
@function get-density-tokens($
|
|
89
|
+
@function get-density-tokens($theme) {
|
|
104
90
|
@return ();
|
|
105
91
|
}
|
|
106
92
|
|
|
@@ -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
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
2
1
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../
|
|
2
|
+
@use '../../../theming/inspection';
|
|
4
3
|
|
|
5
4
|
@use 'sass:map';
|
|
6
5
|
|
|
@@ -45,30 +44,22 @@ $prefix: (mdc, extended-fab);
|
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
48
|
-
@function get-color-tokens($
|
|
47
|
+
@function get-color-tokens($theme) {
|
|
49
48
|
@return ();
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
53
|
-
@function get-typography-tokens($
|
|
54
|
-
// TODO(wagnermaciel): The earlier implementation of the snack bar used MDC's APIs to create the
|
|
55
|
-
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
|
|
56
|
-
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
|
|
57
|
-
// fallback.
|
|
58
|
-
@if ($config == null) {
|
|
59
|
-
$config: mdc-helpers.private-fallback-typography-from-mdc();
|
|
60
|
-
}
|
|
52
|
+
@function get-typography-tokens($theme) {
|
|
61
53
|
@return (
|
|
62
|
-
label-text-font:
|
|
63
|
-
|
|
64
|
-
label-text-
|
|
65
|
-
label-text-
|
|
66
|
-
label-text-weight: typography-utils.font-weight($config, button)
|
|
54
|
+
label-text-font: inspection.get-theme-typography($theme, button, font-family),
|
|
55
|
+
label-text-size: inspection.get-theme-typography($theme, button, font-size),
|
|
56
|
+
label-text-tracking: inspection.get-theme-typography($theme, button, letter-spacing),
|
|
57
|
+
label-text-weight: inspection.get-theme-typography($theme, button, font-weight)
|
|
67
58
|
);
|
|
68
59
|
}
|
|
69
60
|
|
|
70
61
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
71
|
-
@function get-density-tokens($
|
|
62
|
+
@function get-density-tokens($theme) {
|
|
72
63
|
@return ();
|
|
73
64
|
}
|
|
74
65
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use '../../../theming/
|
|
1
|
+
@use '../../../theming/inspection';
|
|
2
2
|
@use '../../token-utils';
|
|
3
3
|
|
|
4
4
|
@use 'sass:map';
|
|
@@ -55,21 +55,20 @@ $ripple-target: '.mdc-fab__ripple';
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
58
|
-
@function get-color-tokens($
|
|
59
|
-
$
|
|
60
|
-
$surface:
|
|
61
|
-
$on-surface: theming.get-color-from-palette($primary, default-contrast);
|
|
58
|
+
@function get-color-tokens($theme) {
|
|
59
|
+
$surface: inspection.get-theme-color($theme, primary, default);
|
|
60
|
+
$on-surface: inspection.get-theme-color($theme, primary, default-contrast);
|
|
62
61
|
|
|
63
62
|
@return (container-color: $surface, icon-color: $on-surface);
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
67
|
-
@function get-typography-tokens($
|
|
66
|
+
@function get-typography-tokens($theme) {
|
|
68
67
|
@return ();
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
72
|
-
@function get-density-tokens($
|
|
71
|
+
@function get-density-tokens($theme) {
|
|
73
72
|
@return ();
|
|
74
73
|
}
|
|
75
74
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
@use 'sass:color';
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
@use 'sass:meta';
|
|
4
|
-
@use '../../../theming/
|
|
4
|
+
@use '../../../theming/inspection';
|
|
5
5
|
@use '../../../style/sass-utils';
|
|
6
|
-
@use '../../../typography/typography-utils';
|
|
7
6
|
@use '../../token-utils';
|
|
8
7
|
|
|
9
8
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -93,15 +92,12 @@ $prefix: (mdc, filled-text-field);
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
96
|
-
@function get-color-tokens($
|
|
97
|
-
$
|
|
98
|
-
$
|
|
99
|
-
$warn: map.get($config, warn);
|
|
100
|
-
$is-dark: map.get($config, is-dark);
|
|
101
|
-
$surface: theming.get-color-from-palette($background, card);
|
|
95
|
+
@function get-color-tokens($theme) {
|
|
96
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
97
|
+
$surface: inspection.get-theme-color($theme, background, card);
|
|
102
98
|
$on-surface: if($is-dark, #fff, #000);
|
|
103
|
-
$warn-color:
|
|
104
|
-
$color-tokens: private-get-color-palette-color-tokens($
|
|
99
|
+
$warn-color: inspection.get-theme-color($theme, warn);
|
|
100
|
+
$color-tokens: private-get-color-palette-color-tokens($theme, primary);
|
|
105
101
|
|
|
106
102
|
@return map.merge($color-tokens, (
|
|
107
103
|
container-color: _variable-safe-mix($on-surface, $surface, 4%),
|
|
@@ -135,31 +131,29 @@ $prefix: (mdc, filled-text-field);
|
|
|
135
131
|
}
|
|
136
132
|
|
|
137
133
|
// Generates the mapping for the properties that change based on the text field color.
|
|
138
|
-
@function private-get-color-palette-color-tokens($
|
|
139
|
-
$palette: map.get($
|
|
140
|
-
$palette-color:
|
|
134
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
135
|
+
$palette: map.get($theme, $palette-name);
|
|
136
|
+
$palette-color: inspection.get-theme-color($theme, $palette-name);
|
|
141
137
|
|
|
142
138
|
@return (
|
|
143
139
|
caret-color: $palette-color,
|
|
144
140
|
focus-active-indicator-color: $palette-color,
|
|
145
|
-
focus-label-text-color:
|
|
141
|
+
focus-label-text-color: sass-utils.safe-color-change($palette-color, $alpha: 0.87),
|
|
146
142
|
);
|
|
147
143
|
}
|
|
148
144
|
|
|
149
145
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
150
|
-
@function get-typography-tokens($
|
|
151
|
-
$fallback-font-family: typography-utils.font-family($config);
|
|
152
|
-
|
|
146
|
+
@function get-typography-tokens($theme) {
|
|
153
147
|
@return (
|
|
154
|
-
label-text-font:
|
|
155
|
-
label-text-size:
|
|
156
|
-
label-text-tracking:
|
|
157
|
-
label-text-weight:
|
|
148
|
+
label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
|
|
149
|
+
label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
|
|
150
|
+
label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
151
|
+
label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
|
|
158
152
|
);
|
|
159
153
|
}
|
|
160
154
|
|
|
161
155
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
162
|
-
@function get-density-tokens($
|
|
156
|
+
@function get-density-tokens($theme) {
|
|
163
157
|
@return ();
|
|
164
158
|
}
|
|
165
159
|
|
|
@@ -43,19 +43,19 @@ $prefix: (mdc, icon-button);
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
46
|
-
@function get-color-tokens($
|
|
46
|
+
@function get-color-tokens($theme) {
|
|
47
47
|
@return (
|
|
48
48
|
icon-color: inherit,
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
53
|
-
@function get-typography-tokens($
|
|
53
|
+
@function get-typography-tokens($theme) {
|
|
54
54
|
@return ();
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
58
|
-
@function get-density-tokens($
|
|
58
|
+
@function get-density-tokens($theme) {
|
|
59
59
|
@return ();
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
@use '../../../theming/
|
|
1
|
+
@use '../../../theming/inspection';
|
|
2
2
|
@use '../../../style/sass-utils';
|
|
3
3
|
@use '../../token-utils';
|
|
4
4
|
@use 'sass:color';
|
|
5
|
-
@use 'sass:map';
|
|
6
5
|
@use 'sass:meta';
|
|
7
6
|
|
|
8
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -27,26 +26,26 @@ $prefix: (mdc, linear-progress);
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
30
|
-
@function get-color-tokens($
|
|
31
|
-
$
|
|
29
|
+
@function get-color-tokens($theme, $palette-name: primary) {
|
|
30
|
+
$palette-color: inspection.get-theme-color($theme, $palette-name);
|
|
32
31
|
@return (
|
|
33
32
|
// The color of the progress bar's active section.
|
|
34
|
-
active-indicator-color: $
|
|
33
|
+
active-indicator-color: $palette-color,
|
|
35
34
|
track-color: if(
|
|
36
|
-
meta.type-of($
|
|
37
|
-
color.adjust($
|
|
38
|
-
$
|
|
35
|
+
meta.type-of($palette-color) == color,
|
|
36
|
+
color.adjust($palette-color, $alpha: -0.75),
|
|
37
|
+
$palette-color
|
|
39
38
|
)
|
|
40
39
|
);
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
44
|
-
@function get-typography-tokens($
|
|
43
|
+
@function get-typography-tokens($theme) {
|
|
45
44
|
@return ();
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
49
|
-
@function get-density-tokens($
|
|
48
|
+
@function get-density-tokens($theme) {
|
|
50
49
|
@return ();
|
|
51
50
|
}
|
|
52
51
|
|