@angular/material 20.1.0-next.0 → 20.1.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 +1 -2
- package/autocomplete/_autocomplete-theme.scss +28 -37
- package/autocomplete/_m2-autocomplete.scss +5 -2
- package/badge/_badge-theme.scss +35 -44
- package/badge/_m2-badge.scss +3 -2
- package/bottom-sheet/_bottom-sheet-theme.scss +28 -40
- package/bottom-sheet/_m2-bottom-sheet.scss +12 -11
- package/button/_button-theme.scss +37 -55
- package/button/_fab-theme.scss +42 -56
- package/button/_icon-button-theme.scss +30 -48
- package/button/_m2-button.scss +60 -59
- package/button/_m2-fab.scss +19 -15
- package/button/_m2-icon-button.scss +7 -5
- package/button/testing/index.d.ts +1 -0
- package/button-toggle/_button-toggle-theme.scss +29 -44
- package/button-toggle/_m2-button-toggle.scss +11 -17
- package/card/_card-theme.scss +28 -36
- package/card/_m2-card.scss +12 -14
- package/checkbox/_checkbox-theme.scss +35 -50
- package/checkbox/_m2-checkbox.scss +8 -8
- package/chips/_chips-theme.scss +24 -30
- package/chips/_m2-chip.scss +12 -28
- package/core/_core-theme.scss +48 -67
- package/core/focus-indicators/_private.scss +2 -5
- package/core/m2/_theming.scss +68 -113
- package/core/option/_m2-optgroup.scss +10 -7
- package/core/option/_m2-option.scss +13 -11
- package/core/option/_optgroup-theme.scss +28 -30
- package/core/option/_option-theme.scss +35 -34
- package/core/ripple/_m2-ripple.scss +6 -10
- package/core/ripple/_ripple-theme.scss +28 -33
- package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +2 -3
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +55 -45
- package/core/theming/_all-theme.scss +38 -42
- package/core/theming/_definition.scss +20 -13
- package/core/theming/_inspection.scss +0 -12
- package/core/theming/_m2-inspection.scss +0 -33
- package/core/theming/_theming.scss +4 -172
- package/core/tokens/_m2-utils.scss +5 -75
- package/core/tokens/_m3-system.scss +11 -9
- package/core/tokens/_m3-utils.scss +2 -14
- package/core/tokens/_token-utils.scss +7 -27
- package/core/tokens/m2/_index.scss +6 -0
- package/core/tokens/m2/_md-sys-color.scss +123 -0
- package/core/tokens/m2/_md-sys-elevation.scss +16 -0
- package/core/tokens/m2/_md-sys-motion.scss +36 -0
- package/core/tokens/m2/_md-sys-shape.scss +22 -0
- package/core/tokens/m2/_md-sys-state.scss +15 -0
- package/core/tokens/m2/_md-sys-typescale.scss +68 -0
- package/core/tokens/m3/_md-sys-color.scss +2 -2
- package/core/tokens/m3/_md-sys-typescale.scss +1 -1
- package/core/tokens/m3/_theme.scss +14 -26
- package/datepicker/_datepicker-theme.scss +47 -87
- package/datepicker/_m2-datepicker.scss +33 -123
- package/datepicker/index.d.ts +1 -1
- package/dialog/_dialog-theme.scss +28 -34
- package/dialog/_m2-dialog.scss +17 -17
- package/divider/_divider-theme.scss +28 -30
- package/divider/_m2-divider.scss +4 -2
- package/expansion/_expansion-theme.scss +28 -39
- package/expansion/_m2-expansion.scss +11 -10
- package/expansion/_m3-expansion.scss +2 -0
- package/fesm2022/animation-DfMFjxHu.mjs.map +1 -1
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +1 -1
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button/testing.mjs +7 -4
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +2 -2
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +1 -1
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/common-module-cKSwHniA.mjs.map +1 -1
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/date-formats-K6TQue-Y.mjs.map +1 -1
- package/fesm2022/date-range-input-harness-DEyfkeOs.mjs.map +1 -1
- package/fesm2022/datepicker/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +1 -1
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/error-options-DCNQlTOA.mjs.map +1 -1
- package/fesm2022/error-state-Dtb1IHM-.mjs.map +1 -1
- package/fesm2022/expansion/testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +2 -2
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing/control.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/{form-field-C9DZXojn.mjs → form-field-CFbrnFED.mjs} +3 -3
- package/fesm2022/form-field-CFbrnFED.mjs.map +1 -0
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon-button-DxiIc1ex.mjs.map +1 -1
- package/fesm2022/icon-registry-CwOTJ7YM.mjs.map +1 -1
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/index-BFRo2fUq.mjs.map +1 -1
- package/fesm2022/index-DwiL-HGk.mjs.map +1 -1
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/input-harness-C5Msdc4-.mjs.map +1 -1
- package/fesm2022/input-value-accessor-D1GvPuqO.mjs.map +1 -1
- package/fesm2022/input.mjs +3 -27
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/internal-form-field-D5iFxU6d.mjs.map +1 -1
- package/fesm2022/line-Bz5f9Cyx.mjs.map +1 -1
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs +97 -13
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +343 -122
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/{module-BDiw_nWS.mjs → module-B0CLRw5e.mjs} +3 -3
- package/fesm2022/module-B0CLRw5e.mjs.map +1 -0
- package/fesm2022/{module-DzZHEh7B.mjs → module-B62K-792.mjs} +2 -2
- package/fesm2022/module-B62K-792.mjs.map +1 -0
- package/fesm2022/module-CWxMD37a.mjs.map +1 -1
- package/fesm2022/module-Ce6F7TNm.mjs.map +1 -1
- package/fesm2022/option-BzhYL_xC.mjs.map +1 -1
- package/fesm2022/option-harness-BFcc-M_4.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +3 -3
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/pseudo-checkbox-DDmgx3P4.mjs.map +1 -1
- package/fesm2022/pseudo-checkbox-module-4F8Up4PL.mjs.map +1 -1
- package/fesm2022/public-api-BoO5eSq-.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/ripple-BYgV4oZC.mjs.map +1 -1
- package/fesm2022/ripple-loader-BnMiRtmT.mjs.map +1 -1
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select.mjs +3 -3
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav/testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +2 -2
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +2 -2
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +2 -2
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper/testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/structural-styles-CObeNzjn.mjs.map +1 -1
- package/fesm2022/table/testing.mjs.map +1 -1
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker/testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1 -1
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar/testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip/testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree/testing.mjs.map +1 -1
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +35 -51
- package/form-field/_m2-form-field.scss +23 -31
- package/grid-list/_grid-list-theme.scss +28 -28
- package/grid-list/_m2-grid-list.scss +7 -9
- package/icon/_icon-theme.scss +40 -41
- package/input/_input-theme.scss +1 -4
- package/input/index.d.ts +0 -11
- package/list/_list-theme.scss +55 -53
- package/list/_m2-list.scss +21 -35
- package/menu/_m2-menu.scss +18 -15
- package/menu/_menu-theme.scss +28 -33
- package/menu/index.d.ts +145 -61
- package/menu/testing/index.d.ts +50 -2
- package/package.json +2 -2
- package/paginator/_m2-paginator.scss +9 -9
- package/paginator/_paginator-theme.scss +28 -33
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/progress-bar/_progress-bar-theme.scss +35 -43
- package/progress-spinner/_progress-spinner-theme.scss +42 -43
- package/radio/_m2-radio.scss +6 -5
- package/radio/_m3-radio.scss +1 -1
- package/radio/_radio-theme.scss +33 -46
- package/schematics/ng-add/index.js +1 -1
- package/select/_m2-select.scss +10 -8
- package/select/_select-theme.scss +38 -48
- package/sidenav/_sidenav-theme.scss +28 -30
- package/slide-toggle/_m2-slide-toggle.scss +45 -58
- package/slide-toggle/_m3-slide-toggle.scss +1 -0
- package/slide-toggle/_slide-toggle-theme.scss +41 -79
- package/slider/_m2-slider.scss +33 -35
- package/slider/_slider-theme.scss +38 -45
- package/snack-bar/_m2-snack-bar.scss +5 -6
- package/snack-bar/_snack-bar-theme.scss +28 -31
- package/sort/_m2-sort.scss +5 -2
- package/sort/_sort-theme.scss +28 -33
- package/stepper/_m2-stepper.scss +10 -13
- package/stepper/_stepper-theme.scss +41 -49
- package/table/_m2-table.scss +23 -28
- package/table/_table-theme.scss +28 -36
- package/tabs/_m2-tabs.scss +11 -16
- package/tabs/_tabs-theme.scss +35 -43
- package/timepicker/_m2-timepicker.scss +5 -2
- package/timepicker/_timepicker-theme.scss +28 -46
- package/toolbar/_m2-toolbar.scss +10 -9
- package/toolbar/_toolbar-theme.scss +55 -46
- package/tooltip/_m2-tooltip.scss +5 -6
- package/tooltip/_tooltip-theme.scss +28 -37
- package/tree/_m2-tree.scss +9 -5
- package/tree/_tree-theme.scss +28 -38
- package/core/tokens/_format-tokens.scss +0 -5
- package/fesm2022/form-field-C9DZXojn.mjs.map +0 -1
- package/fesm2022/module-BDiw_nWS.mjs.map +0 -1
- package/fesm2022/module-DzZHEh7B.mjs.map +0 -1
package/chips/_m2-chip.scss
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use 'sass:meta';
|
|
3
|
-
@use 'sass:color';
|
|
4
2
|
@use '../core/theming/inspection';
|
|
5
|
-
@use '../core/m2/palette' as m2-palette;
|
|
6
3
|
@use '../core/theming/theming';
|
|
7
4
|
@use '../core/tokens/m2-utils';
|
|
8
5
|
@use '../core/tokens/m3-utils';
|
|
@@ -40,38 +37,24 @@
|
|
|
40
37
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
41
38
|
@function get-color-tokens($theme, $color-variant: null) {
|
|
42
39
|
$system: m2-utils.get-system($theme);
|
|
43
|
-
$
|
|
44
|
-
$
|
|
45
|
-
$state-layer-color: inspection.get-theme-color($theme, foreground, base);
|
|
40
|
+
$background: m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
|
|
41
|
+
$foreground: map.get($system, on-surface);
|
|
46
42
|
|
|
47
|
-
@if $color-variant
|
|
48
|
-
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
49
|
-
$grey-50: map.get(m2-palette.$grey-palette, 50);
|
|
50
|
-
$grey-900: map.get(m2-palette.$grey-palette, 900);
|
|
51
|
-
$foreground: if($is-dark, $grey-50, $grey-900);
|
|
52
|
-
|
|
53
|
-
$surface: map.get($system, surface);
|
|
54
|
-
$background: if(
|
|
55
|
-
meta.type-of($state-layer-color) == color and meta.type-of($surface) == color,
|
|
56
|
-
color.mix($state-layer-color, $surface, 12%),
|
|
57
|
-
$state-layer-color
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
@else {
|
|
43
|
+
@if $color-variant {
|
|
61
44
|
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
62
|
-
|
|
63
45
|
$background: map.get($system, primary);
|
|
64
46
|
$foreground: map.get($system, on-primary);
|
|
65
47
|
}
|
|
48
|
+
|
|
66
49
|
@return (
|
|
67
50
|
chip-disabled-label-text-color: $foreground,
|
|
68
51
|
chip-elevated-container-color: $background,
|
|
69
52
|
chip-elevated-disabled-container-color: $background,
|
|
70
53
|
chip-elevated-selected-container-color: $background,
|
|
71
54
|
chip-flat-disabled-selected-container-color: $background,
|
|
72
|
-
chip-focus-state-layer-color: $
|
|
55
|
+
chip-focus-state-layer-color: map.get($system, on-surface),
|
|
73
56
|
chip-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
|
|
74
|
-
chip-hover-state-layer-color: $
|
|
57
|
+
chip-hover-state-layer-color: map.get($system, on-surface),
|
|
75
58
|
chip-label-text-color: $foreground,
|
|
76
59
|
chip-selected-disabled-trailing-icon-color: $foreground,
|
|
77
60
|
chip-selected-focus-state-layer-color: map.get($system, focus-state-layer-opacity),
|
|
@@ -89,12 +72,13 @@
|
|
|
89
72
|
|
|
90
73
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
91
74
|
@function get-typography-tokens($theme) {
|
|
75
|
+
$system: m2-utils.get-system($theme);
|
|
92
76
|
@return (
|
|
93
|
-
chip-label-text-font:
|
|
94
|
-
chip-label-text-line-height:
|
|
95
|
-
chip-label-text-size:
|
|
96
|
-
chip-label-text-tracking:
|
|
97
|
-
chip-label-text-weight:
|
|
77
|
+
chip-label-text-font: map.get($system, body-medium-font),
|
|
78
|
+
chip-label-text-line-height: map.get($system, body-medium-line-height),
|
|
79
|
+
chip-label-text-size: map.get($system, body-medium-size),
|
|
80
|
+
chip-label-text-tracking: map.get($system, body-medium-tracking),
|
|
81
|
+
chip-label-text-weight: map.get($system, body-medium-weight)
|
|
98
82
|
);
|
|
99
83
|
}
|
|
100
84
|
|
package/core/_core-theme.scss
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
@use './theming/theming';
|
|
2
1
|
@use './theming/inspection';
|
|
3
2
|
@use './ripple/ripple-theme';
|
|
4
3
|
@use './option/option-theme';
|
|
5
4
|
@use './option/optgroup-theme';
|
|
6
5
|
@use './selection/pseudo-checkbox/pseudo-checkbox-theme';
|
|
7
|
-
@use './style/sass-utils';
|
|
8
6
|
@use './typography/typography';
|
|
9
7
|
@use './tokens/token-utils';
|
|
10
8
|
@use './m2-app';
|
|
@@ -16,71 +14,59 @@
|
|
|
16
14
|
@use 'sass:map';
|
|
17
15
|
|
|
18
16
|
@mixin base($theme) {
|
|
17
|
+
$tokens: m2-app.get-unthemable-tokens();
|
|
19
18
|
@if inspection.get-theme-version($theme) == 1 {
|
|
20
|
-
|
|
21
|
-
@include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), base));
|
|
22
|
-
@include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), base));
|
|
23
|
-
@include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), base));
|
|
24
|
-
@include token-utils.create-token-values(map.get(m3-pseudo-checkbox.get-tokens($theme), base));
|
|
25
|
-
} @else {
|
|
26
|
-
@include ripple-theme.base($theme);
|
|
27
|
-
@include option-theme.base($theme);
|
|
28
|
-
@include optgroup-theme.base($theme);
|
|
29
|
-
@include pseudo-checkbox-theme.base($theme);
|
|
30
|
-
@include sass-utils.current-selector-or-root() {
|
|
31
|
-
@include token-utils.create-token-values-mixed(m2-app.get-unthemable-tokens());
|
|
32
|
-
}
|
|
19
|
+
$tokens: map.get(m3-app.get-tokens($theme), base);
|
|
33
20
|
}
|
|
21
|
+
|
|
22
|
+
@include token-utils.values($tokens);
|
|
23
|
+
|
|
24
|
+
@include ripple-theme.base($theme);
|
|
25
|
+
@include option-theme.base($theme);
|
|
26
|
+
@include optgroup-theme.base($theme);
|
|
27
|
+
@include pseudo-checkbox-theme.base($theme);
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
@mixin color($theme) {
|
|
31
|
+
$tokens: m2-app.get-color-tokens($theme);
|
|
37
32
|
@if inspection.get-theme-version($theme) == 1 {
|
|
38
|
-
|
|
39
|
-
@include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), color));
|
|
40
|
-
@include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), color));
|
|
41
|
-
@include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), color));
|
|
42
|
-
@include token-utils.create-token-values(map.get(m3-pseudo-checkbox.get-tokens($theme), color));
|
|
43
|
-
} @else {
|
|
44
|
-
@include ripple-theme.color($theme);
|
|
45
|
-
@include option-theme.color($theme);
|
|
46
|
-
@include optgroup-theme.color($theme);
|
|
47
|
-
@include pseudo-checkbox-theme.color($theme);
|
|
48
|
-
@include sass-utils.current-selector-or-root() {
|
|
49
|
-
@include token-utils.create-token-values-mixed(m2-app.get-color-tokens($theme));
|
|
50
|
-
}
|
|
33
|
+
$tokens: map.get(m3-app.get-tokens($theme), color);
|
|
51
34
|
}
|
|
35
|
+
|
|
36
|
+
@include token-utils.values($tokens);
|
|
37
|
+
|
|
38
|
+
@include ripple-theme.color($theme);
|
|
39
|
+
@include option-theme.color($theme);
|
|
40
|
+
@include optgroup-theme.color($theme);
|
|
41
|
+
@include pseudo-checkbox-theme.color($theme);
|
|
52
42
|
}
|
|
53
43
|
|
|
54
44
|
@mixin typography($theme) {
|
|
45
|
+
$tokens: m2-app.get-typography-tokens($theme);
|
|
55
46
|
@if inspection.get-theme-version($theme) == 1 {
|
|
56
|
-
|
|
57
|
-
@include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), typography));
|
|
58
|
-
@include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), typography));
|
|
59
|
-
@include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), typography));
|
|
60
|
-
@include token-utils.create-token-values(
|
|
61
|
-
map.get(m3-pseudo-checkbox.get-tokens($theme), typography));
|
|
62
|
-
} @else {
|
|
63
|
-
@include option-theme.typography($theme);
|
|
64
|
-
@include optgroup-theme.typography($theme);
|
|
65
|
-
@include pseudo-checkbox-theme.typography($theme);
|
|
66
|
-
@include ripple-theme.typography($theme);
|
|
47
|
+
$tokens: map.get(m3-app.get-tokens($theme), typography);
|
|
67
48
|
}
|
|
49
|
+
|
|
50
|
+
@include token-utils.values($tokens);
|
|
51
|
+
|
|
52
|
+
@include ripple-theme.typography($theme);
|
|
53
|
+
@include option-theme.typography($theme);
|
|
54
|
+
@include optgroup-theme.typography($theme);
|
|
55
|
+
@include pseudo-checkbox-theme.typography($theme);
|
|
68
56
|
}
|
|
69
57
|
|
|
70
58
|
@mixin density($theme) {
|
|
59
|
+
$tokens: m2-app.get-density-tokens($theme);
|
|
71
60
|
@if inspection.get-theme-version($theme) == 1 {
|
|
72
|
-
|
|
73
|
-
@include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), density));
|
|
74
|
-
@include token-utils.create-token-values(map.get(m3-option.get-tokens($theme), density));
|
|
75
|
-
@include token-utils.create-token-values(map.get(m3-optgroup.get-tokens($theme), density));
|
|
76
|
-
@include token-utils.create-token-values(
|
|
77
|
-
map.get(m3-pseudo-checkbox.get-tokens($theme), density));
|
|
78
|
-
} @else {
|
|
79
|
-
@include option-theme.density($theme);
|
|
80
|
-
@include optgroup-theme.density($theme);
|
|
81
|
-
@include pseudo-checkbox-theme.density($theme);
|
|
82
|
-
@include ripple-theme.density($theme);
|
|
61
|
+
$tokens: map.get(m3-app.get-tokens($theme), density);
|
|
83
62
|
}
|
|
63
|
+
|
|
64
|
+
@include token-utils.values($tokens);
|
|
65
|
+
|
|
66
|
+
@include ripple-theme.density($theme);
|
|
67
|
+
@include option-theme.density($theme);
|
|
68
|
+
@include optgroup-theme.density($theme);
|
|
69
|
+
@include pseudo-checkbox-theme.density($theme);
|
|
84
70
|
}
|
|
85
71
|
|
|
86
72
|
@function _define-overrides() {
|
|
@@ -119,26 +105,21 @@
|
|
|
119
105
|
|
|
120
106
|
// Mixin that renders all of the core styles that depend on the theme.
|
|
121
107
|
@mixin theme($theme) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
@
|
|
127
|
-
|
|
108
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
109
|
+
@include base($theme);
|
|
110
|
+
@include color($theme);
|
|
111
|
+
@include density($theme);
|
|
112
|
+
@include typography($theme);
|
|
113
|
+
} @else {
|
|
114
|
+
@include base($theme);
|
|
115
|
+
@if inspection.theme-has($theme, color) {
|
|
128
116
|
@include color($theme);
|
|
117
|
+
}
|
|
118
|
+
@if inspection.theme-has($theme, density) {
|
|
129
119
|
@include density($theme);
|
|
120
|
+
}
|
|
121
|
+
@if inspection.theme-has($theme, typography) {
|
|
130
122
|
@include typography($theme);
|
|
131
|
-
} @else {
|
|
132
|
-
@include base($theme);
|
|
133
|
-
@if inspection.theme-has($theme, color) {
|
|
134
|
-
@include color($theme);
|
|
135
|
-
}
|
|
136
|
-
@if inspection.theme-has($theme, density) {
|
|
137
|
-
@include density($theme);
|
|
138
|
-
}
|
|
139
|
-
@if inspection.theme-has($theme, typography) {
|
|
140
|
-
@include typography($theme);
|
|
141
|
-
}
|
|
142
123
|
}
|
|
143
124
|
}
|
|
144
125
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use 'sass:meta';
|
|
3
3
|
@use '@angular/cdk';
|
|
4
4
|
@use '../style/layout-common';
|
|
5
|
-
@use '../theming/theming';
|
|
6
5
|
@use '../theming/inspection';
|
|
7
6
|
|
|
8
7
|
// Private sass variables that will be used as reference throughout component stylesheets.
|
|
@@ -104,10 +103,8 @@ $default-border-radius: 4px;
|
|
|
104
103
|
@include _customize-focus-indicators((border-color: $theme-or-color));
|
|
105
104
|
}
|
|
106
105
|
@else {
|
|
107
|
-
@
|
|
108
|
-
@
|
|
109
|
-
@include strong-focus-indicators-color($theme-or-color);
|
|
110
|
-
}
|
|
106
|
+
@if inspection.theme-has($theme-or-color, color) {
|
|
107
|
+
@include strong-focus-indicators-color($theme-or-color);
|
|
111
108
|
}
|
|
112
109
|
}
|
|
113
110
|
}
|
package/core/m2/_theming.scss
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@use 'sass:meta';
|
|
4
4
|
@use 'sass:color';
|
|
5
5
|
@use '../theming/theming';
|
|
6
|
+
@use '../tokens/m2';
|
|
6
7
|
@use './palette';
|
|
7
8
|
|
|
8
9
|
/// Extracts a color from a palette or throws an error if it doesn't exist.
|
|
@@ -113,83 +114,52 @@
|
|
|
113
114
|
@return $theme;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
@function _mat-create-light-color-config($primary, $accent, $warn: null) {
|
|
119
|
-
$warn: if($warn != null, $warn, define-palette(palette.$red-palette));
|
|
120
|
-
@return (
|
|
117
|
+
@function _define-system($primary, $accent, $warn, $is-dark, $typography) {
|
|
118
|
+
$palettes: (
|
|
121
119
|
primary: $primary,
|
|
122
120
|
accent: $accent,
|
|
123
121
|
warn: $warn,
|
|
124
|
-
is-dark: false,
|
|
125
|
-
foreground: palette.$light-theme-foreground-palette,
|
|
126
|
-
background: palette.$light-theme-background-palette,
|
|
127
|
-
system: (
|
|
128
|
-
surface: white,
|
|
129
|
-
surface-variant: #f6f6f6,
|
|
130
|
-
on-surface: rgba(black, 0.87),
|
|
131
|
-
on-surface-variant: rgba(black, 0.54),
|
|
132
|
-
background: map.get(palette.$grey-palette, 50),
|
|
133
|
-
inverse-surface: map.get(palette.$grey-palette, 800),
|
|
134
|
-
inverse-on-surface: white,
|
|
135
|
-
outline: rgba(black, 0.12),
|
|
136
|
-
outline-variant: rgba(black, 0.38),
|
|
137
|
-
hover-state-layer-opacity: 0.04,
|
|
138
|
-
focus-state-layer-opacity: 0.12,
|
|
139
|
-
pressed-state-layer-opacity: 0.12,
|
|
140
|
-
shadow: black,
|
|
141
|
-
primary: map.get($primary, default),
|
|
142
|
-
on-primary: map.get($primary, default-contrast),
|
|
143
|
-
secondary: map.get($accent, default),
|
|
144
|
-
on-secondary: map.get($accent, default-contrast),
|
|
145
|
-
error: map.get($warn, default),
|
|
146
|
-
on-error: map.get($warn, default-contrast),
|
|
147
|
-
),
|
|
148
122
|
);
|
|
123
|
+
|
|
124
|
+
$sys-color: if(
|
|
125
|
+
$is-dark,
|
|
126
|
+
m2.md-sys-color-values-dark($palettes),
|
|
127
|
+
m2.md-sys-color-values-light($palettes));
|
|
128
|
+
$sys-state: m2.md-sys-state-values();
|
|
129
|
+
$sys-typography: m2.md-sys-typescale-values($typography);
|
|
130
|
+
|
|
131
|
+
$system: ();
|
|
132
|
+
@each $map in ($sys-color, $sys-state, $sys-typography) {
|
|
133
|
+
$system: map.merge($system, $map);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@return $system;
|
|
149
137
|
}
|
|
150
138
|
|
|
151
|
-
// Creates a
|
|
139
|
+
// Creates a color configuration from the specified
|
|
152
140
|
// primary, accent and warn palettes.
|
|
153
|
-
@function _mat-create-
|
|
141
|
+
@function _mat-create-color-config($primary, $accent, $warn: null, $is-dark) {
|
|
154
142
|
$warn: if($warn != null, $warn, define-palette(palette.$red-palette));
|
|
143
|
+
$foreground:
|
|
144
|
+
if($is-dark, palette.$dark-theme-foreground-palette, palette.$light-theme-foreground-palette);
|
|
145
|
+
$background:
|
|
146
|
+
if($is-dark, palette.$dark-theme-background-palette, palette.$light-theme-background-palette);
|
|
147
|
+
|
|
155
148
|
@return (
|
|
156
149
|
primary: $primary,
|
|
157
150
|
accent: $accent,
|
|
158
151
|
warn: $warn,
|
|
159
|
-
is-dark:
|
|
160
|
-
foreground:
|
|
161
|
-
background:
|
|
162
|
-
system: (
|
|
163
|
-
surface: map.get(palette.$grey-palette, 800),
|
|
164
|
-
surface-variant: #4a4a4a,
|
|
165
|
-
on-surface: white,
|
|
166
|
-
on-surface-variant: rgba(white, 0.7),
|
|
167
|
-
background: #303030,
|
|
168
|
-
inverse-surface: white,
|
|
169
|
-
inverse-on-surface: rgba(black, 0.87),
|
|
170
|
-
outline: rgba(white, 0.12),
|
|
171
|
-
outline-variant: rgba(white, 0.38),
|
|
172
|
-
hover-state-layer-opacity: 0.04,
|
|
173
|
-
focus-state-layer-opacity: 0.12,
|
|
174
|
-
pressed-state-layer-opacity: 0.12,
|
|
175
|
-
shadow: black,
|
|
176
|
-
primary: map.get($primary, default),
|
|
177
|
-
on-primary: map.get($primary, default-contrast),
|
|
178
|
-
secondary: map.get($accent, default),
|
|
179
|
-
on-secondary: map.get($accent, default-contrast),
|
|
180
|
-
error: map.get($warn, default),
|
|
181
|
-
on-error: map.get($warn, default-contrast),
|
|
182
|
-
),
|
|
152
|
+
is-dark: $is-dark,
|
|
153
|
+
foreground: $foreground,
|
|
154
|
+
background: $background,
|
|
183
155
|
);
|
|
184
156
|
}
|
|
185
157
|
|
|
186
|
-
|
|
187
|
-
// as it would break existing apps that set the parameter by name.
|
|
188
|
-
|
|
189
|
-
/// Creates a container object for a light theme to be given to individual component theme mixins.
|
|
158
|
+
/// Creates a container object for a theme to be given to individual component theme mixins.
|
|
190
159
|
/// @param {Map} $primary The theme configuration object.
|
|
191
160
|
/// @returns {Map} A complete Angular Material theme map.
|
|
192
|
-
@function
|
|
161
|
+
@function _define-theme(
|
|
162
|
+
$primary, $accent: null, $warn: define-palette(palette.$red-palette), $is-dark) {
|
|
193
163
|
// This function creates a container object for the individual component theme mixins. Consumers
|
|
194
164
|
// can construct such an object by calling this function, or by building the object manually.
|
|
195
165
|
// There are two possible ways to invoke this function in order to create such an object:
|
|
@@ -206,13 +176,21 @@
|
|
|
206
176
|
@if $accent != null {
|
|
207
177
|
@warn theming.$private-legacy-theme-warning;
|
|
208
178
|
$theme: _mat-validate-theme(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
179
|
+
(
|
|
180
|
+
_is-legacy-theme: true,
|
|
181
|
+
color: _mat-create-color-config($primary, $accent, $warn, $is-dark),
|
|
182
|
+
)
|
|
213
183
|
);
|
|
214
184
|
|
|
215
|
-
|
|
185
|
+
$theme: _internalize-theme(theming.private-create-backwards-compatibility-theme($theme));
|
|
186
|
+
$system: _define-system(
|
|
187
|
+
$primary: $primary,
|
|
188
|
+
$accent: $accent,
|
|
189
|
+
$warn: $warn,
|
|
190
|
+
$is-dark: $is-dark,
|
|
191
|
+
$typography: ());
|
|
192
|
+
$theme: map.set($theme, _mat-system, $system);
|
|
193
|
+
@return $theme;
|
|
216
194
|
}
|
|
217
195
|
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
218
196
|
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
@@ -224,15 +202,33 @@
|
|
|
224
202
|
$accent: map.get($color-settings, accent);
|
|
225
203
|
$warn: map.get($color-settings, warn);
|
|
226
204
|
$result: map.merge(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
205
|
+
$result,
|
|
206
|
+
(
|
|
207
|
+
color: _mat-create-color-config($primary, $accent, $warn, $is-dark),
|
|
208
|
+
)
|
|
231
209
|
);
|
|
232
210
|
}
|
|
233
|
-
|
|
234
|
-
|
|
211
|
+
$theme: _internalize-theme(
|
|
212
|
+
theming.private-create-backwards-compatibility-theme(_mat-validate-theme($result))
|
|
235
213
|
);
|
|
214
|
+
$system: _define-system(
|
|
215
|
+
$primary: map.get($result, primary) or map.get($result, color, primary) or (),
|
|
216
|
+
$accent: map.get($result, accent) or map.get($result, color, accent) or (),
|
|
217
|
+
$warn: map.get($result, warn) or map.get($result, color, warn) or (),
|
|
218
|
+
$is-dark: $is-dark,
|
|
219
|
+
$typography: map.get($result, typography) or ());
|
|
220
|
+
$theme: map.set($theme, _mat-system, $system);
|
|
221
|
+
@return $theme;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// TODO: Remove legacy API and rename `$primary` below to `$config`. Currently it cannot be renamed
|
|
225
|
+
// as it would break existing apps that set the parameter by name.
|
|
226
|
+
|
|
227
|
+
/// Creates a container object for a light theme to be given to individual component theme mixins.
|
|
228
|
+
/// @param {Map} $primary The theme configuration object.
|
|
229
|
+
/// @returns {Map} A complete Angular Material theme map.
|
|
230
|
+
@function define-light-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
231
|
+
@return _define-theme($primary, $accent, $warn, false);
|
|
236
232
|
}
|
|
237
233
|
|
|
238
234
|
// TODO: Remove legacy API and rename below `$primary` to `$config`. Currently it cannot be renamed
|
|
@@ -242,48 +238,7 @@
|
|
|
242
238
|
/// @param {Map} $primary The theme configuration object.
|
|
243
239
|
/// @returns {Map} A complete Angular Material theme map.
|
|
244
240
|
@function define-dark-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
245
|
-
|
|
246
|
-
// can construct such an object by calling this function, or by building the object manually.
|
|
247
|
-
// There are two possible ways to invoke this function in order to create such an object:
|
|
248
|
-
//
|
|
249
|
-
// (1) Passing in a map that holds optional configurations for individual parts of the
|
|
250
|
-
// theming system. For `color` configurations, the function only expects the palettes
|
|
251
|
-
// for `primary` and `accent` (and optionally `warn`). The function will expand the
|
|
252
|
-
// shorthand into an actual configuration that can be consumed in `-color` mixins.
|
|
253
|
-
// (2) Legacy pattern: Passing in the palettes as parameters. This is not as flexible
|
|
254
|
-
// as passing in a configuration map because only the `color` system can be configured.
|
|
255
|
-
//
|
|
256
|
-
// If the legacy pattern is used, we generate a container object only with a dark-themed
|
|
257
|
-
// configuration for the `color` theming part.
|
|
258
|
-
@if $accent != null {
|
|
259
|
-
@warn theming.$private-legacy-theme-warning;
|
|
260
|
-
$theme: _mat-validate-theme(
|
|
261
|
-
(
|
|
262
|
-
_is-legacy-theme: true,
|
|
263
|
-
color: _mat-create-dark-color-config($primary, $accent, $warn),
|
|
264
|
-
)
|
|
265
|
-
);
|
|
266
|
-
@return _internalize-theme(theming.private-create-backwards-compatibility-theme($theme));
|
|
267
|
-
}
|
|
268
|
-
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
269
|
-
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
270
|
-
// above, the color shorthand will be expanded to an actual dark-themed color configuration.
|
|
271
|
-
$result: $primary;
|
|
272
|
-
@if map.get($primary, color) {
|
|
273
|
-
$color-settings: map.get($primary, color);
|
|
274
|
-
$primary: map.get($color-settings, primary);
|
|
275
|
-
$accent: map.get($color-settings, accent);
|
|
276
|
-
$warn: map.get($color-settings, warn);
|
|
277
|
-
$result: map.merge(
|
|
278
|
-
$result,
|
|
279
|
-
(
|
|
280
|
-
color: _mat-create-dark-color-config($primary, $accent, $warn),
|
|
281
|
-
)
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
@return _internalize-theme(
|
|
285
|
-
theming.private-create-backwards-compatibility-theme(_mat-validate-theme($result))
|
|
286
|
-
);
|
|
241
|
+
@return _define-theme($primary, $accent, $warn, true);
|
|
287
242
|
}
|
|
288
243
|
|
|
289
244
|
/// Gets the color configuration from the given theme or configuration.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
@use '../
|
|
1
|
+
@use '../tokens/m2-utils';
|
|
2
|
+
@use 'sass:map';
|
|
2
3
|
|
|
3
4
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
4
5
|
// but may be in a future version of the theming API.
|
|
@@ -8,19 +9,21 @@
|
|
|
8
9
|
|
|
9
10
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
10
11
|
@function get-color-tokens($theme) {
|
|
12
|
+
$system: m2-utils.get-system($theme);
|
|
11
13
|
@return (
|
|
12
|
-
optgroup-label-text-color:
|
|
14
|
+
optgroup-label-text-color: map.get($system, on-surface),
|
|
13
15
|
);
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
17
19
|
@function get-typography-tokens($theme) {
|
|
20
|
+
$system: m2-utils.get-system($theme);
|
|
18
21
|
@return (
|
|
19
|
-
optgroup-label-text-font:
|
|
20
|
-
optgroup-label-text-line-height:
|
|
21
|
-
optgroup-label-text-size:
|
|
22
|
-
optgroup-label-text-tracking:
|
|
23
|
-
optgroup-label-text-weight:
|
|
22
|
+
optgroup-label-text-font: map.get($system, body-large-font),
|
|
23
|
+
optgroup-label-text-line-height: map.get($system, body-large-line-height),
|
|
24
|
+
optgroup-label-text-size: map.get($system, body-large-size),
|
|
25
|
+
optgroup-label-text-tracking: map.get($system, body-large-tracking),
|
|
26
|
+
optgroup-label-text-weight: map.get($system, body-large-weight)
|
|
24
27
|
);
|
|
25
28
|
}
|
|
26
29
|
|
|
@@ -12,28 +12,30 @@
|
|
|
12
12
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
13
13
|
@function get-color-tokens($theme, $color-variant) {
|
|
14
14
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
15
|
-
$active-state-layer-color: inspection.get-theme-color($theme, foreground, base,
|
|
16
|
-
if($is-dark, 0.08, 0.04));
|
|
17
15
|
$system: m2-utils.get-system($theme);
|
|
18
16
|
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
19
17
|
|
|
20
18
|
@return (
|
|
21
19
|
option-selected-state-label-text-color: map.get($system, primary),
|
|
22
|
-
option-label-text-color:
|
|
23
|
-
option-hover-state-layer-color:
|
|
24
|
-
|
|
25
|
-
option-
|
|
20
|
+
option-label-text-color: map.get($system, on-surface),
|
|
21
|
+
option-hover-state-layer-color: m3-utils.color-with-opacity(
|
|
22
|
+
map.get($system, on-surface), map.get($system, hover-state-layer-opacity)),
|
|
23
|
+
option-focus-state-layer-color: m3-utils.color-with-opacity(
|
|
24
|
+
map.get($system, on-surface), map.get($system, focus-state-layer-opacity)),
|
|
25
|
+
option-selected-state-layer-color: m3-utils.color-with-opacity(
|
|
26
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
26
27
|
);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
30
31
|
@function get-typography-tokens($theme) {
|
|
32
|
+
$system: m2-utils.get-system($theme);
|
|
31
33
|
@return (
|
|
32
|
-
option-label-text-font:
|
|
33
|
-
option-label-text-line-height:
|
|
34
|
-
option-label-text-size:
|
|
35
|
-
option-label-text-tracking:
|
|
36
|
-
option-label-text-weight:
|
|
34
|
+
option-label-text-font: map.get($system, body-large-font),
|
|
35
|
+
option-label-text-line-height: map.get($system, body-large-line-height),
|
|
36
|
+
option-label-text-size: map.get($system, body-large-size),
|
|
37
|
+
option-label-text-tracking: map.get($system, body-large-tracking),
|
|
38
|
+
option-label-text-weight: map.get($system, body-large-weight)
|
|
37
39
|
);
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -2,43 +2,43 @@
|
|
|
2
2
|
@use './m2-optgroup';
|
|
3
3
|
@use './m3-optgroup';
|
|
4
4
|
@use '../tokens/token-utils';
|
|
5
|
-
@use '../style/sass-utils';
|
|
6
|
-
@use '../theming/theming';
|
|
7
5
|
@use '../theming/inspection';
|
|
8
6
|
@use '../typography/typography';
|
|
9
7
|
|
|
10
8
|
@mixin base($theme) {
|
|
9
|
+
$tokens: m2-optgroup.get-unthemable-tokens();
|
|
11
10
|
@if inspection.get-theme-version($theme) == 1 {
|
|
12
|
-
|
|
13
|
-
} @else {
|
|
11
|
+
$tokens: map.get(m3-optgroup.get-tokens($theme), base);
|
|
14
12
|
}
|
|
13
|
+
|
|
14
|
+
@include token-utils.values($tokens);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
@mixin color($theme) {
|
|
18
|
+
$tokens: m2-optgroup.get-color-tokens($theme);
|
|
18
19
|
@if inspection.get-theme-version($theme) == 1 {
|
|
19
|
-
|
|
20
|
-
} @else {
|
|
21
|
-
@include sass-utils.current-selector-or-root() {
|
|
22
|
-
@include token-utils.create-token-values-mixed(m2-optgroup.get-color-tokens($theme));
|
|
23
|
-
}
|
|
20
|
+
$tokens: map.get(m3-optgroup.get-tokens($theme), color);
|
|
24
21
|
}
|
|
22
|
+
|
|
23
|
+
@include token-utils.values($tokens);
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
@mixin typography($theme) {
|
|
27
|
+
$tokens: m2-optgroup.get-typography-tokens($theme);
|
|
28
28
|
@if inspection.get-theme-version($theme) == 1 {
|
|
29
|
-
|
|
30
|
-
} @else {
|
|
31
|
-
@include sass-utils.current-selector-or-root() {
|
|
32
|
-
@include token-utils.create-token-values-mixed(m2-optgroup.get-typography-tokens($theme));
|
|
33
|
-
}
|
|
29
|
+
$tokens: map.get(m3-optgroup.get-tokens($theme), typography);
|
|
34
30
|
}
|
|
31
|
+
|
|
32
|
+
@include token-utils.values($tokens);
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
@mixin density($theme) {
|
|
36
|
+
$tokens: m2-optgroup.get-density-tokens($theme);
|
|
38
37
|
@if inspection.get-theme-version($theme) == 1 {
|
|
39
|
-
|
|
40
|
-
} @else {
|
|
38
|
+
$tokens: map.get(m3-optgroup.get-tokens($theme), density);
|
|
41
39
|
}
|
|
40
|
+
|
|
41
|
+
@include token-utils.values($tokens);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -56,23 +56,21 @@
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
@mixin theme($theme) {
|
|
59
|
-
@
|
|
60
|
-
@
|
|
61
|
-
|
|
59
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
60
|
+
@include base($theme);
|
|
61
|
+
@include color($theme);
|
|
62
|
+
@include density($theme);
|
|
63
|
+
@include typography($theme);
|
|
64
|
+
} @else {
|
|
65
|
+
@include base($theme);
|
|
66
|
+
@if inspection.theme-has($theme, color) {
|
|
62
67
|
@include color($theme);
|
|
68
|
+
}
|
|
69
|
+
@if inspection.theme-has($theme, density) {
|
|
63
70
|
@include density($theme);
|
|
71
|
+
}
|
|
72
|
+
@if inspection.theme-has($theme, typography) {
|
|
64
73
|
@include typography($theme);
|
|
65
|
-
} @else {
|
|
66
|
-
@include base($theme);
|
|
67
|
-
@if inspection.theme-has($theme, color) {
|
|
68
|
-
@include color($theme);
|
|
69
|
-
}
|
|
70
|
-
@if inspection.theme-has($theme, density) {
|
|
71
|
-
@include density($theme);
|
|
72
|
-
}
|
|
73
|
-
@if inspection.theme-has($theme, typography) {
|
|
74
|
-
@include typography($theme);
|
|
75
|
-
}
|
|
76
74
|
}
|
|
77
75
|
}
|
|
78
76
|
}
|