@angular/material 20.1.0-next.1 → 20.1.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.
Files changed (164) hide show
  1. package/_index.scss +1 -2
  2. package/autocomplete/_autocomplete-theme.scss +28 -37
  3. package/autocomplete/_m2-autocomplete.scss +10 -22
  4. package/badge/_badge-theme.scss +35 -44
  5. package/badge/_m2-badge.scss +46 -59
  6. package/bottom-sheet/_bottom-sheet-theme.scss +28 -40
  7. package/bottom-sheet/_m2-bottom-sheet.scss +16 -33
  8. package/button/_button-theme.scss +37 -55
  9. package/button/_fab-theme.scss +42 -56
  10. package/button/_icon-button-theme.scss +33 -49
  11. package/button/_m2-button.scss +135 -158
  12. package/button/_m2-fab.scss +60 -69
  13. package/button/_m2-icon-button.scss +30 -50
  14. package/button/_m3-button.scss +1 -2
  15. package/button/_m3-fab.scss +1 -2
  16. package/button/_m3-icon-button.scss +1 -2
  17. package/button/testing/index.d.ts +1 -0
  18. package/button-toggle/_button-toggle-theme.scss +29 -44
  19. package/button-toggle/_m2-button-toggle.scss +58 -81
  20. package/button-toggle/_m3-button-toggle.scss +1 -2
  21. package/card/_card-theme.scss +28 -36
  22. package/card/_m2-card.scss +30 -45
  23. package/checkbox/_checkbox-theme.scss +37 -50
  24. package/checkbox/_m2-checkbox.scss +30 -40
  25. package/checkbox/_m3-checkbox.scss +1 -2
  26. package/chips/_chips-theme.scss +27 -30
  27. package/chips/_m2-chip.scss +40 -53
  28. package/chips/_m3-chip.scss +1 -2
  29. package/core/_core-theme.scss +48 -67
  30. package/core/_m2-app.scss +11 -23
  31. package/core/focus-indicators/_private.scss +2 -5
  32. package/core/m2/_theming.scss +36 -41
  33. package/core/option/_m2-optgroup.scss +13 -25
  34. package/core/option/_m2-option.scss +16 -22
  35. package/core/option/_optgroup-theme.scss +28 -30
  36. package/core/option/_option-theme.scss +35 -34
  37. package/core/ripple/_m2-ripple.scss +8 -20
  38. package/core/ripple/_ripple-theme.scss +28 -33
  39. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +14 -21
  40. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +55 -45
  41. package/core/theming/_all-theme.scss +38 -42
  42. package/core/theming/_definition.scss +22 -13
  43. package/core/theming/_inspection.scss +0 -12
  44. package/core/theming/_m2-inspection.scss +0 -33
  45. package/core/theming/_theming.scss +4 -172
  46. package/core/tokens/_m2-utils.scss +16 -68
  47. package/core/tokens/_m3-utils.scss +2 -14
  48. package/core/tokens/_token-utils.scss +7 -27
  49. package/core/tokens/m2/_index.scss +6 -0
  50. package/core/tokens/m2/_md-sys-color.scss +123 -0
  51. package/core/tokens/m2/_md-sys-elevation.scss +16 -0
  52. package/core/tokens/m2/_md-sys-motion.scss +36 -0
  53. package/core/tokens/m2/_md-sys-shape.scss +22 -0
  54. package/core/tokens/m2/_md-sys-state.scss +15 -0
  55. package/core/tokens/m2/_md-sys-typescale.scss +68 -0
  56. package/core/tokens/m3/_md-sys-color.scss +2 -2
  57. package/core/tokens/m3/_md-sys-typescale.scss +1 -1
  58. package/core/tokens/m3/_theme.scss +14 -26
  59. package/datepicker/_datepicker-theme.scss +38 -40
  60. package/datepicker/_m2-datepicker.scss +26 -40
  61. package/dialog/_dialog-theme.scss +28 -34
  62. package/dialog/_m2-dialog.scss +34 -48
  63. package/divider/_divider-theme.scss +28 -30
  64. package/divider/_m2-divider.scss +10 -21
  65. package/expansion/_expansion-theme.scss +28 -39
  66. package/expansion/_m2-expansion.scss +52 -67
  67. package/expansion/_m3-expansion.scss +3 -2
  68. package/fesm2022/autocomplete.mjs +1 -1
  69. package/fesm2022/button/testing.mjs +7 -4
  70. package/fesm2022/button/testing.mjs.map +1 -1
  71. package/fesm2022/chips.mjs +1 -1
  72. package/fesm2022/core.mjs +1 -1
  73. package/fesm2022/core.mjs.map +1 -1
  74. package/fesm2022/datepicker.mjs +1 -1
  75. package/fesm2022/expansion.mjs +2 -2
  76. package/fesm2022/expansion.mjs.map +1 -1
  77. package/fesm2022/{form-field-C9DZXojn.mjs → form-field-CFbrnFED.mjs} +3 -3
  78. package/fesm2022/{form-field-C9DZXojn.mjs.map → form-field-CFbrnFED.mjs.map} +1 -1
  79. package/fesm2022/form-field.mjs +2 -2
  80. package/fesm2022/input.mjs +3 -27
  81. package/fesm2022/input.mjs.map +1 -1
  82. package/fesm2022/menu/testing.mjs +97 -13
  83. package/fesm2022/menu/testing.mjs.map +1 -1
  84. package/fesm2022/menu.mjs +343 -122
  85. package/fesm2022/menu.mjs.map +1 -1
  86. package/fesm2022/{module-BDiw_nWS.mjs → module-B0CLRw5e.mjs} +3 -3
  87. package/fesm2022/{module-BDiw_nWS.mjs.map → module-B0CLRw5e.mjs.map} +1 -1
  88. package/fesm2022/{module-DzZHEh7B.mjs → module-B62K-792.mjs} +2 -2
  89. package/fesm2022/{module-DzZHEh7B.mjs.map → module-B62K-792.mjs.map} +1 -1
  90. package/fesm2022/paginator.mjs +3 -3
  91. package/fesm2022/select.mjs +3 -3
  92. package/fesm2022/sidenav.mjs +2 -4
  93. package/fesm2022/sidenav.mjs.map +1 -1
  94. package/fesm2022/slide-toggle.mjs +2 -2
  95. package/fesm2022/slide-toggle.mjs.map +1 -1
  96. package/fesm2022/snack-bar.mjs +2 -2
  97. package/fesm2022/timepicker.mjs +1 -1
  98. package/form-field/_form-field-theme.scss +35 -51
  99. package/form-field/_m2-form-field.scss +125 -146
  100. package/form-field/_m3-form-field.scss +1 -2
  101. package/grid-list/_grid-list-theme.scss +28 -28
  102. package/grid-list/_m2-grid-list.scss +16 -29
  103. package/icon/_icon-theme.scss +40 -41
  104. package/icon/_m2-icon.scss +7 -21
  105. package/input/_input-theme.scss +1 -4
  106. package/input/index.d.ts +0 -11
  107. package/list/_list-theme.scss +57 -53
  108. package/list/_m2-list.scss +84 -108
  109. package/list/_m3-list.scss +1 -2
  110. package/menu/_m2-menu.scss +33 -46
  111. package/menu/_menu-theme.scss +28 -33
  112. package/menu/index.d.ts +145 -61
  113. package/menu/testing/index.d.ts +50 -2
  114. package/package.json +2 -2
  115. package/paginator/_m2-paginator.scss +38 -58
  116. package/paginator/_m3-paginator.scss +1 -2
  117. package/paginator/_paginator-theme.scss +28 -33
  118. package/prebuilt-themes/deeppurple-amber.css +1 -1
  119. package/prebuilt-themes/indigo-pink.css +1 -1
  120. package/prebuilt-themes/pink-bluegrey.css +1 -1
  121. package/prebuilt-themes/purple-green.css +1 -1
  122. package/progress-bar/_m2-progress-bar.scss +11 -24
  123. package/progress-bar/_progress-bar-theme.scss +35 -43
  124. package/progress-spinner/_m2-progress-spinner.scss +9 -20
  125. package/progress-spinner/_progress-spinner-theme.scss +42 -43
  126. package/radio/_m2-radio.scss +30 -40
  127. package/radio/_m3-radio.scss +1 -2
  128. package/radio/_radio-theme.scss +33 -46
  129. package/schematics/ng-add/index.js +1 -1
  130. package/schematics/ng-generate/theme-color/schema.json +1 -1
  131. package/select/_m2-select.scss +23 -30
  132. package/select/_m3-select.scss +1 -2
  133. package/select/_select-theme.scss +38 -51
  134. package/sidenav/_m2-sidenav.scss +26 -36
  135. package/sidenav/_sidenav-theme.scss +28 -30
  136. package/slide-toggle/_m2-slide-toggle.scss +111 -143
  137. package/slide-toggle/_m3-slide-toggle.scss +1 -0
  138. package/slide-toggle/_slide-toggle-theme.scss +42 -80
  139. package/slider/_m2-slider.scss +34 -55
  140. package/slider/_slider-theme.scss +38 -45
  141. package/snack-bar/_m2-snack-bar.scss +16 -36
  142. package/snack-bar/_snack-bar-theme.scss +28 -31
  143. package/sort/_m2-sort.scss +7 -18
  144. package/sort/_sort-theme.scss +28 -33
  145. package/stepper/_m2-stepper.scss +39 -57
  146. package/stepper/_m3-stepper.scss +1 -2
  147. package/stepper/_stepper-theme.scss +41 -49
  148. package/table/_m2-table.scss +54 -72
  149. package/table/_m3-table.scss +1 -2
  150. package/table/_table-theme.scss +28 -36
  151. package/tabs/_m2-tabs.scss +31 -46
  152. package/tabs/_m3-tabs.scss +1 -2
  153. package/tabs/_tabs-theme.scss +41 -49
  154. package/timepicker/_m2-timepicker.scss +10 -22
  155. package/timepicker/_timepicker-theme.scss +28 -46
  156. package/toolbar/_m2-toolbar.scss +26 -46
  157. package/toolbar/_m3-toolbar.scss +1 -2
  158. package/toolbar/_toolbar-theme.scss +55 -46
  159. package/tooltip/_m2-tooltip.scss +16 -34
  160. package/tooltip/_tooltip-theme.scss +28 -37
  161. package/tree/_m2-tree.scss +21 -38
  162. package/tree/_m3-tree.scss +1 -2
  163. package/tree/_tree-theme.scss +28 -38
  164. package/core/tokens/_format-tokens.scss +0 -5
