@angular/material 17.0.0 → 17.0.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.
Files changed (41) hide show
  1. package/autocomplete/index.d.ts +0 -2
  2. package/button/_button-theme.scss +4 -0
  3. package/core/ripple/_ripple-theme.scss +51 -19
  4. package/core/tokens/m2/_index.scss +27 -8
  5. package/esm2022/autocomplete/autocomplete-trigger.mjs +7 -7
  6. package/esm2022/core/version.mjs +1 -1
  7. package/esm2022/datepicker/calendar-body.mjs +2 -2
  8. package/esm2022/list/list-base.mjs +6 -6
  9. package/esm2022/select/select.mjs +2 -2
  10. package/fesm2022/autocomplete.mjs +6 -6
  11. package/fesm2022/autocomplete.mjs.map +1 -1
  12. package/fesm2022/core.mjs +1 -1
  13. package/fesm2022/core.mjs.map +1 -1
  14. package/fesm2022/datepicker.mjs +1 -1
  15. package/fesm2022/datepicker.mjs.map +1 -1
  16. package/fesm2022/list.mjs +5 -5
  17. package/fesm2022/list.mjs.map +1 -1
  18. package/fesm2022/select.mjs +1 -1
  19. package/fesm2022/select.mjs.map +1 -1
  20. package/form-field/_form-field-theme.scss +85 -49
  21. package/input/_input-theme.scss +39 -12
  22. package/list/_list-theme.scss +115 -83
  23. package/package.json +2 -2
  24. package/prebuilt-themes/deeppurple-amber.css +1 -1
  25. package/prebuilt-themes/indigo-pink.css +1 -1
  26. package/prebuilt-themes/pink-bluegrey.css +1 -1
  27. package/prebuilt-themes/purple-green.css +1 -1
  28. package/schematics/ng-add/index.js +1 -1
  29. package/schematics/ng-add/index.mjs +1 -1
  30. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +28 -29
  31. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +21 -19
  32. package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
  33. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +9 -8
  34. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +1 -2
  35. package/schematics/ng-update/index_bundled.js +31 -31
  36. package/slide-toggle/_slide-toggle-theme.scss +78 -44
  37. package/sort/_sort-theme.scss +51 -20
  38. package/stepper/_stepper-theme.scss +58 -25
  39. package/table/_table-theme.scss +53 -20
  40. package/tabs/_tabs-theme.scss +87 -51
  41. package/tree/_tree-theme.scss +53 -21
@@ -1,82 +1,116 @@
1
+ @use 'sass:map';
1
2
  @use '@material/switch/switch-theme' as mdc-switch-theme;
2
3
  @use '@material/form-field' as mdc-form-field;
3
4
  @use '../core/theming/theming';
4
5
  @use '../core/theming/inspection';
5
6
  @use '../core/mdc-helpers/mdc-helpers';
6
7
  @use '../core/typography/typography';
7
- @use '../core/tokens/m2/mdc/switch' as m2-mdc-switch;
8
- @use '../core/tokens/m2/mat/slide-toggle' as m2-mat-slide-toggle;
8
+ @use '../core/tokens/m2/mdc/switch' as tokens-mdc-switch;
9
+ @use '../core/tokens/m2/mat/slide-toggle' as tokens-mat-slide-toggle;
9
10
  @use '../core/tokens/token-utils';
10
11
 
