@angular/material 16.2.0-next.4 → 16.2.0-rc.0
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/badge/_badge-theme.scss +84 -118
- package/bottom-sheet/_bottom-sheet-theme.scss +10 -11
- package/bottom-sheet/index.d.ts +6 -0
- package/button-toggle/_button-toggle-theme.scss +20 -97
- package/button-toggle/_button-toggle-variables.scss +2 -0
- package/chips/index.d.ts +11 -4
- package/core/index.d.ts +1 -0
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-common.scss +1 -1
- package/core/tokens/_token-utils.scss +1 -0
- package/core/tokens/m2/mat/_badge.scss +78 -0
- package/core/tokens/m2/mat/_bottom-sheet.scss +56 -0
- package/core/tokens/m2/mat/_datepicker.scss +184 -0
- package/core/tokens/m2/mat/_divider.scss +45 -0
- package/core/tokens/m2/mat/_form-field.scss +44 -0
- package/core/tokens/m2/mat/_grid-list.scss +46 -0
- package/core/tokens/m2/mat/_icon.scss +45 -0
- package/core/tokens/m2/mat/_legacy-button-toggle.scss +63 -0
- package/core/tokens/m2/mat/_sidenav.scss +65 -0
- package/core/tokens/m2/mat/_slide-toggle.scss +1 -1
- package/core/tokens/m2/mat/_standard-button-toggle.scss +87 -0
- package/core/tokens/m2/mat/_tab-header.scss +1 -1
- package/core/tokens/m2/mat/_toolbar.scss +79 -0
- package/core/tokens/m2/mdc/_circular-progress.scss +1 -1
- package/core/tokens/m2/mdc/_filled-text-field.scss +175 -0
- package/core/tokens/m2/mdc/_outlined-text-field.scss +158 -0
- package/core/tokens/m2/mdc/_plain-tooltip.scss +2 -2
- package/datepicker/_datepicker-theme.scss +44 -203
- package/dialog/index.d.ts +6 -0
- package/divider/_divider-theme.scss +6 -8
- package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
- package/esm2022/bottom-sheet/bottom-sheet-ref.mjs +8 -1
- package/esm2022/button-toggle/button-toggle.mjs +2 -2
- package/esm2022/chips/chip-option.mjs +4 -5
- package/esm2022/chips/chip-row.mjs +15 -10
- package/esm2022/chips/chip.mjs +29 -12
- package/esm2022/core/private/ripple-loader.mjs +4 -1
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar-body.mjs +2 -2
- package/esm2022/datepicker/calendar.mjs +2 -2
- package/esm2022/datepicker/date-range-input.mjs +2 -2
- package/esm2022/datepicker/datepicker-base.mjs +3 -3
- package/esm2022/datepicker/datepicker-toggle.mjs +2 -2
- package/esm2022/dialog/dialog-ref.mjs +1 -1
- package/esm2022/dialog/dialog.mjs +2 -1
- package/esm2022/divider/divider.mjs +2 -2
- package/esm2022/form-field/form-field.mjs +3 -3
- package/esm2022/grid-list/grid-list.mjs +2 -2
- package/esm2022/grid-list/grid-tile.mjs +2 -2
- package/esm2022/icon/icon.mjs +2 -2
- package/esm2022/menu/menu-item.mjs +4 -4
- package/esm2022/menu/menu.mjs +3 -3
- package/esm2022/radio/radio.mjs +13 -1
- package/esm2022/sidenav/drawer.mjs +3 -3
- package/esm2022/sidenav/sidenav.mjs +3 -3
- package/esm2022/slide-toggle/slide-toggle.mjs +2 -2
- package/esm2022/tabs/ink-bar.mjs +1 -1
- package/esm2022/tabs/tab-group.mjs +2 -2
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
- package/esm2022/toolbar/toolbar.mjs +2 -2
- package/fesm2022/bottom-sheet.mjs +9 -2
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +2 -2
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/chips.mjs +41 -17
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +4 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +10 -10
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +1 -0
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider.mjs +2 -2
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +4 -4
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon.mjs +2 -2
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/menu.mjs +5 -5
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/radio.mjs +12 -0
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +4 -4
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +2 -2
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/tabs.mjs +4 -4
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +2 -2
- package/fesm2022/toolbar.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +37 -44
- package/form-field/_mdc-text-field-structure-overrides.scss +18 -0
- package/grid-list/_grid-list-theme.scss +7 -6
- package/icon/_icon-theme.scss +18 -8
- package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
- package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
- package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
- package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
- package/package.json +49 -49
- 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/radio/index.d.ts +4 -1
- 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-update/index_bundled.js +25 -25
- package/sidenav/_sidenav-theme.scss +6 -69
- package/tabs/_tabs-common.scss +1 -1
- package/tabs/index.d.ts +1 -1
- package/toolbar/_toolbar-theme.scss +25 -71
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
@use '../../../typography/typography-utils';
|
|
4
|
+
@use '../../../theming/theming';
|
|
5
|
+
@use '../../../style/sass-utils';
|
|
6
|
+
|
|
7
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
8
|
+
$prefix: (mat, bottom-sheet);
|
|
9
|
+
|
|
10
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
11
|
+
// but may be in a future version of the theming API.
|
|
12
|
+
@function get-unthemable-tokens() {
|
|
13
|
+
@return (
|
|
14
|
+
// TODO: will be necessary for M3.
|
|
15
|
+
container-shape: 4px,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
20
|
+
@function get-color-tokens($config) {
|
|
21
|
+
$foreground: map.get($config, foreground);
|
|
22
|
+
$background: map.get($config, background);
|
|
23
|
+
|
|
24
|
+
@return (
|
|
25
|
+
container-text-color: theming.get-color-from-palette($foreground, text),
|
|
26
|
+
container-background-color: theming.get-color-from-palette($background, dialog),
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
31
|
+
@function get-typography-tokens($config) {
|
|
32
|
+
@return (
|
|
33
|
+
container-text-font: typography-utils.font-family($config, body-1) or
|
|
34
|
+
typography-utils.font-family($config),
|
|
35
|
+
container-text-line-height: typography-utils.line-height($config, body-1),
|
|
36
|
+
container-text-size: typography-utils.font-size($config, body-1),
|
|
37
|
+
container-text-tracking: typography-utils.letter-spacing($config, body-1),
|
|
38
|
+
container-text-weight: typography-utils.font-weight($config, body-1),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
43
|
+
@function get-density-tokens($config) {
|
|
44
|
+
@return ();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
48
|
+
// This is used to create token slots.
|
|
49
|
+
@function get-token-slots() {
|
|
50
|
+
@return sass-utils.deep-merge-all(
|
|
51
|
+
get-unthemable-tokens(),
|
|
52
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
53
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
54
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
@use 'sass:math';
|
|
5
|
+
@use '../../token-utils';
|
|
6
|
+
@use '../../../theming/theming';
|
|
7
|
+
@use '../../../typography/typography-utils';
|
|
8
|
+
@use '../../../style/sass-utils';
|
|
9
|
+
|
|
10
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
11
|
+
$prefix: (mat, datepicker);
|
|
12
|
+
|
|
13
|
+
$_selected-fade-amount: 0.6;
|
|
14
|
+
$_today-fade-amount: 0.2;
|
|
15
|
+
|
|
16
|
+
// Utility that produces a range background color from a specific color.
|
|
17
|
+
@function private-get-range-background-color($color) {
|
|
18
|
+
@return rgba($color, 0.2);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Utility that produces the overlap selected color from an overlap color.
|
|
22
|
+
@function private-get-default-overlap-selected-color($overlap-color) {
|
|
23
|
+
@return color.adjust($overlap-color, $lightness: -30%);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Default range comparison color.
|
|
27
|
+
$private-default-comparison-color: private-get-range-background-color(#f9ab00);
|
|
28
|
+
|
|
29
|
+
// Default range overlap color.
|
|
30
|
+
$private-default-overlap-color: #a8dab5;
|
|
31
|
+
|
|
32
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
33
|
+
// but may be in a future version of the theming API.
|
|
34
|
+
@function get-unthemable-tokens() {
|
|
35
|
+
@return ();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
39
|
+
@function get-color-tokens($config) {
|
|
40
|
+
$foreground: map.get($config, foreground);
|
|
41
|
+
$background: map.get($config, background);
|
|
42
|
+
$primary: map.get($config, primary);
|
|
43
|
+
$inactive-icon-color: theming.get-color-from-palette($foreground, icon);
|
|
44
|
+
$text-color: theming.get-color-from-palette($foreground, text);
|
|
45
|
+
$secondary-text-color: theming.get-color-from-palette($foreground, secondary-text);
|
|
46
|
+
$disabled-text-color: theming.get-color-from-palette($foreground, disabled-text);
|
|
47
|
+
$divider-color: theming.get-color-from-palette($foreground, divider);
|
|
48
|
+
$hint-text-color: theming.get-color-from-palette($foreground, hint-text);
|
|
49
|
+
$preview-outline-color: $divider-color;
|
|
50
|
+
$today-disabled-outline-color: null;
|
|
51
|
+
|
|
52
|
+
$primary-color: theming.get-color-from-palette(map.get($config, primary));
|
|
53
|
+
$range-tokens: get-range-color-tokens(private-get-range-background-color($primary-color));
|
|
54
|
+
$calendar-tokens: private-get-calendar-color-palette-color-tokens($config, primary);
|
|
55
|
+
$toggle-tokens: private-get-toggle-color-palette-color-tokens($config, primary);
|
|
56
|
+
|
|
57
|
+
// The divider color is set under the assumption that it'll be used
|
|
58
|
+
// for a solid border, but because we're using a dashed border for the
|
|
59
|
+
// preview range, we need to bump its opacity to ensure that it's visible.
|
|
60
|
+
@if meta.type-of($preview-outline-color) == color {
|
|
61
|
+
$preview-outline-opacity: math.min(opacity($preview-outline-color) * 2, 1);
|
|
62
|
+
$preview-outline-color: rgba($preview-outline-color, $preview-outline-opacity);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@if (meta.type-of($hint-text-color) == color) {
|
|
66
|
+
$today-disabled-outline-color: color.adjust($hint-text-color, $alpha: -$_today-fade-amount);
|
|
67
|
+
}
|
|
68
|
+
@else {
|
|
69
|
+
$today-disabled-outline-color: $disabled-text-color;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@return sass-utils.merge-all($calendar-tokens, $toggle-tokens, $range-tokens, (
|
|
73
|
+
toggle-icon-color: $inactive-icon-color,
|
|
74
|
+
calendar-body-label-text-color: $secondary-text-color,
|
|
75
|
+
calendar-period-button-icon-color: $inactive-icon-color,
|
|
76
|
+
calendar-navigation-button-icon-color: $inactive-icon-color,
|
|
77
|
+
calendar-header-divider-color: $divider-color,
|
|
78
|
+
calendar-header-text-color: $secondary-text-color,
|
|
79
|
+
|
|
80
|
+
// Note: though it's not text, the border is a hint about the fact
|
|
81
|
+
// that this is today's date, so we use the hint color.
|
|
82
|
+
calendar-date-today-outline-color: $hint-text-color,
|
|
83
|
+
calendar-date-today-disabled-state-outline-color: $today-disabled-outline-color,
|
|
84
|
+
calendar-date-text-color: $text-color,
|
|
85
|
+
calendar-date-outline-color: transparent,
|
|
86
|
+
calendar-date-disabled-state-text-color: $disabled-text-color,
|
|
87
|
+
calendar-date-preview-state-outline-color: $preview-outline-color,
|
|
88
|
+
|
|
89
|
+
range-input-separator-color: $text-color,
|
|
90
|
+
range-input-disabled-state-separator-color: $disabled-text-color,
|
|
91
|
+
range-input-disabled-state-text-color: $disabled-text-color,
|
|
92
|
+
|
|
93
|
+
calendar-container-background-color: theming.get-color-from-palette($background, card),
|
|
94
|
+
calendar-container-text-color: $text-color,
|
|
95
|
+
));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
99
|
+
@function get-typography-tokens($config) {
|
|
100
|
+
$fallback-font: typography-utils.font-family($config);
|
|
101
|
+
|
|
102
|
+
@return (
|
|
103
|
+
// TODO(crisbeto): the typography tokens for other components set every typography dimension of
|
|
104
|
+
// an element (e.g. size, weight, line height, letter spacing). These tokens only set the values
|
|
105
|
+
// that were set in the previous theming API to reduce the amount of subtle screenshot
|
|
106
|
+
// differences. We should look into introducing the other tokens in a follow-up.
|
|
107
|
+
calendar-text-font: $fallback-font,
|
|
108
|
+
calendar-text-size: 13px, // TODO(crisbeto): this doesn't appear to affect anything
|
|
109
|
+
|
|
110
|
+
calendar-body-label-text-size: typography-utils.font-size($config, button),
|
|
111
|
+
calendar-body-label-text-weight: typography-utils.font-weight($config, button),
|
|
112
|
+
|
|
113
|
+
calendar-period-button-text-size: typography-utils.font-size($config, button),
|
|
114
|
+
calendar-period-button-text-weight: typography-utils.font-weight($config, button),
|
|
115
|
+
|
|
116
|
+
calendar-header-text-size: 11px,
|
|
117
|
+
calendar-header-text-weight: typography-utils.font-weight($config, body-1),
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Gets the tokens map that can be used to override the range colors.
|
|
122
|
+
@function get-range-color-tokens(
|
|
123
|
+
$range-color,
|
|
124
|
+
$comparison-color: $private-default-comparison-color,
|
|
125
|
+
$overlap-color: $private-default-overlap-color,
|
|
126
|
+
$overlap-selected-color: private-get-default-overlap-selected-color($overlap-color)) {
|
|
127
|
+
|
|
128
|
+
@return (
|
|
129
|
+
calendar-date-in-range-state-background-color: $range-color,
|
|
130
|
+
calendar-date-in-comparison-range-state-background-color: $comparison-color,
|
|
131
|
+
calendar-date-in-overlap-range-state-background-color: $overlap-color,
|
|
132
|
+
calendar-date-in-overlap-range-selected-state-background-color: $overlap-selected-color,
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@function private-get-calendar-color-palette-color-tokens($config, $palette-name) {
|
|
137
|
+
$foreground: map.get($config, foreground);
|
|
138
|
+
$palette: map.get($config, $palette-name);
|
|
139
|
+
$palette-color: theming.get-color-from-palette($palette);
|
|
140
|
+
$default-contrast: theming.get-color-from-palette($palette, default-contrast);
|
|
141
|
+
$active-background-color: theming.get-color-from-palette($palette, 0.3);
|
|
142
|
+
$active-disabled-color: null;
|
|
143
|
+
|
|
144
|
+
@if (meta.type-of($palette-color) == color) {
|
|
145
|
+
$active-disabled-color: color.adjust($palette-color, $alpha: -$_selected-fade-amount);
|
|
146
|
+
}
|
|
147
|
+
@else {
|
|
148
|
+
$active-disabled-color: theming.get-color-from-palette($foreground, disabled-button);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@return (
|
|
152
|
+
calendar-date-selected-state-text-color: $default-contrast,
|
|
153
|
+
calendar-date-selected-state-background-color: $palette-color,
|
|
154
|
+
calendar-date-selected-disabled-state-background-color: $active-disabled-color,
|
|
155
|
+
calendar-date-today-selected-state-outline-color: $default-contrast,
|
|
156
|
+
calendar-date-focus-state-background-color: $active-background-color,
|
|
157
|
+
calendar-date-hover-state-background-color: $active-background-color,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@function private-get-toggle-color-palette-color-tokens($config, $palette-name) {
|
|
162
|
+
$palette: map.get($config, $palette-name);
|
|
163
|
+
|
|
164
|
+
@return (
|
|
165
|
+
toggle-active-state-icon-color: theming.get-color-from-palette($palette, text),
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
171
|
+
@function get-density-tokens($config) {
|
|
172
|
+
@return ();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
176
|
+
// This is used to create token slots.
|
|
177
|
+
@function get-token-slots() {
|
|
178
|
+
@return sass-utils.deep-merge-all(
|
|
179
|
+
get-unthemable-tokens(),
|
|
180
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
181
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
182
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
@use '../../../theming/theming';
|
|
4
|
+
@use '../../../style/sass-utils';
|
|
5
|
+
|
|
6
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
7
|
+
$prefix: (mat, divider);
|
|
8
|
+
|
|
9
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
10
|
+
// but may be in a future version of the theming API.
|
|
11
|
+
@function get-unthemable-tokens() {
|
|
12
|
+
@return (
|
|
13
|
+
width: 1px
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
+
@function get-color-tokens($config) {
|
|
19
|
+
$foreground: map.get($config, foreground);
|
|
20
|
+
|
|
21
|
+
@return (
|
|
22
|
+
color: theming.get-color-from-palette($foreground, divider)
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
27
|
+
@function get-typography-tokens($config) {
|
|
28
|
+
@return ();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
32
|
+
@function get-density-tokens($config) {
|
|
33
|
+
@return ();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
37
|
+
// This is used to create token slots.
|
|
38
|
+
@function get-token-slots() {
|
|
39
|
+
@return sass-utils.deep-merge-all(
|
|
40
|
+
get-unthemable-tokens(),
|
|
41
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
42
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
43
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
@use '../../../style/sass-utils';
|
|
4
|
+
|
|
5
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
6
|
+
$prefix: (mat, form-field);
|
|
7
|
+
|
|
8
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
9
|
+
// but may be in a future version of the theming API.
|
|
10
|
+
@function get-unthemable-tokens() {
|
|
11
|
+
@return ();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
15
|
+
@function get-color-tokens($config) {
|
|
16
|
+
$is-dark: map.get($config, is-dark);
|
|
17
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
18
|
+
|
|
19
|
+
@return (
|
|
20
|
+
// MDC has a token for the enabled placeholder, but not for the disabled one.
|
|
21
|
+
disabled-input-text-placeholder-color: rgba($on-surface, 0.38),
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
26
|
+
@function get-typography-tokens($config) {
|
|
27
|
+
@return ();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
31
|
+
@function get-density-tokens($config) {
|
|
32
|
+
@return ();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
36
|
+
// This is used to create token slots.
|
|
37
|
+
@function get-token-slots() {
|
|
38
|
+
@return sass-utils.deep-merge-all(
|
|
39
|
+
get-unthemable-tokens(),
|
|
40
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
41
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
42
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use '../../token-utils';
|
|
2
|
+
@use '../../../typography/typography-utils';
|
|
3
|
+
@use '../../../style/sass-utils';
|
|
4
|
+
|
|
5
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
6
|
+
$prefix: (mat, grid-list);
|
|
7
|
+
|
|
8
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
9
|
+
// but may be in a future version of the theming API.
|
|
10
|
+
@function get-unthemable-tokens() {
|
|
11
|
+
@return ();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
15
|
+
@function get-color-tokens($config) {
|
|
16
|
+
@return ();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
20
|
+
@function get-typography-tokens($config) {
|
|
21
|
+
@return (
|
|
22
|
+
// TODO(crisbeto): other components have tokens for all typography dimensions.
|
|
23
|
+
// Here we only set the font size to maintain the same appearance as the pre-tokens
|
|
24
|
+
// theming API. Consider adding more tokens for letter spacing, font weight etc.
|
|
25
|
+
tile-header-primary-text-size: typography-utils.font-size($config, body-1),
|
|
26
|
+
tile-header-secondary-text-size: typography-utils.font-size($config, caption),
|
|
27
|
+
tile-footer-primary-text-size: typography-utils.font-size($config, body-1),
|
|
28
|
+
tile-footer-secondary-text-size: typography-utils.font-size($config, caption),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
33
|
+
@function get-density-tokens($config) {
|
|
34
|
+
@return ();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
38
|
+
// This is used to create token slots.
|
|
39
|
+
@function get-token-slots() {
|
|
40
|
+
@return sass-utils.deep-merge-all(
|
|
41
|
+
get-unthemable-tokens(),
|
|
42
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
43
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
44
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use '../../token-utils';
|
|
2
|
+
@use '../../../style/sass-utils';
|
|
3
|
+
|
|
4
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
5
|
+
$prefix: (mat, icon);
|
|
6
|
+
|
|
7
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
8
|
+
// but may be in a future version of the theming API.
|
|
9
|
+
@function get-unthemable-tokens() {
|
|
10
|
+
@return ();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
14
|
+
@function get-color-tokens($config) {
|
|
15
|
+
// Default the icon to `inherit` so it matches the text around it.
|
|
16
|
+
@return private-get-icon-color-tokens(inherit);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
20
|
+
@function get-typography-tokens($config) {
|
|
21
|
+
@return ();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
25
|
+
@function get-density-tokens($config) {
|
|
26
|
+
@return ();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Mixin used to set a specific color on an icon.
|
|
30
|
+
@function private-get-icon-color-tokens($color) {
|
|
31
|
+
@return (
|
|
32
|
+
color: $color,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
37
|
+
// This is used to create token slots.
|
|
38
|
+
@function get-token-slots() {
|
|
39
|
+
@return sass-utils.deep-merge-all(
|
|
40
|
+
get-unthemable-tokens(),
|
|
41
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
42
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
43
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
@use '../../../typography/typography-utils';
|
|
4
|
+
@use '../../../theming/theming';
|
|
5
|
+
@use '../../../style/sass-utils';
|
|
6
|
+
|
|
7
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
8
|
+
$prefix: (mat, legacy-button-toggle);
|
|
9
|
+
|
|
10
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
11
|
+
// but may be in a future version of the theming API.
|
|
12
|
+
@function get-unthemable-tokens() {
|
|
13
|
+
@return (
|
|
14
|
+
height: 36px,
|
|
15
|
+
shape: 2px,
|
|
16
|
+
focus-state-layer-opacity: 1,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
21
|
+
@function get-color-tokens($config) {
|
|
22
|
+
$foreground: map.get($config, foreground);
|
|
23
|
+
$background: map.get($config, background);
|
|
24
|
+
|
|
25
|
+
@return (
|
|
26
|
+
text-color: theming.get-color-from-palette($foreground, hint-text),
|
|
27
|
+
state-layer-color: theming.get-color-from-palette($background, focused-button),
|
|
28
|
+
selected-state-text-color: theming.get-color-from-palette($foreground, secondary-text),
|
|
29
|
+
selected-state-background-color: theming.get-color-from-palette($background, selected-button),
|
|
30
|
+
disabled-state-text-color: theming.get-color-from-palette($foreground, disabled-button),
|
|
31
|
+
disabled-state-background-color:
|
|
32
|
+
theming.get-color-from-palette($background, disabled-button-toggle),
|
|
33
|
+
disabled-selected-state-background-color:
|
|
34
|
+
theming.get-color-from-palette($background, selected-disabled-button)
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
39
|
+
@function get-typography-tokens($config) {
|
|
40
|
+
@return (
|
|
41
|
+
// TODO(crisbeto): other components have tokens for all typography dimensions (font weight,
|
|
42
|
+
// letter spacing etc). The button toggle only has the font to match what it had in the
|
|
43
|
+
// old theming API and to reduce internal breakages. We should introduce more typography
|
|
44
|
+
// tokens at some point.
|
|
45
|
+
text-font: typography-utils.font-family($config),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
50
|
+
@function get-density-tokens($config) {
|
|
51
|
+
@return ();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
55
|
+
// This is used to create token slots.
|
|
56
|
+
@function get-token-slots() {
|
|
57
|
+
@return sass-utils.deep-merge-all(
|
|
58
|
+
get-unthemable-tokens(),
|
|
59
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
60
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
61
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
@use '../../token-utils';
|
|
5
|
+
@use '../../../theming/theming';
|
|
6
|
+
@use '../../../style/sass-utils';
|
|
7
|
+
|
|
8
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
|
+
$prefix: (mat, sidenav);
|
|
10
|
+
|
|
11
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
|
+
// but may be in a future version of the theming API.
|
|
13
|
+
@function get-unthemable-tokens() {
|
|
14
|
+
@return (
|
|
15
|
+
// Currently zero, but it appears to be relevant for M3.
|
|
16
|
+
// See: https://m3.material.io/components/navigation-drawer/overview
|
|
17
|
+
container-shape: 0,
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
22
|
+
@function get-color-tokens($config) {
|
|
23
|
+
$is-dark: map.get($config, is-dark);
|
|
24
|
+
$foreground: map.get($config, foreground);
|
|
25
|
+
$background: map.get($config, background);
|
|
26
|
+
$scrim-opacity: 0.6;
|
|
27
|
+
$scrim-color: theming.get-color-from-palette($background, card, $scrim-opacity);
|
|
28
|
+
$fallback-scrim-color: if($is-dark, rgba(#fff, $scrim-opacity), rgba(#000, $scrim-opacity));
|
|
29
|
+
|
|
30
|
+
@return (
|
|
31
|
+
container-divider-color: theming.get-color-from-palette($foreground, divider),
|
|
32
|
+
container-background-color: theming.get-color-from-palette($background, dialog),
|
|
33
|
+
container-text-color: theming.get-color-from-palette($foreground, text),
|
|
34
|
+
content-background-color: theming.get-color-from-palette($background, background),
|
|
35
|
+
content-text-color: theming.get-color-from-palette($foreground, text),
|
|
36
|
+
|
|
37
|
+
// We use invert() here to have the darken the background color expected to be used.
|
|
38
|
+
// If the background is light, we use a dark backdrop. If the background is dark, we
|
|
39
|
+
// use a light backdrop. If the value isn't a color, Sass will throw an error so we
|
|
40
|
+
// fall back to something generic.
|
|
41
|
+
scrim-color: if(meta.type-of($scrim-color) == color,
|
|
42
|
+
color.invert($scrim-color), $fallback-scrim-color),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
47
|
+
@function get-typography-tokens($config) {
|
|
48
|
+
@return ();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
52
|
+
@function get-density-tokens($config) {
|
|
53
|
+
@return ();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
57
|
+
// This is used to create token slots.
|
|
58
|
+
@function get-token-slots() {
|
|
59
|
+
@return sass-utils.deep-merge-all(
|
|
60
|
+
get-unthemable-tokens(),
|
|
61
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
62
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
63
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -29,7 +29,7 @@ $prefix: (mat, slide-toggle);
|
|
|
29
29
|
@return (
|
|
30
30
|
label-text-font: typography-utils.font-family($config),
|
|
31
31
|
label-text-size: typography-utils.font-size($config, body-2),
|
|
32
|
-
label-text-
|
|
32
|
+
label-text-tracking: typography-utils.letter-spacing($config, body-2),
|
|
33
33
|
label-text-line-height: typography-utils.line-height($config, body-2),
|
|
34
34
|
label-text-weight: typography-utils.font-weight($config, body-2),
|
|
35
35
|
);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use '../../token-utils';
|
|
4
|
+
@use '../../../typography/typography-utils';
|
|
5
|
+
@use '../../../theming/theming';
|
|
6
|
+
@use '../../../style/sass-utils';
|
|
7
|
+
|
|
8
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
|
+
$prefix: (mat, standard-button-toggle);
|
|
10
|
+
|
|
11
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
|
+
// but may be in a future version of the theming API.
|
|
13
|
+
@function get-unthemable-tokens() {
|
|
14
|
+
@return (
|
|
15
|
+
shape: 4px,
|
|
16
|
+
hover-state-layer-opacity: 0.04,
|
|
17
|
+
focus-state-layer-opacity: 0.12,
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
22
|
+
@function get-color-tokens($config) {
|
|
23
|
+
$foreground: map.get($config, foreground);
|
|
24
|
+
$background: map.get($config, background);
|
|
25
|
+
$theme-divider-color: theming.get-color-from-palette($foreground, divider);
|
|
26
|
+
|
|
27
|
+
// By default the theme usually has an rgba color for the dividers, which can
|
|
28
|
+
// stack up with the background of a button toggle. This can cause the border
|
|
29
|
+
// of a selected toggle to look different from an deselected one. We use a solid
|
|
30
|
+
// color to ensure that the border always stays the same.
|
|
31
|
+
$divider-color: if(meta.type-of($theme-divider-color) == color,
|
|
32
|
+
theming.private-rgba-to-hex($theme-divider-color, map.get($background, card)),
|
|
33
|
+
$theme-divider-color
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
@return (
|
|
37
|
+
text-color: theming.get-color-from-palette($foreground, text),
|
|
38
|
+
background-color: theming.get-color-from-palette($background, card),
|
|
39
|
+
state-layer-color: theming.get-color-from-palette($background, focused-button, 1),
|
|
40
|
+
selected-state-background-color: theming.get-color-from-palette($background, selected-button),
|
|
41
|
+
selected-state-text-color: theming.get-color-from-palette($foreground, text),
|
|
42
|
+
disabled-state-text-color: theming.get-color-from-palette($foreground, disabled-button),
|
|
43
|
+
disabled-state-background-color: theming.get-color-from-palette($background, card),
|
|
44
|
+
disabled-selected-state-text-color: theming.get-color-from-palette($foreground, text),
|
|
45
|
+
disabled-selected-state-background-color:
|
|
46
|
+
theming.get-color-from-palette($background, selected-disabled-button),
|
|
47
|
+
divider-color: $divider-color,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
52
|
+
@function get-typography-tokens($config) {
|
|
53
|
+
@return (
|
|
54
|
+
// TODO(crisbeto): other components have tokens for all typography dimensions (font weight,
|
|
55
|
+
// letter spacing etc). The button toggle only has the font to match what it had in the
|
|
56
|
+
// old theming API and to reduce internal breakages. We should introduce more typography
|
|
57
|
+
// tokens at some point.
|
|
58
|
+
text-font: typography-utils.font-family($config),
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
63
|
+
@function get-density-tokens($config) {
|
|
64
|
+
$density-scale: theming.clamp-density($config, -4);
|
|
65
|
+
$size-scale: (
|
|
66
|
+
0: 48px,
|
|
67
|
+
-1: 44px,
|
|
68
|
+
-2: 40px,
|
|
69
|
+
-3: 36px,
|
|
70
|
+
-4: 24px,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
@return (
|
|
74
|
+
height: map.get($size-scale, $density-scale)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
79
|
+
// This is used to create token slots.
|
|
80
|
+
@function get-token-slots() {
|
|
81
|
+
@return sass-utils.deep-merge-all(
|
|
82
|
+
get-unthemable-tokens(),
|
|
83
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
84
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
85
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -49,7 +49,7 @@ $prefix: (mat, tab-header);
|
|
|
49
49
|
label-text-font:
|
|
50
50
|
typography-utils.font-family($config, button) or typography-utils.font-family($config),
|
|
51
51
|
label-text-size: typography-utils.font-size($config, button),
|
|
52
|
-
label-text-
|
|
52
|
+
label-text-tracking: typography-utils.letter-spacing($config, button),
|
|
53
53
|
label-text-line-height: typography-utils.line-height($config, button),
|
|
54
54
|
label-text-weight: typography-utils.font-weight($config, button),
|
|
55
55
|
);
|