@@ -69,32 +69,12 @@
69
69
  @return _create-var(--mat-#{$token}, $sys-fallback);
70
70
  }
71
71
 
72
- // Outputs a map of tokens.
73
- @mixin create-token-values($tokens) {
74
- @include _create-token-values-internal($tokens, false);
75
- }
76
-
77
- // Outputs a map of tokens under a specific prefix in scenarios where tokens may be mixed with
78
- // other declarations (e.g. M2 themes). Used to avoid https://sass-lang.com/documentation/breaking-changes/mixed-decls/
79
- @mixin create-token-values-mixed($tokens) {
80
- @include _create-token-values-internal($tokens, true);
81
- }
82
-
83
- @mixin _create-token-values-internal($tokens, $in-place) {
84
- @if ($tokens != null) {
85
- @if ($in-place) {
86
- & {
87
- @each $key, $value in $tokens {
88
- @if $value != null {
89
- --mat-#{$key}: #{$value};
90
- }
91
- }
92
- }
93
- } @else {
94
- @each $key, $value in $tokens {
95
- @if $value != null {
96
- --mat-#{$key}: #{$value};
97
- }
72
+ // Outputs a map of token values as CSS variable definitions.
73
+ @mixin values($tokens) {
74
+ @include sass-utils.current-selector-or-root() {
75
+ @each $key, $value in $tokens {
76
+ @if $value != null {
77
+ --mat-#{$key}: #{$value};
98
78
  }
99
79
  }
100
80
  }
@@ -125,7 +105,7 @@
125
105
  $namespace: list.nth($data, 1);
126
106
  $name: list.nth($data, 2);
127
107
  $prefixed-name: $namespace + '-' + $name;
128
- @include create-token-values(($prefixed-name: $value));
108
+ @include values(($prefixed-name: $value));
129
109
  } @else {
130
110
  @error #{'Invalid token name `'}#{$name}#{'`. '}#{'Valid tokens are: '}#{$all-names};
131
111
  }
@@ -0,0 +1,6 @@
1
+ @forward './md-sys-color';
2
+ @forward './md-sys-elevation';
3
+ @forward './md-sys-motion';
4
+ @forward './md-sys-shape';
5
+ @forward './md-sys-state';
6
+ @forward './md-sys-typescale';
@@ -0,0 +1,123 @@
1
+ //
2
+ // Design system display name: Material 3
3
+ // Design system version: v0.161
4
+ //
5
+
6
+ @use 'sass:map';
7
+ @use '../../m2/palette';
8
+
9
+ @function md-sys-color-values-dark($palettes) {
10
+ @return (
11
+ primary: map.get($palettes, primary, default),
12
+ on-primary: map.get($palettes, primary, default-contrast),
13
+ inverse-primary: map.get($palettes, primary, 600),
14
+ secondary: map.get($palettes, accent, default),
15
+ on-secondary: map.get($palettes, accent, default-contrast),
16
+ inverse-secondary: map.get($palettes, accent, 600),
17
+ error: map.get($palettes, warn, default),
18
+ on-error: map.get($palettes, warn, default-contrast),
19
+ inverse-error: map.get($palettes, warn, 600),
20
+ shadow: black,
21
+ surface: map.get(palette.$grey-palette, 800),
22
+ on-surface: white,
23
+ surface-variant: #4a4a4a,
24
+ on-surface-variant: rgba(white, 0.7),
25
+ background: #303030,
26
+ inverse-surface: white,
27
+ inverse-on-surface: rgba(black, 0.87),
28
+ outline: rgba(white, 0.12),
29
+ outline-variant: rgba(white, 0.38),
30
+
31
+ // TBD
32
+ error-container: null,
33
+ on-background: null,
34
+ on-error-container: null,
35
+ on-primary-container: null,
36
+ on-primary-fixed: null,
37
+ on-primary-fixed-variant: null,
38
+ on-secondary-container: null,
39
+ on-secondary-fixed: null,
40
+ on-secondary-fixed-variant: null,
41
+ on-tertiary: null,
42
+ on-tertiary-container: null,
43
+ on-tertiary-fixed: null,
44
+ on-tertiary-fixed-variant: null,
45
+ primary-container: null,
46
+ primary-fixed: null,
47
+ primary-fixed-dim: null,
48
+ scrim: null,
49
+ secondary-container: null,
50
+ secondary-fixed: null,
51
+ secondary-fixed-dim: null,
52
+ surface-bright: null,
53
+ surface-container: null,
54
+ surface-container-high: null,
55
+ surface-container-highest: null,
56
+ surface-container-low: null,
57
+ surface-container-lowest: null,
58
+ surface-dim: null,
59
+ surface-tint: null,
60
+ tertiary: null,
61
+ tertiary-container: null,
62
+ tertiary-fixed: null,
63
+ tertiary-fixed-dim: null,
64
+ );
65
+ }
66
+
67
+ @function md-sys-color-values-light($palettes) {
68
+ @return (
69
+ primary: map.get($palettes, primary, default),
70
+ on-primary: map.get($palettes, primary, default-contrast),
71
+ inverse-primary: map.get($palettes, primary, 300),
72
+ secondary: map.get($palettes, accent, default),
73
+ on-secondary: map.get($palettes, accent, default-contrast),
74
+ inverse-secondary: map.get($palettes, accent, 300),
75
+ error: map.get($palettes, warn, default),
76
+ on-error: map.get($palettes, warn, default-contrast),
77
+ inverse-error: map.get($palettes, warn, 300),
78
+ shadow: black,
79
+ surface: white,
80
+ on-surface: rgba(black, 0.87),
81
+ surface-variant: #f6f6f6,
82
+ on-surface-variant: rgba(black, 0.54),
83
+ background: map.get(palette.$grey-palette, 50),
84
+ inverse-surface: map.get(palette.$grey-palette, 800),
85
+ inverse-on-surface: white,
86
+ outline: rgba(black, 0.12),
87
+ outline-variant: rgba(black, 0.38),
88
+
89
+ // TBD
90
+ error-container: null,
91
+ on-background: null,
92
+ on-error-container: null,
93
+ on-primary-container: null,
94
+ on-primary-fixed: null,
95
+ on-primary-fixed-variant: null,
96
+ on-secondary-container: null,
97
+ on-secondary-fixed: null,
98
+ on-secondary-fixed-variant: null,
99
+ on-tertiary: null,
100
+ on-tertiary-container: null,
101
+ on-tertiary-fixed: null,
102
+ on-tertiary-fixed-variant: null,
103
+ primary-container: null,
104
+ primary-fixed: null,
105
+ primary-fixed-dim: null,
106
+ scrim: null,
107
+ secondary-container: null,
108
+ secondary-fixed: null,
109
+ secondary-fixed-dim: null,
110
+ surface-bright: null,
111
+ surface-container: null,
112
+ surface-container-high: null,
113
+ surface-container-highest: null,
114
+ surface-container-low: null,
115
+ surface-container-lowest: null,
116
+ surface-dim: null,
117
+ surface-tint: null,
118
+ tertiary: null,
119
+ tertiary-container: null,
120
+ tertiary-fixed: null,
121
+ tertiary-fixed-dim: null,
122
+ );
123
+ }
@@ -0,0 +1,16 @@
1
+ //
2
+ // Design system display name: Material 3
3
+ // Design system version: v0.161
4
+ //
5
+
6
+ @function md-sys-elevation-values() {
7
+ @return (
8
+ // TBD
9
+ level0: null,
10
+ level1: null,
11
+ level2: null,
12
+ level3: null,
13
+ level4: null,
14
+ level5: null,
15
+ );
16
+ }
@@ -0,0 +1,36 @@
1
+ //
2
+ // Design system display name: Material 3
3
+ // Design system version: v0.161
4
+ //
5
+
6
+ @function md-sys-motion-values() {
7
+ @return (
8
+ // TBD
9
+ duration-extra-long1: null,
10
+ duration-extra-long2: null,
11
+ duration-extra-long3: null,
12
+ duration-extra-long4: null,
13
+ duration-long1: null,
14
+ duration-long2: null,
15
+ duration-long3: null,
16
+ duration-long4: null,
17
+ duration-medium1: null,
18
+ duration-medium2: null,
19
+ duration-medium3: null,
20
+ duration-medium4: null,
21
+ duration-short1: null,
22
+ duration-short2: null,
23
+ duration-short3: null,
24
+ duration-short4: null,
25
+ easing-emphasized: null,
26
+ easing-emphasized-accelerate: null,
27
+ easing-emphasized-decelerate: null,
28
+ easing-legacy: null,
29
+ easing-legacy-accelerate: null,
30
+ easing-legacy-decelerate: null,
31
+ easing-linear: null,
32
+ easing-standard: null,
33
+ easing-standard-accelerate: null,
34
+ easing-standard-decelerate: null,
35
+ );
36
+ }
@@ -0,0 +1,22 @@
1
+ //
2
+ // Design system display name: Material 3
3
+ // Design system version: v0.161
4
+ //
5
+
6
+ @function md-sys-shape-values() {
7
+ @return (
8
+ // TBD
9
+ corner-extra-large: null,
10
+ corner-extra-large-top: null,
11
+ corner-extra-small: null,
12
+ corner-extra-small-top: null,
13
+ corner-full: null,
14
+ corner-large: null,
15
+ corner-large-end: null,
16
+ corner-large-start: null,
17
+ corner-large-top: null,
18
+ corner-medium: null,
19
+ corner-none: null,
20
+ corner-small: null,
21
+ );
22
+ }
@@ -0,0 +1,15 @@
1
+ //
2
+ // Design system display name: Material 3
3
+ // Design system version: v0.161
4
+ //
5
+
6
+ @function md-sys-state-values($exclude-hardcoded-values: false) {
7
+ @return (
8
+ focus-state-layer-opacity: 0.12,
9
+ hover-state-layer-opacity: 0.04,
10
+ pressed-state-layer-opacity: 0.12,
11
+
12
+ // TBD
13
+ dragged-state-layer-opacity: 0.16,
14
+ );
15
+ }
@@ -0,0 +1,68 @@
1
+ @use 'sass:map';
2
+ @use 'sass:string';
3
+ @use 'sass:meta';
4
+
5
+ @function md-sys-typescale-values($config) {
6
+ // Mapping is according to the old 2014 version of the typography spec.
7
+ $sys-to-config: (
8
+ body-large: subheading-1,
9
+ body-medium: body-1,
10
+ body-small: caption,
11
+ display-large: display-4,
12
+ display-medium: display-4,
13
+ display-small: display-4,
14
+ headline-large: display-3,
15
+ headline-medium: display-2,
16
+ headline-small: display-1,
17
+ label-large: subheading-2,
18
+ label-medium: body-2,
19
+ label-small: button,
20
+ title-large: headline,
21
+ title-medium: headline,
22
+ title-small: title,
23
+ );
24
+
25
+ // If the config is based on the updated 2018 version of the typography spec, then
26
+ // use the correct config keys mapping.
27
+ @if (map.get($config, headline-1) != null) {
28
+ $sys-to-config: (
29
+ body-large: body-1,
30
+ body-medium: body-2,
31
+ body-small: caption,
32
+ label-large: subtitle-1,
33
+ label-medium: subtitle-2,
34
+ label-small: button,
35
+ display-large: headline-1,
36
+ display-medium: headline-1,
37
+ display-small: headline-1,
38
+ headline-large: headline-2,
39
+ headline-medium: headline-3,
40
+ headline-small: headline-4,
41
+ title-large: headline-5,
42
+ title-medium: headline-5,
43
+ title-small: headline-6,
44
+ );
45
+ }
46
+
47
+ $typography: ();
48
+ @each $sys-key, $config-key in $sys-to-config {
49
+ $font: map.get($config, $config-key, font-family);
50
+ @if (meta.type-of($font) == 'string') {
51
+ $font: string.unquote($font);
52
+ }
53
+ $line-height: map.get($config, $config-key, line-height);
54
+ $size: map.get($config, $config-key, font-size);
55
+ $tracking: map.get($config, $config-key, letter-spacing);
56
+ $weight: map.get($config, $config-key, font-weight);
57
+ $typography: map.merge($typography, (
58
+ #{$sys-key}: $weight $size #{'/'} $line-height $font,
59
+ #{$sys-key}-font: $font,
60
+ #{$sys-key}-line-height: $line-height,
61
+ #{$sys-key}-size: $size,
62
+ #{$sys-key}-tracking: $tracking,
63
+ #{$sys-key}-weight: $weight,
64
+ ));
65
+ }
66
+
67
+ @return $typography;
68
+ }
@@ -8,7 +8,7 @@
8
8
  // Indicates whether alternative tokens should be used
9
9
  $_alternate-tokens: false;
10
10
 
11
- @function md-sys-color-values-dark($palettes) {
11
+ @function md-sys-color-values-dark($palettes: ()) {
12
12
  $values: (
13
13
  background: map.get($palettes, neutral, 6),
14
14
  error: map.get($palettes, error, 80),
@@ -80,7 +80,7 @@ $_alternate-tokens: false;
80
80
  @return $values;
81
81
  }
82
82
 
83
- @function md-sys-color-values-light($palettes) {
83
+ @function md-sys-color-values-light($palettes: ()) {
84
84
  $values: (
85
85
  background: map.get($palettes, neutral, 98),
86
86
  error: map.get($palettes, error, 40),
@@ -8,7 +8,7 @@
8
8
  // Indicates whether alternative tokens should be used
9
9
  $_alternate-tokens: false;
10
10
 
11
- @function md-sys-typescale-values($typography) {
11
+ @function md-sys-typescale-values($typography: ()) {
12
12
  $plain: map.get($typography, plain);
13
13
  $brand: map.get($typography, brand);
14
14
  $bold: map.get($typography, bold);
@@ -1,4 +1,3 @@
1
- @use '../../theming/palettes';
2
1
  @use './md-sys-color';
3
2
  @use './md-sys-elevation';
4
3
  @use './md-sys-shape';
@@ -17,31 +16,20 @@
17
16
  @return $new-map;
18
17
  }
19
18
 
20
- /// Map key used to store internals of theme config.
21
- $internals: _mat-theming-internals-do-not-access;
22
-
23
- $placeholder-palettes: md-sys-color.md-sys-color-values-light(palettes.$blue-palette);
24
- $placeholder-palettes: map.set($placeholder-palettes, primary, palettes.$blue-palette);
25
- $app-vars: (
26
- 'md-sys-color': _create-system-app-vars-map(
27
- md-sys-color.md-sys-color-values-light($placeholder-palettes)),
28
- 'md-sys-typescale': _create-system-app-vars-map(md-sys-typescale.md-sys-typescale-values((
29
- brand: (Roboto),
30
- plain: (Roboto),
31
- bold: 700,
32
- medium: 500,
33
- regular: 400
34
- ))),
35
- 'md-sys-elevation': _create-system-app-vars-map(md-sys-elevation.md-sys-elevation-values()),
36
- 'md-sys-state': _create-system-app-vars-map(md-sys-state.md-sys-state-values()),
37
- 'md-sys-shape': _create-system-app-vars-map(md-sys-shape.md-sys-shape-values()),
38
- // Add a subset of palette-specific colors used by components instead of system values
39
- 'md-ref-palette': _create-system-app-vars-map(
40
- (
41
- neutral10: '', // Form field native select option text color
42
- neutral-variant20: '', // Sidenav scrim (container background shadow when opened),
43
- )
19
+ $_sys-maps: (
20
+ md-sys-color.md-sys-color-values-light(),
21
+ md-sys-typescale.md-sys-typescale-values(),
22
+ md-sys-elevation.md-sys-elevation-values(),
23
+ md-sys-state.md-sys-state-values(),
24
+ md-sys-shape.md-sys-shape-values(),
25
+ (
26
+ neutral10: '', // Form field native select option text color
27
+ neutral-variant20: '', // Sidenav scrim (container background shadow when opened),
44
28
  ),
45
29
  );
46
30
 
47
- $sys-theme: ($internals: $app-vars);
31
+ $_system: (density-scale: 0);
32
+ @each $sys-map in $_sys-maps {
33
+ $_system: map.merge($_system, _create-system-app-vars-map($sys-map));
34
+ }
35
+ $sys-theme: (_mat-system: $_system);
@@ -2,10 +2,8 @@
2
2
  @use 'sass:map';
3
3
  @use './m2-datepicker';
4
4
  @use './m3-datepicker';
5
- @use '../core/theming/theming';
6
5
  @use '../core/theming/inspection';
7
6
  @use '../core/tokens/token-utils';
8
- @use '../core/style/sass-utils';
9
7
  @use '../core/typography/typography';
10
8
  @use '../button/icon-button-theme';
11
9
 
@@ -13,37 +11,35 @@
13
11
  /// for the mat-datepicker.
14
12
  /// @param {Map} $theme The theme to generate base styles for.
15
13
  @mixin base($theme) {
14
+ $tokens: map.get(m2-datepicker.get-tokens($theme), base);
16
15
  @if inspection.get-theme-version($theme) == 1 {
17
- @include token-utils.create-token-values(map.get(m3-datepicker.get-tokens($theme), base));
18
- } @else {
19
- @include sass-utils.current-selector-or-root() {
20
- @include token-utils.create-token-values-mixed(m2-datepicker.get-unthemable-tokens());
21
- }
16
+ $tokens: map.get(m3-datepicker.get-tokens($theme), base);
22
17
  }
18
+
19
+ @include token-utils.values($tokens);
23
20
  }
24
21
 
25
22
  /// Outputs color theme styles for the mat-datepicker.
26
23
  /// @param {Map} $theme The theme to generate color styles for.
27
24
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
28
25
  @mixin color($theme, $color-variant: null) {
26
+ $tokens: map.get(m2-datepicker.get-tokens($theme), color);
29
27
  @if inspection.get-theme-version($theme) == 1 {
30
- @include token-utils.create-token-values(
31
- map.get(m3-datepicker.get-tokens($theme, $color-variant), color));
32
- } @else {
33
- @include sass-utils.current-selector-or-root() {
34
- @include token-utils.create-token-values-mixed(
35
- m2-datepicker.get-color-tokens($theme, primary));
36
- }
28
+ $tokens: map.get(m3-datepicker.get-tokens($theme, $color-variant), color);
29
+ }
37
30
 
31
+ @include token-utils.values($tokens);
32
+
33
+ @if inspection.get-theme-version($theme) != 1 {
38
34
  .mat-datepicker-content, .mat-datepicker-toggle-active {
39
35
  &.mat-accent {
40
- @include token-utils.create-token-values-mixed(
41
- m2-datepicker.get-color-tokens($theme, secondary));
36
+ $tokens: m2-datepicker.private-get-color-palette-color-tokens($theme, secondary);
37
+ @include token-utils.values($tokens);
42
38
  }
43
39
 
44
40
  &.mat-warn {
45
- @include token-utils.create-token-values-mixed(
46
- m2-datepicker.get-color-tokens($theme, error));
41
+ $tokens: m2-datepicker.private-get-color-palette-color-tokens($theme, error);
42
+ @include token-utils.values($tokens);
47
43
  }
48
44
  }
49
45
  }
@@ -52,13 +48,12 @@
52
48
  /// Outputs typography theme styles for the mat-datepicker.
53
49
  /// @param {Map} $theme The theme to generate typography styles for.
54
50
  @mixin typography($theme) {
51
+ $tokens: map.get(m2-datepicker.get-tokens($theme), typography);
55
52
  @if inspection.get-theme-version($theme) == 1 {
56
- @include token-utils.create-token-values(map.get(m3-datepicker.get-tokens($theme), typography));
57
- } @else {
58
- @include sass-utils.current-selector-or-root() {
59
- @include token-utils.create-token-values-mixed(m2-datepicker.get-typography-tokens($theme));
60
- }
53
+ $tokens: map.get(m3-datepicker.get-tokens($theme), typography);
61
54
  }
55
+
56
+ @include token-utils.values($tokens);
62
57
  }
63
58
 
64
59
  @mixin date-range-colors(
@@ -78,9 +73,14 @@
78
73
  /// Outputs density theme styles for the mat-datepicker.
79
74
  /// @param {Map} $theme The theme to generate density styles for.
80
75
  @mixin density($theme) {
76
+ $tokens: map.get(m2-datepicker.get-tokens($theme), density);
81
77
  @if inspection.get-theme-version($theme) == 1 {
82
- @include token-utils.create-token-values(map.get(m3-datepicker.get-tokens($theme), density));
83
- } @else {
78
+ $tokens: map.get(m3-datepicker.get-tokens($theme), density);
79
+ }
80
+
81
+ @include token-utils.values($tokens);
82
+
83
+ @if inspection.get-theme-version($theme) != 1 {
84
84
  // TODO(crisbeto): move this into the structural styles
85
85
  // once the icon button density is switched to tokens.
86
86
 
@@ -112,23 +112,21 @@
112
112
  /// @param {Map} $theme The theme to generate styles for.
113
113
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
114
114
  @mixin theme($theme, $color-variant: null) {
115
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-datepicker') {
116
- @if inspection.get-theme-version($theme) == 1 {
117
- @include base($theme);
118
- @include color($theme, $color-variant);
115
+ @if inspection.get-theme-version($theme) == 1 {
116
+ @include base($theme);
117
+ @include color($theme, $color-variant);
118
+ @include density($theme);
119
+ @include typography($theme);
120
+ } @else {
121
+ @include base($theme);
122
+ @if inspection.theme-has($theme, color) {
123
+ @include color($theme);
124
+ }
125
+ @if inspection.theme-has($theme, density) {
119
126
  @include density($theme);
127
+ }
128
+ @if inspection.theme-has($theme, typography) {
120
129
  @include typography($theme);
121
- } @else {
122
- @include base($theme);
123
- @if inspection.theme-has($theme, color) {
124
- @include color($theme);
125
- }
126
- @if inspection.theme-has($theme, density) {
127
- @include density($theme);
128
- }
129
- @if inspection.theme-has($theme, typography) {
130
- @include typography($theme);
131
- }
132
130
  }
133
131
  }
134
132
  }
@@ -1,23 +1,40 @@
1
1
  @use 'sass:color';
2
- @use '../core/theming/inspection';
3
2
  @use '../core/style/elevation';
4
3
  @use '../core/tokens/m3-utils';
5
4
  @use '../core/tokens/m2-utils';
6
5
  @use 'sass:map';
7
6
 
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() {
7
+ @function get-tokens($theme) {
8
+ $system: m2-utils.get-system($theme);
9
+
11
10
  @return (
12
- datepicker-calendar-container-shape: 4px,
13
- datepicker-calendar-container-touch-shape: 4px,
14
- datepicker-calendar-container-elevation-shadow: elevation.get-box-shadow(4),
15
- datepicker-calendar-container-touch-elevation-shadow: elevation.get-box-shadow(24),
11
+ base: (
12
+ datepicker-calendar-container-shape: 4px,
13
+ datepicker-calendar-container-touch-shape: 4px,
14
+ datepicker-calendar-container-elevation-shadow: elevation.get-box-shadow(4),
15
+ datepicker-calendar-container-touch-elevation-shadow: elevation.get-box-shadow(24),
16
+ ),
17
+ color: private-get-color-palette-color-tokens($theme, primary),
18
+ typography: (
19
+ // TODO(crisbeto): the typography tokens for other components set every typography dimension
20
+ // of an element (e.g. size, weight, line height, letter spacing). These tokens only set the
21
+ // values that were set in the previous theming API to reduce the amount of subtle screenshot
22
+ // differences. We should look into introducing the other tokens in a follow-up.
23
+ datepicker-calendar-text-font: map.get($system, body-large-font),
24
+ datepicker-calendar-text-size: 13px,
25
+ datepicker-calendar-body-label-text-size: map.get($system, label-small-size),
26
+ datepicker-calendar-body-label-text-weight: map.get($system, label-small-weight),
27
+ datepicker-calendar-period-button-text-size: map.get($system, label-small-size),
28
+ datepicker-calendar-period-button-text-weight: map.get($system, label-small-weight),
29
+ datepicker-calendar-header-text-size: 11px,
30
+ datepicker-calendar-header-text-weight: map.get($system, body-large-weight),
31
+ ),
32
+ density: (),
16
33
  );
17
34
  }
18
35
 
19
36
  // Tokens that can be configured through Angular Material's color theming API.
20
- @function get-color-tokens($theme, $color-variant) {
37
+ @function private-get-color-palette-color-tokens($theme, $color-variant) {
21
38
  $system: m2-utils.get-system($theme);
22
39
  $system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
23
40
  $disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
@@ -62,34 +79,3 @@
62
79
  datepicker-calendar-container-text-color: map.get($system, on-surface),
63
80
  );
64
81
  }
65
-
66
- // Tokens that can be configured through Angular Material's typography theming API.
67
- @function get-typography-tokens($theme) {
68
- @return (
69
- // TODO(crisbeto): the typography tokens for other components set every typography dimension of
70
- // an element (e.g. size, weight, line height, letter spacing). These tokens only set the values
71
- // that were set in the previous theming API to reduce the amount of subtle screenshot
72
- // differences. We should look into introducing the other tokens in a follow-up.
73
- datepicker-calendar-text-font: inspection.get-theme-typography($theme, body-1, font-family),
74
- datepicker-calendar-text-size: 13px,
75
-
76
- datepicker-calendar-body-label-text-size:
77
- inspection.get-theme-typography($theme, button, font-size),
78
- datepicker-calendar-body-label-text-weight:
79
- inspection.get-theme-typography($theme, button, font-weight),
80
-
81
- datepicker-calendar-period-button-text-size:
82
- inspection.get-theme-typography($theme, button, font-size),
83
- datepicker-calendar-period-button-text-weight:
84
- inspection.get-theme-typography($theme, button, font-weight),
85
-
86
- datepicker-calendar-header-text-size: 11px,
87
- datepicker-calendar-header-text-weight:
88
- inspection.get-theme-typography($theme, body-1, font-weight),
89
- );
90
- }
91
-
92
- // Tokens that can be configured through Angular Material's density theming API.
93
- @function get-density-tokens($theme) {
94
- @return ();
95
- }