11
12
  @mixin base($theme) {
12
- .mdc-switch {
13
- @include mdc-switch-theme.theme(m2-mdc-switch.get-unthemable-tokens());
13
+ @if inspection.get-theme-version($theme) == 1 {
14
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
15
+ }
16
+ @else {
17
+ .mdc-switch {
18
+ @include mdc-switch-theme.theme(tokens-mdc-switch.get-unthemable-tokens());
19
+ }
14
20
  }
15
21
  }
16
22
 
17
23
  @mixin color($theme) {
18
- $is-dark: inspection.get-theme-type($theme) == dark;
19
- $mdc-switch-color-tokens: m2-mdc-switch.get-color-tokens($theme);
24
+ @if inspection.get-theme-version($theme) == 1 {
25
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
26
+ }
27
+ @else {
28
+ $is-dark: inspection.get-theme-type($theme) == dark;
29
+ $mdc-switch-color-tokens: tokens-mdc-switch.get-color-tokens($theme);
20
30
 
21
- @include mdc-helpers.using-mdc-theme($theme) {
22
- // Add values for MDC slide toggles tokens
23
- .mat-mdc-slide-toggle {
24
- @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
25
- @include mdc-switch-theme.theme($mdc-switch-color-tokens);
31
+ @include mdc-helpers.using-mdc-theme($theme) {
32
+ // Add values for MDC slide toggles tokens
33
+ .mat-mdc-slide-toggle {
34
+ @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
35
+ @include mdc-switch-theme.theme($mdc-switch-color-tokens);
26
36
 
27
- // MDC should set the disabled color on the label, but doesn't, so we do it here instead.
28
- .mdc-switch--disabled + label {
29
- color: inspection.get-theme-color($theme, foreground, disabled-text);
30
- }
37
+ // MDC should set the disabled color on the label, but doesn't, so we do it here instead.
38
+ .mdc-switch--disabled + label {
39
+ color: inspection.get-theme-color($theme, foreground, disabled-text);
40
+ }
31
41
 
32
- // Change the color palette related tokens to accent or warn if applicable
33
- &.mat-accent {
34
- @include mdc-switch-theme.theme(
35
- m2-mdc-switch.private-get-color-palette-color-tokens($theme, accent));
36
- }
42
+ // Change the color palette related tokens to accent or warn if applicable
43
+ &.mat-accent {
44
+ @include mdc-switch-theme.theme(
45
+ tokens-mdc-switch.private-get-color-palette-color-tokens($theme, accent));
46
+ }
37
47
 
38
- &.mat-warn {
39
- @include mdc-switch-theme.theme(
40
- m2-mdc-switch.private-get-color-palette-color-tokens($theme, warn));
48
+ &.mat-warn {
49
+ @include mdc-switch-theme.theme(
50
+ tokens-mdc-switch.private-get-color-palette-color-tokens($theme, warn));
51
+ }
41
52
  }
42
53
  }
43
54
  }
44
55
  }
45
56
 
46
57
  @mixin typography($theme) {
47
- $mdc-switch-typography-tokens: m2-mdc-switch.get-typography-tokens($theme);
48
- $mat-slide-toggle-typography-tokens: m2-mat-slide-toggle.get-typography-tokens($theme);
58
+ @if inspection.get-theme-version($theme) == 1 {
59
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
60
+ }
61
+ @else {
62
+ $mdc-switch-typography-tokens: tokens-mdc-switch.get-typography-tokens($theme);
63
+ $mat-slide-toggle-typography-tokens: tokens-mat-slide-toggle.get-typography-tokens($theme);
49
64
 
50
- //Add values for MDC slide toggle tokens
51
- .mat-mdc-slide-toggle {
52
- @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
53
- @include mdc-switch-theme.theme($mdc-switch-typography-tokens);
54
- @include token-utils.create-token-values(
55
- m2-mat-slide-toggle.$prefix,
56
- $mat-slide-toggle-typography-tokens
57
- );
65
+ //Add values for MDC slide toggle tokens
66
+ .mat-mdc-slide-toggle {
67
+ @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
68
+ @include mdc-switch-theme.theme($mdc-switch-typography-tokens);
69
+ @include token-utils.create-token-values(
70
+ tokens-mat-slide-toggle.$prefix,
71
+ $mat-slide-toggle-typography-tokens
72
+ );
73
+ }
58
74
  }
59
75
  }
60
76
 
61
77
  @mixin density($theme) {
62
- $density-scale: inspection.get-theme-density($theme);
78
+ @if inspection.get-theme-version($theme) == 1 {
79
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
80
+ }
81
+ @else {
82
+ $density-scale: inspection.get-theme-density($theme);
63
83
 
64
- .mat-mdc-slide-toggle {
65
- @include mdc-switch-theme.theme(mdc-switch-theme.density($density-scale));
84
+ .mat-mdc-slide-toggle {
85
+ @include mdc-switch-theme.theme(mdc-switch-theme.density($density-scale));
86
+ }
66
87
  }
67
88
  }
68
89
 
69
90
  @mixin theme($theme) {
70
91
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-slide-toggle') {
71
- @include base($theme);
72
- @if inspection.theme-has($theme, color) {
73
- @include color($theme);
74
- }
75
- @if inspection.theme-has($theme, density) {
76
- @include density($theme);
92
+ @if inspection.get-theme-version($theme) == 1 {
93
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
77
94
  }
78
- @if inspection.theme-has($theme, typography) {
79
- @include typography($theme);
95
+ @else {
96
+ @include base($theme);
97
+ @if inspection.theme-has($theme, color) {
98
+ @include color($theme);
99
+ }
100
+ @if inspection.theme-has($theme, density) {
101
+ @include density($theme);
102
+ }
103
+ @if inspection.theme-has($theme, typography) {
104
+ @include typography($theme);
105
+ }
80
106
  }
81
107
  }
82
108
  }
109
+
110
+ @mixin _theme-from-tokens($tokens) {
111
+ @if ($tokens != ()) {
112
+ @include mdc-switch-theme.theme(map.get($tokens, tokens-mdc-switch.$prefix));
113
+ @include token-utils.create-token-values(
114
+ tokens-mat-slide-toggle.$prefix, map.get($tokens, tokens-mat-slide-toggle.$prefix));
115
+ }
116
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '../core/tokens/m2/mat/sort' as tokens-mat-sort;
2
3
  @use '../core/style/sass-utils';
3
4
  @use '../core/typography/typography';
@@ -5,42 +6,72 @@
5
6
  @use '../core/theming/inspection';
6
7
  @use '../core/tokens/token-utils';
7
8
 
8
- @mixin base($theme) {}
9
+ @mixin base($theme) {
10
+ @if inspection.get-theme-version($theme) == 1 {
11
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
12
+ }
13
+ @else {}
14
+ }
9
15
 
10
16
  @mixin color($theme) {
11
- @include sass-utils.current-selector-or-root() {
12
- @include token-utils.create-token-values(tokens-mat-sort.$prefix,
13
- tokens-mat-sort.get-color-tokens($theme));
17
+ @if inspection.get-theme-version($theme) == 1 {
18
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
19
+ }
20
+ @else {
21
+ @include sass-utils.current-selector-or-root() {
22
+ @include token-utils.create-token-values(tokens-mat-sort.$prefix,
23
+ tokens-mat-sort.get-color-tokens($theme));
24
+ }
14
25
  }
15
26
  }
16
27
 
17
28
  @mixin typography($theme) {
18
- @include sass-utils.current-selector-or-root() {
19
- @include token-utils.create-token-values(tokens-mat-sort.$prefix,
20
- tokens-mat-sort.get-typography-tokens($theme));
29
+ @if inspection.get-theme-version($theme) == 1 {
30
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
31
+ }
32
+ @else {
33
+ @include sass-utils.current-selector-or-root() {
34
+ @include token-utils.create-token-values(tokens-mat-sort.$prefix,
35
+ tokens-mat-sort.get-typography-tokens($theme));
36
+ }
21
37
  }
22
38
  }
23
39
 
24
40
  @mixin density($theme) {
25
- $density-scale: inspection.get-theme-density($theme);
26
-
27
- @include sass-utils.current-selector-or-root() {
28
- @include token-utils.create-token-values(tokens-mat-sort.$prefix,
29
- tokens-mat-sort.get-density-tokens($theme));
41
+ @if inspection.get-theme-version($theme) == 1 {
42
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
43
+ }
44
+ @else {
45
+ @include sass-utils.current-selector-or-root() {
46
+ @include token-utils.create-token-values(tokens-mat-sort.$prefix,
47
+ tokens-mat-sort.get-density-tokens($theme));
48
+ }
30
49
  }
31
50
  }
32
51
 
33
52
  @mixin theme($theme) {
34
53
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-sort') {
35
- @include base($theme);
36
- @if inspection.theme-has($theme, color) {
37
- @include color($theme);
38
- }
39
- @if inspection.theme-has($theme, density) {
40
- @include density($theme);
54
+ @if inspection.get-theme-version($theme) == 1 {
55
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
41
56
  }
42
- @if inspection.theme-has($theme, typography) {
43
- @include typography($theme);
57
+ @else {
58
+ @include base($theme);
59
+ @if inspection.theme-has($theme, color) {
60
+ @include color($theme);
61
+ }
62
+ @if inspection.theme-has($theme, density) {
63
+ @include density($theme);
64
+ }
65
+ @if inspection.theme-has($theme, typography) {
66
+ @include typography($theme);
67
+ }
44
68
  }
45
69
  }
46
70
  }
71
+
72
+ @mixin _theme-from-tokens($tokens) {
73
+ @if ($tokens != ()) {
74
+ @include token-utils.create-token-values(
75
+ tokens-mat-sort.$prefix, map.get($tokens, tokens-mat-sort.$prefix));
76
+ }
77
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '../core/theming/theming';
2
3
  @use '../core/theming/inspection';
3
4
  @use '../core/typography/typography';
@@ -5,50 +6,82 @@
5
6
  @use '../core/tokens/token-utils';
6
7
  @use '../core/tokens/m2/mat/stepper' as tokens-mat-stepper;
7
8
 
8
- @mixin base($theme) {}
9
+ @mixin base($theme) {
10
+ @if inspection.get-theme-version($theme) == 1 {
11
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
12
+ }
13
+ @else {}
14
+ }
9
15
 
10
16
  @mixin color($theme) {
11
- @include sass-utils.current-selector-or-root() {
12
- @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
13
- tokens-mat-stepper.get-color-tokens($theme));
14
-
15
- .mat-step-header.mat-accent {
17
+ @if inspection.get-theme-version($theme) == 1 {
18
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
19
+ }
20
+ @else {
21
+ @include sass-utils.current-selector-or-root() {
16
22
  @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
17
- tokens-mat-stepper.private-get-color-palette-color-tokens($theme, accent));
18
- }
23
+ tokens-mat-stepper.get-color-tokens($theme));
19
24
 
20
- .mat-step-header.mat-warn {
21
- @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
22
- tokens-mat-stepper.private-get-color-palette-color-tokens($theme, warn));
25
+ .mat-step-header.mat-accent {
26
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
27
+ tokens-mat-stepper.private-get-color-palette-color-tokens($theme, accent));
28
+ }
29
+
30
+ .mat-step-header.mat-warn {
31
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
32
+ tokens-mat-stepper.private-get-color-palette-color-tokens($theme, warn));
33
+ }
23
34
  }
24
35
  }
25
36
  }
26
37
 
27
38
  @mixin typography($theme) {
28
- @include sass-utils.current-selector-or-root() {
29
- @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
30
- tokens-mat-stepper.get-typography-tokens($theme));
39
+ @if inspection.get-theme-version($theme) == 1 {
40
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
41
+ }
42
+ @else {
43
+ @include sass-utils.current-selector-or-root() {
44
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
45
+ tokens-mat-stepper.get-typography-tokens($theme));
46
+ }
31
47
  }
32
48
  }
33
49
 
34
50
  @mixin density($theme) {
35
- @include sass-utils.current-selector-or-root() {
36
- @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
37
- tokens-mat-stepper.get-density-tokens($theme));
51
+ @if inspection.get-theme-version($theme) == 1 {
52
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
53
+ }
54
+ @else {
55
+ @include sass-utils.current-selector-or-root() {
56
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
57
+ tokens-mat-stepper.get-density-tokens($theme));
58
+ }
38
59
  }
39
60
  }
40
61
 
41
62
  @mixin theme($theme) {
42
63
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-stepper') {
43
- @include base($theme);
44
- @if inspection.theme-has($theme, color) {
45
- @include color($theme);
64
+ @if inspection.get-theme-version($theme) == 1 {
65
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
46
66
  }
47
- @if inspection.theme-has($theme, density) {
48
- @include density($theme);
49
- }
50
- @if inspection.theme-has($theme, typography) {
51
- @include typography($theme);
67
+ @else {
68
+ @include base($theme);
69
+ @if inspection.theme-has($theme, color) {
70
+ @include color($theme);
71
+ }
72
+ @if inspection.theme-has($theme, density) {
73
+ @include density($theme);
74
+ }
75
+ @if inspection.theme-has($theme, typography) {
76
+ @include typography($theme);
77
+ }
52
78
  }
53
79
  }
54
80
  }
81
+
82
+ @mixin _theme-from-tokens($tokens) {
83
+ @if ($tokens != ()) {
84
+ @include token-utils.create-token-values(
85
+ tokens-mat-stepper.$prefix, map.get($tokens, tokens-mat-stepper.$prefix));
86
+ }
87
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '../core/tokens/m2/mat/table' as tokens-mat-table;
2
3
  @use '../core/theming/theming';
3
4
  @use '../core/theming/inspection';
@@ -6,44 +7,76 @@
6
7
  @use '../core/style/sass-utils';
7
8
 
8
9
  @mixin base($theme) {
9
- @include sass-utils.current-selector-or-root() {
10
- @include token-utils.create-token-values(
11
- tokens-mat-table.$prefix, tokens-mat-table.get-unthemable-tokens());
10
+ @if inspection.get-theme-version($theme) == 1 {
11
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
12
+ }
13
+ @else {
14
+ @include sass-utils.current-selector-or-root() {
15
+ @include token-utils.create-token-values(
16
+ tokens-mat-table.$prefix, tokens-mat-table.get-unthemable-tokens());
17
+ }
12
18
  }
13
19
  }
14
20
 
15
21
  @mixin color($theme) {
16
- @include sass-utils.current-selector-or-root() {
17
- @include token-utils.create-token-values(tokens-mat-table.$prefix,
18
- tokens-mat-table.get-color-tokens($theme));
22
+ @if inspection.get-theme-version($theme) == 1 {
23
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
24
+ }
25
+ @else {
26
+ @include sass-utils.current-selector-or-root() {
27
+ @include token-utils.create-token-values(tokens-mat-table.$prefix,
28
+ tokens-mat-table.get-color-tokens($theme));
29
+ }
19
30
  }
20
31
  }
21
32
 
22
33
  @mixin typography($theme) {
23
- @include sass-utils.current-selector-or-root() {
24
- @include token-utils.create-token-values(tokens-mat-table.$prefix,
25
- tokens-mat-table.get-typography-tokens($theme));
34
+ @if inspection.get-theme-version($theme) == 1 {
35
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
36
+ }
37
+ @else {
38
+ @include sass-utils.current-selector-or-root() {
39
+ @include token-utils.create-token-values(tokens-mat-table.$prefix,
40
+ tokens-mat-table.get-typography-tokens($theme));
41
+ }
26
42
  }
27
43
  }
28
44
 
29
45
  @mixin density($theme) {
30
- @include sass-utils.current-selector-or-root() {
31
- @include token-utils.create-token-values(tokens-mat-table.$prefix,
32
- tokens-mat-table.get-density-tokens($theme));
46
+ @if inspection.get-theme-version($theme) == 1 {
47
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
48
+ }
49
+ @else {
50
+ @include sass-utils.current-selector-or-root() {
51
+ @include token-utils.create-token-values(tokens-mat-table.$prefix,
52
+ tokens-mat-table.get-density-tokens($theme));
53
+ }
33
54
  }
34
55
  }
35
56
 
36
57
  @mixin theme($theme) {
37
58
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-table') {
38
- @include base($theme);
39
- @if inspection.theme-has($theme, color) {
40
- @include color($theme);
59
+ @if inspection.get-theme-version($theme) == 1 {
60
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
41
61
  }
42
- @if inspection.theme-has($theme, density) {
43
- @include density($theme);
44
- }
45
- @if inspection.theme-has($theme, typography) {
46
- @include typography($theme);
62
+ @else {
63
+ @include base($theme);
64
+ @if inspection.theme-has($theme, color) {
65
+ @include color($theme);
66
+ }
67
+ @if inspection.theme-has($theme, density) {
68
+ @include density($theme);
69
+ }
70
+ @if inspection.theme-has($theme, typography) {
71
+ @include typography($theme);
72
+ }
47
73
  }
48
74
  }
49
75
  }
76
+
77
+ @mixin _theme-from-tokens($tokens) {
78
+ @if ($tokens != ()) {
79
+ @include token-utils.create-token-values(
80
+ tokens-mat-table.$prefix, map.get($tokens, tokens-mat-table.$prefix));
81
+ }
82
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '@material/tab-indicator/tab-indicator-theme' as mdc-tab-indicator-theme;
2
3
  @use '@material/tab/tab-theme' as mdc-tab-theme;
3
4
  @use '../core/style/sass-utils';
@@ -11,40 +12,50 @@
11
12
  @use '../core/tokens/token-utils';
12
13
 
13
14
  @mixin base($theme) {
14
- @include sass-utils.current-selector-or-root() {
15
- @include mdc-tab-indicator-theme.theme(tokens-mdc-tab-indicator.get-unthemable-tokens());
16
- @include mdc-tab-theme.secondary-navigation-tab-theme(tokens-mdc-tab.get-unthemable-tokens());
17
- @include token-utils.create-token-values(
18
- tokens-mat-tab-header.$prefix, tokens-mat-tab-header.get-unthemable-tokens());
19
- @include token-utils.create-token-values(
20
- tokens-mat-tab-header-with-background.$prefix,
21
- tokens-mat-tab-header-with-background.get-unthemable-tokens()
22
- );
15
+ @if inspection.get-theme-version($theme) == 1 {
16
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
17
+ }
18
+ @else {
19
+ @include sass-utils.current-selector-or-root() {
20
+ @include mdc-tab-indicator-theme.theme(tokens-mdc-tab-indicator.get-unthemable-tokens());
21
+ @include mdc-tab-theme.secondary-navigation-tab-theme(tokens-mdc-tab.get-unthemable-tokens());
22
+ @include token-utils.create-token-values(
23
+ tokens-mat-tab-header.$prefix, tokens-mat-tab-header.get-unthemable-tokens());
24
+ @include token-utils.create-token-values(
25
+ tokens-mat-tab-header-with-background.$prefix,
26
+ tokens-mat-tab-header-with-background.get-unthemable-tokens()
27
+ );
28
+ }
23
29
  }
24
30
  }
25
31
 
26
32
  @mixin color($theme) {
27
- .mat-mdc-tab-group, .mat-mdc-tab-nav-bar {
28
- @include _palette-styles($theme, primary);
33
+ @if inspection.get-theme-version($theme) == 1 {
34
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
35
+ }
36
+ @else {
37
+ .mat-mdc-tab-group, .mat-mdc-tab-nav-bar {
38
+ @include _palette-styles($theme, primary);
29
39
 
30
- &.mat-accent {
31
- @include _palette-styles($theme, accent);
32
- }
40
+ &.mat-accent {
41
+ @include _palette-styles($theme, accent);
42
+ }
33
43
 
34
- &.mat-warn {
35
- @include _palette-styles($theme, warn);
36
- }
44
+ &.mat-warn {
45
+ @include _palette-styles($theme, warn);
46
+ }
37
47
 
38
- &.mat-background-primary {
39
- @include _background-styles($theme, primary);
40
- }
48
+ &.mat-background-primary {
49
+ @include _background-styles($theme, primary);
50
+ }
41
51
 
42
- &.mat-background-accent {
43
- @include _background-styles($theme, accent);
44
- }
52
+ &.mat-background-accent {
53
+ @include _background-styles($theme, accent);
54
+ }
45
55
 
46
- &.mat-background-warn {
47
- @include _background-styles($theme, warn);
56
+ &.mat-background-warn {
57
+ @include _background-styles($theme, warn);
58
+ }
48
59
  }
49
60
  }
50
61
  }
@@ -64,43 +75,68 @@
64
75
  }
65
76
 
66
77
  @mixin typography($theme) {
67
- .mat-mdc-tab-header {
68
- @include mdc-tab-theme.secondary-navigation-tab-theme(
69
- tokens-mdc-tab.get-typography-tokens($theme));
70
- @include mdc-tab-indicator-theme.theme(
71
- tokens-mdc-tab-indicator.get-typography-tokens($theme));
72
- @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
73
- tokens-mat-tab-header.get-typography-tokens($theme));
74
- @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
75
- tokens-mat-tab-header-with-background.get-typography-tokens($theme));
78
+ @if inspection.get-theme-version($theme) == 1 {
79
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
80
+ }
81
+ @else {
82
+ .mat-mdc-tab-header {
83
+ @include mdc-tab-theme.secondary-navigation-tab-theme(
84
+ tokens-mdc-tab.get-typography-tokens($theme));
85
+ @include mdc-tab-indicator-theme.theme(
86
+ tokens-mdc-tab-indicator.get-typography-tokens($theme));
87
+ @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
88
+ tokens-mat-tab-header.get-typography-tokens($theme));
89
+ @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
90
+ tokens-mat-tab-header-with-background.get-typography-tokens($theme));
91
+ }
76
92
  }
77
93
  }
78
94
 
79
95
  @mixin density($theme) {
80
- .mat-mdc-tab-header {
81
- @include mdc-tab-theme.secondary-navigation-tab-theme(
82
- tokens-mdc-tab.get-density-tokens($theme));
83
- @include mdc-tab-indicator-theme.theme(
84
- tokens-mdc-tab-indicator.get-density-tokens($theme));
85
- @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
86
- tokens-mat-tab-header.get-density-tokens($theme));
87
- @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
88
- tokens-mat-tab-header-with-background.get-density-tokens($theme));
96
+ @if inspection.get-theme-version($theme) == 1 {
97
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
98
+ }
99
+ @else {
100
+ .mat-mdc-tab-header {
101
+ @include mdc-tab-theme.secondary-navigation-tab-theme(
102
+ tokens-mdc-tab.get-density-tokens($theme));
103
+ @include mdc-tab-indicator-theme.theme(
104
+ tokens-mdc-tab-indicator.get-density-tokens($theme));
105
+ @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
106
+ tokens-mat-tab-header.get-density-tokens($theme));
107
+ @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
108
+ tokens-mat-tab-header-with-background.get-density-tokens($theme));
109
+ }
89
110
  }
90
111
  }
91
112
 
92
113
  @mixin theme($theme) {
93
114
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-tabs') {
94
- @include base($theme);
95
- @if inspection.theme-has($theme, color) {
96
- @include color($theme);
97
- }
98
- @if inspection.theme-has($theme, density) {
99
- @include density($theme);
115
+ @if inspection.get-theme-version($theme) == 1 {
116
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
100
117
  }
101
- @if inspection.theme-has($theme, typography) {
102
- @include typography($theme);
118
+ @else {
119
+ @include base($theme);
120
+ @if inspection.theme-has($theme, color) {
121
+ @include color($theme);
122
+ }
123
+ @if inspection.theme-has($theme, density) {
124
+ @include density($theme);
125
+ }
126
+ @if inspection.theme-has($theme, typography) {
127
+ @include typography($theme);
128
+ }
103
129
  }
104
130
  }
105
131
  }
106
132
 
133
+ @mixin _theme-from-tokens($tokens) {
134
+ @if ($tokens != ()) {
135
+ @include mdc-tab-theme.secondary-navigation-tab-theme(
136
+ map.get($tokens, tokens-mdc-tab.$prefix));
137
+ @include mdc-tab-indicator-theme.theme(
138
+ map.get($tokens, tokens-mdc-tab-indicator.$prefix));
139
+ @include token-utils.create-token-values(
140
+ tokens-mat-tab-header.$prefix, map.get($tokens, tokens-mat-tab-header.$prefix));
141
+ }
142
+ }