@angular/material 16.0.0-rc.0 → 16.0.0-rc.1
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/button/_icon-button-theme.scss +4 -6
- package/core/tokens/m2/mat/_snack-bar.scss +43 -0
- package/core/tokens/m2/mat/_tab-header-with-background.scss +43 -0
- package/core/tokens/m2/mat/_tab-header.scss +71 -0
- package/core/tokens/m2/mdc/_snack-bar.scss +108 -0
- package/core/tokens/m2/mdc/_tab-indicator.scss +51 -0
- package/core/tokens/m2/mdc/_tab.scss +86 -0
- package/esm2022/core/option/option.mjs +5 -3
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/form-field/form-field.mjs +3 -3
- package/esm2022/legacy-progress-spinner/progress-spinner.mjs +14 -5
- package/esm2022/snack-bar/snack-bar-container.mjs +3 -3
- package/esm2022/tabs/tab-group.mjs +2 -2
- package/esm2022/tabs/tab-header.mjs +2 -2
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +4 -4
- package/fesm2022/core.mjs +5 -3
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/legacy-progress-spinner.mjs +13 -4
- package/fesm2022/legacy-progress-spinner.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +2 -2
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/tabs.mjs +8 -8
- package/fesm2022/tabs.mjs.map +1 -1
- package/form-field/_user-agent-overrides.scss +24 -0
- 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/legacy-progress-spinner/index.d.ts +3 -2
- package/package.json +2 -2
- 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/schematics/migration.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/snack-bar/_snack-bar-theme.scss +13 -44
- package/tabs/_tabs-common.scss +195 -32
- package/tabs/_tabs-theme.scss +50 -71
|
@@ -1,60 +1,29 @@
|
|
|
1
|
+
@use '@material/snackbar/snackbar-theme' as mdc-snackbar-theme;
|
|
1
2
|
@use '../core/theming/theming';
|
|
2
|
-
@use '../core/mdc-helpers/mdc-helpers';
|
|
3
3
|
@use '../core/typography/typography';
|
|
4
|
-
@use '../core/
|
|
5
|
-
@use '
|
|
6
|
-
@use '
|
|
7
|
-
@use 'sass:color';
|
|
8
|
-
@use 'sass:map';
|
|
9
|
-
@use 'sass:meta';
|
|
4
|
+
@use '../core/tokens/token-utils';
|
|
5
|
+
@use '../core/tokens/m2/mdc/snack-bar' as tokens-mdc-snack-bar;
|
|
6
|
+
@use '../core/tokens/m2/mat/snack-bar' as tokens-mat-snack-bar;
|
|
10
7
|
|
|
11
8
|
|
|
12
9
|
@mixin color($config-or-theme) {
|
|
13
10
|
$config: theming.get-color-config($config-or-theme);
|
|
14
|
-
$is-dark-theme: map.get($config, is-dark);
|
|
15
|
-
$accent: map.get($config, accent);
|
|
16
|
-
|
|
17
|
-
@include mdc-helpers.using-mdc-theme($config) {
|
|
18
|
-
.mat-mdc-snack-bar-container {
|
|
19
|
-
$button-color: if(
|
|
20
|
-
$is-dark-theme,
|
|
21
|
-
mdc-theme-color.prop-value(text-primary-on-light),
|
|
22
|
-
theming.get-color-from-palette($accent, text)
|
|
23
|
-
);
|
|
24
|
-
--mat-mdc-snack-bar-button-color: #{$button-color};
|
|
25
|
-
$on-surface: mdc-theme-color.prop-value(on-surface);
|
|
26
|
-
$surface: mdc-theme-color.prop-value(surface);
|
|
27
11
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
supporting-text-color: if(
|
|
35
|
-
meta.type-of($surface) == color,
|
|
36
|
-
rgba($surface, mdc-theme-color.text-emphasis(high)),
|
|
37
|
-
$surface
|
|
38
|
-
)
|
|
39
|
-
));
|
|
40
|
-
}
|
|
12
|
+
.mat-mdc-snack-bar-container {
|
|
13
|
+
@include mdc-snackbar-theme.theme(tokens-mdc-snack-bar.get-color-tokens($config));
|
|
14
|
+
@include token-utils.create-token-values(
|
|
15
|
+
tokens-mat-snack-bar.$prefix,
|
|
16
|
+
tokens-mat-snack-bar.get-color-tokens($config)
|
|
17
|
+
);
|
|
41
18
|
}
|
|
42
19
|
}
|
|
43
20
|
|
|
44
21
|
@mixin typography($config-or-theme) {
|
|
45
22
|
$config: typography.private-typography-to-2018-config(
|
|
46
23
|
theming.get-typography-config($config-or-theme));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@include mdc-snackbar-theme.theme((
|
|
51
|
-
supporting-text-font: typography-utils.font-family($config, body-2),
|
|
52
|
-
supporting-text-line-height: typography-utils.line-height($config, body-2),
|
|
53
|
-
supporting-text-size: typography-utils.font-size($config, body-2),
|
|
54
|
-
supporting-text-weight: typography-utils.font-weight($config, body-2),
|
|
55
|
-
));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
24
|
+
|
|
25
|
+
.mat-mdc-snack-bar-container {
|
|
26
|
+
@include mdc-snackbar-theme.theme(tokens-mdc-snack-bar.get-typography-tokens($config));
|
|
58
27
|
}
|
|
59
28
|
}
|
|
60
29
|
|
package/tabs/_tabs-common.scss
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
@use '../core/mdc-helpers/mdc-helpers';
|
|
2
|
-
@use '../core/style/vendor-prefixes';
|
|
3
1
|
@use '@material/ripple' as mdc-ripple;
|
|
4
2
|
@use '@material/tab' as mdc-tab;
|
|
5
3
|
@use '@material/tab-indicator' as mdc-tab-indicator;
|
|
4
|
+
@use '@material/tab-indicator/tab-indicator-theme' as mdc-tab-indicator-theme;
|
|
5
|
+
@use '@material/tab/tab-theme' as mdc-tab-theme;
|
|
6
|
+
@use '@material/theme/custom-properties' as mdc-custom-properties;
|
|
7
|
+
@use '../core/mdc-helpers/mdc-helpers';
|
|
8
|
+
@use '../core/style/vendor-prefixes';
|
|
9
|
+
@use '../core/tokens/m2/mdc/tab-indicator' as tokens-mdc-tab-indicator;
|
|
10
|
+
@use '../core/tokens/m2/mdc/tab' as tokens-mdc-tab;
|
|
11
|
+
@use '../core/tokens/m2/mat/tab-header' as tokens-mat-tab-header;
|
|
12
|
+
@use '../core/tokens/m2/mat/tab-header-with-background' as tokens-mat-tab-header-with-background;
|
|
13
|
+
@use '../core/tokens/token-utils';
|
|
6
14
|
@use 'sass:map';
|
|
7
15
|
|
|
8
16
|
|
|
@@ -10,9 +18,12 @@ $mat-tab-animation-duration: 500ms !default;
|
|
|
10
18
|
|
|
11
19
|
// Combines the various structural styles we need for the tab group and tab nav bar.
|
|
12
20
|
@mixin structural-styles {
|
|
13
|
-
@include mdc-
|
|
21
|
+
@include mdc-custom-properties.configure(
|
|
22
|
+
$emit-fallback-values: false,
|
|
23
|
+
$emit-fallback-vars: false
|
|
24
|
+
) {
|
|
14
25
|
@include mdc-tab.static-styles($query: mdc-helpers.$mdc-base-styles-query);
|
|
15
|
-
@include mdc-tab-indicator.
|
|
26
|
+
@include mdc-tab-indicator.static-styles($query: mdc-helpers.$mdc-base-styles-query);
|
|
16
27
|
}
|
|
17
28
|
|
|
18
29
|
.mat-mdc-tab-ripple {
|
|
@@ -26,19 +37,102 @@ $mat-tab-animation-duration: 500ms !default;
|
|
|
26
37
|
}
|
|
27
38
|
|
|
28
39
|
@mixin tab {
|
|
40
|
+
@include mdc-custom-properties.configure(
|
|
41
|
+
$emit-fallback-values: false,
|
|
42
|
+
$emit-fallback-vars: false
|
|
43
|
+
) {
|
|
44
|
+
@include mdc-tab-indicator-theme.theme-styles(tokens-mdc-tab-indicator.get-token-slots());
|
|
45
|
+
@include mdc-tab-theme.secondary-navigation-tab-theme-styles(tokens-mdc-tab.get-token-slots());
|
|
46
|
+
}
|
|
47
|
+
|
|
29
48
|
-webkit-tap-highlight-color: transparent;
|
|
49
|
+
-webkit-font-smoothing: antialiased;
|
|
50
|
+
-moz-osx-font-smoothing: grayscale;
|
|
51
|
+
text-decoration: none;
|
|
30
52
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// use it because we implement our own pagination.
|
|
34
|
-
@include mdc-tab.height(mdc-tab.$height, mdc-helpers.$mdc-base-styles-query);
|
|
53
|
+
// Tabs might be `button` elements so we have to reset the user agent styling.
|
|
54
|
+
background: none;
|
|
35
55
|
|
|
56
|
+
&.mdc-tab {
|
|
36
57
|
// MDC's tabs stretch to fit the header by default, whereas stretching on our current ones
|
|
37
58
|
// is an opt-in behavior. Also technically we don't need to combine the two classes, but
|
|
38
59
|
// we need the extra specificity to avoid issues with CSS insertion order.
|
|
39
60
|
flex-grow: 0;
|
|
40
61
|
}
|
|
41
62
|
|
|
63
|
+
@include token-utils.use-tokens(
|
|
64
|
+
tokens-mat-tab-header.$prefix,
|
|
65
|
+
tokens-mat-tab-header.get-token-slots()
|
|
66
|
+
) {
|
|
67
|
+
@include token-utils.create-token-slot(font-family, label-text-font);
|
|
68
|
+
@include token-utils.create-token-slot(font-size, label-text-size);
|
|
69
|
+
@include token-utils.create-token-slot(letter-spacing, label-text-letter-spacing);
|
|
70
|
+
@include token-utils.create-token-slot(line-height, label-text-line-height);
|
|
71
|
+
@include token-utils.create-token-slot(font-weight, label-text-weight);
|
|
72
|
+
|
|
73
|
+
&:hover .mdc-tab__text-label {
|
|
74
|
+
@include token-utils.create-token-slot(color, inactive-hover-label-text-color);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:focus .mdc-tab__text-label {
|
|
78
|
+
@include token-utils.create-token-slot(color, inactive-focus-label-text-color);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.mdc-tab--active {
|
|
82
|
+
.mdc-tab__text-label {
|
|
83
|
+
@include token-utils.create-token-slot(color, active-label-text-color);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.mdc-tab__ripple::before,
|
|
87
|
+
.mat-ripple-element {
|
|
88
|
+
@include token-utils.create-token-slot(background-color, active-ripple-color);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&:hover {
|
|
92
|
+
.mdc-tab__text-label {
|
|
93
|
+
@include token-utils.create-token-slot(color, active-hover-label-text-color);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.mdc-tab-indicator__content--underline {
|
|
97
|
+
@include token-utils.create-token-slot(border-color, active-hover-indicator-color);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:focus {
|
|
102
|
+
.mdc-tab__text-label {
|
|
103
|
+
@include token-utils.create-token-slot(color, active-focus-label-text-color);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.mdc-tab-indicator__content--underline {
|
|
107
|
+
@include token-utils.create-token-slot(border-color, active-focus-indicator-color);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.mat-mdc-tab-disabled {
|
|
114
|
+
// MDC doesn't support disabled tabs so we need to improvise.
|
|
115
|
+
opacity: 0.4;
|
|
116
|
+
|
|
117
|
+
// We use `pointer-events` to make the element unclickable when it's disabled, rather than
|
|
118
|
+
// preventing the default action through JS, because we can't prevent the action reliably
|
|
119
|
+
// due to other directives potentially registering their events earlier. This shouldn't cause
|
|
120
|
+
// the user to click through, because we always have a header behind the tab. Furthermore, this
|
|
121
|
+
// saves us some CSS, because we don't have to add `:not(.mat-mdc-tab-disabled)` to all the
|
|
122
|
+
// hover and focus selectors.
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
|
|
125
|
+
@include token-utils.use-tokens(
|
|
126
|
+
tokens-mat-tab-header.$prefix,
|
|
127
|
+
tokens-mat-tab-header.get-token-slots()
|
|
128
|
+
) {
|
|
129
|
+
.mdc-tab__ripple::before,
|
|
130
|
+
.mat-ripple-element {
|
|
131
|
+
@include token-utils.create-token-slot(background-color, disabled-ripple-color);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
42
136
|
// Used to render out the background tint when hovered/focused. Usually this is done by
|
|
43
137
|
// MDC's ripple styles, however we're using our own ripples due to size concerns.
|
|
44
138
|
.mdc-tab__ripple::before {
|
|
@@ -51,10 +145,24 @@ $mat-tab-animation-duration: 500ms !default;
|
|
|
51
145
|
bottom: 0;
|
|
52
146
|
opacity: 0;
|
|
53
147
|
pointer-events: none;
|
|
148
|
+
|
|
149
|
+
@include token-utils.use-tokens(
|
|
150
|
+
tokens-mat-tab-header.$prefix,
|
|
151
|
+
tokens-mat-tab-header.get-token-slots()
|
|
152
|
+
) {
|
|
153
|
+
@include token-utils.create-token-slot(background-color, inactive-ripple-color);
|
|
154
|
+
}
|
|
54
155
|
}
|
|
55
156
|
|
|
56
|
-
// We support projecting icons into the tab. These styles ensure that they're centered.
|
|
57
157
|
.mdc-tab__text-label {
|
|
158
|
+
@include token-utils.use-tokens(
|
|
159
|
+
tokens-mat-tab-header.$prefix,
|
|
160
|
+
tokens-mat-tab-header.get-token-slots()
|
|
161
|
+
) {
|
|
162
|
+
@include token-utils.create-token-slot(color, inactive-label-text-color);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// We support projecting icons into the tab. These styles ensure that they're centered.
|
|
58
166
|
display: inline-flex;
|
|
59
167
|
align-items: center;
|
|
60
168
|
}
|
|
@@ -63,7 +171,7 @@ $mat-tab-animation-duration: 500ms !default;
|
|
|
63
171
|
// Required for `fitInkBarToContent` to work. This used to be included with MDC's
|
|
64
172
|
// `without-ripple` mixin, but that no longer appears to be the case with `static-styles`.
|
|
65
173
|
// Since the latter is ~10kb smaller, we include this one extra style ourselves.
|
|
66
|
-
|
|
174
|
+
position: relative;
|
|
67
175
|
|
|
68
176
|
// MDC sets `pointer-events: none` on the content which prevents interactions with the
|
|
69
177
|
// nested content. Re-enable it since we allow nesting any content in the tab (see #26195).
|
|
@@ -84,6 +192,13 @@ $mat-tab-animation-duration: 500ms !default;
|
|
|
84
192
|
|
|
85
193
|
.mat-ripple-element {
|
|
86
194
|
opacity: map.get(mdc-ripple.$dark-ink-opacities, press);
|
|
195
|
+
|
|
196
|
+
@include token-utils.use-tokens(
|
|
197
|
+
tokens-mat-tab-header.$prefix,
|
|
198
|
+
tokens-mat-tab-header.get-token-slots()
|
|
199
|
+
) {
|
|
200
|
+
@include token-utils.create-token-slot(background-color, inactive-ripple-color);
|
|
201
|
+
}
|
|
87
202
|
}
|
|
88
203
|
}
|
|
89
204
|
|
|
@@ -95,6 +210,11 @@ $mat-tab-animation-duration: 500ms !default;
|
|
|
95
210
|
overflow: hidden;
|
|
96
211
|
position: relative;
|
|
97
212
|
flex-shrink: 0;
|
|
213
|
+
|
|
214
|
+
@include mdc-tab-indicator-theme.theme(tokens-mdc-tab-indicator.get-unthemable-tokens());
|
|
215
|
+
@include mdc-tab-theme.secondary-navigation-tab-theme(tokens-mdc-tab.get-unthemable-tokens());
|
|
216
|
+
@include token-utils.create-token-values(
|
|
217
|
+
tokens-mat-tab-header.$prefix, tokens-mat-tab-header.get-unthemable-tokens());
|
|
98
218
|
}
|
|
99
219
|
|
|
100
220
|
.mat-mdc-tab-header-pagination {
|
|
@@ -120,6 +240,13 @@ $mat-tab-animation-duration: 500ms !default;
|
|
|
120
240
|
|
|
121
241
|
.mat-ripple-element {
|
|
122
242
|
opacity: map.get(mdc-ripple.$dark-ink-opacities, press);
|
|
243
|
+
|
|
244
|
+
@include token-utils.use-tokens(
|
|
245
|
+
tokens-mat-tab-header.$prefix,
|
|
246
|
+
tokens-mat-tab-header.get-token-slots()
|
|
247
|
+
) {
|
|
248
|
+
@include token-utils.create-token-slot(background-color, inactive-ripple-color);
|
|
249
|
+
}
|
|
123
250
|
}
|
|
124
251
|
|
|
125
252
|
.mat-mdc-tab-header-pagination-controls-enabled & {
|
|
@@ -150,6 +277,13 @@ $mat-tab-animation-duration: 500ms !default;
|
|
|
150
277
|
border-width: 2px 2px 0 0;
|
|
151
278
|
height: 8px;
|
|
152
279
|
width: 8px;
|
|
280
|
+
|
|
281
|
+
@include token-utils.use-tokens(
|
|
282
|
+
tokens-mat-tab-header.$prefix,
|
|
283
|
+
tokens-mat-tab-header.get-token-slots()
|
|
284
|
+
) {
|
|
285
|
+
@include token-utils.create-token-slot(border-color, pagination-icon-color);
|
|
286
|
+
}
|
|
153
287
|
}
|
|
154
288
|
|
|
155
289
|
.mat-mdc-tab-header-pagination-disabled {
|
|
@@ -207,35 +341,64 @@ $mat-tab-animation-duration: 500ms !default;
|
|
|
207
341
|
z-index: 1;
|
|
208
342
|
}
|
|
209
343
|
|
|
210
|
-
@mixin paginated-tab-header-with-background($header-selector) {
|
|
344
|
+
@mixin paginated-tab-header-with-background($header-selector, $tab-selector) {
|
|
211
345
|
&.mat-tabs-with-background {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
346
|
+
@include token-utils.create-token-values(
|
|
347
|
+
tokens-mat-tab-header-with-background.$prefix,
|
|
348
|
+
tokens-mat-tab-header-with-background.get-unthemable-tokens()
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
@include token-utils.use-tokens(
|
|
352
|
+
tokens-mat-tab-header-with-background.$prefix,
|
|
353
|
+
tokens-mat-tab-header-with-background.get-token-slots()
|
|
354
|
+
) {
|
|
355
|
+
// Note that these selectors target direct descendants so
|
|
356
|
+
// that the styles don't apply to any nested tab groups.
|
|
357
|
+
> #{$header-selector}, > .mat-mdc-tab-header-pagination {
|
|
358
|
+
// Set background color for the tab group
|
|
359
|
+
@include token-utils.create-token-slot(background-color, background-color);
|
|
223
360
|
}
|
|
224
361
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
.
|
|
228
|
-
|
|
362
|
+
// Note: this is only scoped to primary, because the legacy tabs had the incorrect behavior
|
|
363
|
+
// where setting both a background and `mat-accent` would add the background, but keep
|
|
364
|
+
// accent on the selected tab. There are some internal apps whose design depends on this now
|
|
365
|
+
// so we have to replicate it here.
|
|
366
|
+
&.mat-primary > #{$header-selector} {
|
|
367
|
+
// Set labels to contrast against background
|
|
368
|
+
#{$tab-selector} .mdc-tab__text-label {
|
|
369
|
+
@include token-utils.create-token-slot(color, foreground-color);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.mdc-tab-indicator__content--underline {
|
|
373
|
+
@include token-utils.create-token-slot(border-color, foreground-color);
|
|
374
|
+
}
|
|
229
375
|
}
|
|
230
|
-
}
|
|
231
376
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
377
|
+
&:not(.mat-primary) > #{$header-selector} {
|
|
378
|
+
#{$tab-selector}:not(.mdc-tab--active) {
|
|
379
|
+
.mdc-tab__text-label {
|
|
380
|
+
@include token-utils.create-token-slot(color, foreground-color);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.mdc-tab-indicator__content--underline {
|
|
384
|
+
@include token-utils.create-token-slot(border-color, foreground-color);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
235
387
|
}
|
|
236
388
|
|
|
237
|
-
.mat-mdc-tab-header-pagination
|
|
238
|
-
|
|
389
|
+
> #{$header-selector}, > .mat-mdc-tab-header-pagination {
|
|
390
|
+
.mat-mdc-tab-header-pagination-chevron,
|
|
391
|
+
.mat-mdc-focus-indicator::before {
|
|
392
|
+
@include token-utils.create-token-slot(border-color, foreground-color);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.mat-ripple-element, .mdc-tab__ripple::before {
|
|
396
|
+
@include token-utils.create-token-slot(background-color, foreground-color);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.mat-mdc-tab-header-pagination-chevron {
|
|
400
|
+
@include token-utils.create-token-slot(color, foreground-color);
|
|
401
|
+
}
|
|
239
402
|
}
|
|
240
403
|
}
|
|
241
404
|
}
|
package/tabs/_tabs-theme.scss
CHANGED
|
@@ -1,108 +1,87 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '@material/theme/theme-color' as mdc-theme-color;
|
|
3
|
-
@use '@material/theme/theme' as mdc-theme;
|
|
4
|
-
@use '@material/tab-indicator' as mdc-tab-indicator;
|
|
5
2
|
@use '@material/tab-indicator/tab-indicator-theme' as mdc-tab-indicator-theme;
|
|
6
3
|
@use '@material/tab' as mdc-tab;
|
|
7
|
-
@use '@material/tab/
|
|
8
|
-
@use '
|
|
4
|
+
@use '@material/tab/tab-theme' as mdc-tab-theme;
|
|
5
|
+
@use '../core/tokens/m2/mdc/tab' as tokens-mdc-tab;
|
|
6
|
+
@use '../core/tokens/m2/mdc/tab-indicator' as tokens-mdc-tab-indicator;
|
|
7
|
+
@use '../core/tokens/m2/mat/tab-header' as tokens-mat-tab-header;
|
|
8
|
+
@use '../core/tokens/m2/mat/tab-header-with-background' as tokens-mat-tab-header-with-background;
|
|
9
9
|
@use '../core/theming/theming';
|
|
10
10
|
@use '../core/typography/typography';
|
|
11
|
-
@use '../core/
|
|
11
|
+
@use '../core/tokens/token-utils';
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
@mixin color($config-or-theme) {
|
|
15
15
|
$config: theming.get-color-config($config-or-theme);
|
|
16
|
-
$primary: theming.get-color-from-palette(map.get($config, primary));
|
|
17
|
-
$accent: theming.get-color-from-palette(map.get($config, accent));
|
|
18
|
-
$warn: theming.get-color-from-palette(map.get($config, warn));
|
|
19
|
-
$foreground: map.get($config, foreground);
|
|
20
|
-
|
|
21
|
-
@include mdc-helpers.using-mdc-theme($config) {
|
|
22
|
-
.mat-mdc-tab, .mat-mdc-tab-link {
|
|
23
|
-
@include mdc-tab-mixins.text-label-color(rgba(mdc-theme-color.$on-surface, 0.6));
|
|
24
|
-
|
|
25
|
-
// MDC seems to include a background color on tabs which only stands out on dark themes.
|
|
26
|
-
// Disable for now for backwards compatibility. These styles are inside the theme in order
|
|
27
|
-
// to avoid CSS specificity issues.
|
|
28
|
-
background-color: transparent;
|
|
29
|
-
|
|
30
|
-
&.mat-mdc-tab-disabled {
|
|
31
|
-
.mdc-tab__ripple::before,
|
|
32
|
-
.mat-ripple-element {
|
|
33
|
-
background-color: theming.get-color-from-palette($foreground, disabled);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@include _palette-styles($primary);
|
|
39
16
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
@include _palette-styles($accent);
|
|
43
|
-
}
|
|
17
|
+
.mat-mdc-tab-group, .mat-mdc-tab-nav-bar {
|
|
18
|
+
@include _palette-styles($config, primary);
|
|
44
19
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
20
|
+
&.mat-accent {
|
|
21
|
+
@include _palette-styles($config, accent);
|
|
48
22
|
}
|
|
49
23
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
24
|
+
&.mat-warn {
|
|
25
|
+
@include _palette-styles($config, warn);
|
|
26
|
+
}
|
|
54
27
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
28
|
+
&.mat-background-primary {
|
|
29
|
+
@include _background-styles($config, primary);
|
|
30
|
+
}
|
|
58
31
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
32
|
+
&.mat-background-accent {
|
|
33
|
+
@include _background-styles($config, accent);
|
|
62
34
|
}
|
|
63
35
|
|
|
64
|
-
|
|
65
|
-
@include
|
|
36
|
+
&.mat-background-warn {
|
|
37
|
+
@include _background-styles($config, warn);
|
|
66
38
|
}
|
|
67
39
|
}
|
|
68
40
|
}
|
|
69
41
|
|
|
70
|
-
@mixin _background($
|
|
71
|
-
$
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
--mat-mdc-tab-header-with-background-foreground-color: #{$foreground-value};
|
|
42
|
+
@mixin _background-styles($initial-config, $palette) {
|
|
43
|
+
$config: map.merge($initial-config, (primary: map.get($initial-config, $palette)));
|
|
44
|
+
@include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
|
|
45
|
+
tokens-mat-tab-header-with-background.get-color-tokens($config));
|
|
75
46
|
}
|
|
76
47
|
|
|
77
|
-
@mixin _palette-styles($
|
|
78
|
-
.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
.mdc-tab__ripple::before,
|
|
86
|
-
.mat-mdc-tab .mat-ripple-element,
|
|
87
|
-
.mat-mdc-tab-header-pagination .mat-ripple-element,
|
|
88
|
-
.mat-mdc-tab-link .mat-ripple-element {
|
|
89
|
-
@include mdc-theme.prop(background-color, $color);
|
|
90
|
-
}
|
|
48
|
+
@mixin _palette-styles($initial-config, $palette) {
|
|
49
|
+
$config: map.merge($initial-config, (primary: map.get($initial-config, $palette)));
|
|
50
|
+
@include mdc-tab-theme.secondary-navigation-tab-theme(
|
|
51
|
+
tokens-mdc-tab.get-color-tokens($config));
|
|
52
|
+
@include mdc-tab-indicator-theme.theme(
|
|
53
|
+
tokens-mdc-tab-indicator.get-color-tokens($config));
|
|
54
|
+
@include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
|
|
55
|
+
tokens-mat-tab-header.get-color-tokens($config));
|
|
91
56
|
}
|
|
92
57
|
|
|
93
58
|
@mixin typography($config-or-theme) {
|
|
94
59
|
$config: typography.private-typography-to-2018-config(
|
|
95
60
|
theming.get-typography-config($config-or-theme));
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
@include mdc-tab-
|
|
61
|
+
|
|
62
|
+
.mat-mdc-tab-header {
|
|
63
|
+
@include mdc-tab-theme.secondary-navigation-tab-theme(
|
|
64
|
+
tokens-mdc-tab.get-typography-tokens($config));
|
|
65
|
+
@include mdc-tab-indicator-theme.theme(
|
|
66
|
+
tokens-mdc-tab-indicator.get-typography-tokens($config));
|
|
67
|
+
@include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
|
|
68
|
+
tokens-mat-tab-header.get-typography-tokens($config));
|
|
69
|
+
@include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
|
|
70
|
+
tokens-mat-tab-header-with-background.get-typography-tokens($config));
|
|
99
71
|
}
|
|
100
72
|
}
|
|
101
73
|
|
|
102
74
|
@mixin density($config-or-theme) {
|
|
103
75
|
$density-scale: theming.get-density-config($config-or-theme);
|
|
104
76
|
.mat-mdc-tab-header {
|
|
105
|
-
@include mdc-tab-
|
|
77
|
+
@include mdc-tab-theme.secondary-navigation-tab-theme(
|
|
78
|
+
tokens-mdc-tab.get-density-tokens($density-scale));
|
|
79
|
+
@include mdc-tab-indicator-theme.theme(
|
|
80
|
+
tokens-mdc-tab-indicator.get-density-tokens($density-scale));
|
|
81
|
+
@include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
|
|
82
|
+
tokens-mat-tab-header.get-density-tokens($density-scale));
|
|
83
|
+
@include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
|
|
84
|
+
tokens-mat-tab-header-with-background.get-density-tokens($density-scale));
|
|
106
85
|
}
|
|
107
86
|
}
|
|
108
87
|
|