@angular/material 20.0.0-rc.0 → 20.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.
Files changed (153) hide show
  1. package/badge/_badge-theme.scss +27 -14
  2. package/badge/_m3-badge.scss +39 -67
  3. package/button-toggle/_m3-button-toggle.scss +1 -1
  4. package/core/color/_all-color.scss +1 -1
  5. package/core/theming/_all-theme.scss +41 -0
  6. package/core/theming/_color-api-backwards-compatibility.scss +3 -6
  7. package/core/theming/_definition.scss +72 -72
  8. package/core/theming/_inspection.scss +24 -22
  9. package/core/tokens/_m3-system.scss +112 -69
  10. package/core/tokens/_m3-tokens.scss +30 -226
  11. package/core/tokens/_m3-utils.scss +35 -0
  12. package/core/tokens/_token-utils.scss +22 -1
  13. package/core/tokens/m3/_index.scss +6 -8
  14. package/core/tokens/m3/_md-sys-color.scss +125 -137
  15. package/core/tokens/m3/_md-sys-elevation.scss +7 -7
  16. package/core/tokens/m3/_md-sys-motion.scss +27 -38
  17. package/core/tokens/m3/_md-sys-shape.scss +13 -16
  18. package/core/tokens/m3/_md-sys-state.scss +5 -5
  19. package/core/tokens/m3/_md-sys-typescale.scss +107 -306
  20. package/fesm2022/autocomplete.mjs +23 -23
  21. package/fesm2022/autocomplete.mjs.map +1 -1
  22. package/fesm2022/badge.mjs +11 -11
  23. package/fesm2022/badge.mjs.map +1 -1
  24. package/fesm2022/bottom-sheet.mjs +11 -11
  25. package/fesm2022/bottom-sheet.mjs.map +1 -1
  26. package/fesm2022/button-toggle.mjs +16 -16
  27. package/fesm2022/button-toggle.mjs.map +1 -1
  28. package/fesm2022/button.mjs +21 -21
  29. package/fesm2022/button.mjs.map +1 -1
  30. package/fesm2022/card.mjs +47 -47
  31. package/fesm2022/card.mjs.map +1 -1
  32. package/fesm2022/checkbox.mjs +11 -11
  33. package/fesm2022/checkbox.mjs.map +1 -1
  34. package/fesm2022/chips.mjs +47 -47
  35. package/fesm2022/chips.mjs.map +1 -1
  36. package/fesm2022/{common-module-DZl8g1kc.mjs → common-module-CF0eSYO4.mjs} +5 -5
  37. package/fesm2022/{common-module-DZl8g1kc.mjs.map → common-module-CF0eSYO4.mjs.map} +1 -1
  38. package/fesm2022/core.mjs +24 -24
  39. package/fesm2022/core.mjs.map +1 -1
  40. package/fesm2022/datepicker.mjs +90 -90
  41. package/fesm2022/datepicker.mjs.map +1 -1
  42. package/fesm2022/dialog/testing.mjs +2 -2
  43. package/fesm2022/dialog.mjs +2 -2
  44. package/fesm2022/divider.mjs +8 -8
  45. package/fesm2022/divider.mjs.map +1 -1
  46. package/fesm2022/{error-options-BWOa3B4G.mjs → error-options-CbAHLQL5.mjs} +7 -7
  47. package/fesm2022/{error-options-BWOa3B4G.mjs.map → error-options-CbAHLQL5.mjs.map} +1 -1
  48. package/fesm2022/expansion.mjs +27 -27
  49. package/fesm2022/expansion.mjs.map +1 -1
  50. package/fesm2022/{form-field-B3aq6ikj.mjs → form-field-sL9_TuE-.mjs} +68 -60
  51. package/fesm2022/form-field-sL9_TuE-.mjs.map +1 -0
  52. package/fesm2022/form-field.mjs +3 -3
  53. package/fesm2022/grid-list.mjs +24 -24
  54. package/fesm2022/grid-list.mjs.map +1 -1
  55. package/fesm2022/icon/testing.mjs +8 -8
  56. package/fesm2022/icon/testing.mjs.map +1 -1
  57. package/fesm2022/{icon-button-DH8TBWWr.mjs → icon-button-BASP1JI8.mjs} +10 -10
  58. package/fesm2022/{icon-button-DH8TBWWr.mjs.map → icon-button-BASP1JI8.mjs.map} +1 -1
  59. package/fesm2022/{icon-registry-Bk5cM8Z5.mjs → icon-registry-DVLYRZv3.mjs} +4 -4
  60. package/fesm2022/{icon-registry-Bk5cM8Z5.mjs.map → icon-registry-DVLYRZv3.mjs.map} +1 -1
  61. package/fesm2022/icon.mjs +10 -10
  62. package/fesm2022/icon.mjs.map +1 -1
  63. package/fesm2022/index-BNtCg9r0.mjs +22 -0
  64. package/fesm2022/{index-BHJ4tVIe.mjs.map → index-BNtCg9r0.mjs.map} +1 -1
  65. package/fesm2022/index-DxCSjCL3.mjs +20 -0
  66. package/fesm2022/{index-D2rZ0V78.mjs.map → index-DxCSjCL3.mjs.map} +1 -1
  67. package/fesm2022/input.mjs +12 -12
  68. package/fesm2022/input.mjs.map +1 -1
  69. package/fesm2022/{internal-form-field-DVvKYBKJ.mjs → internal-form-field-_OHaksOO.mjs} +4 -4
  70. package/fesm2022/{internal-form-field-DVvKYBKJ.mjs.map → internal-form-field-_OHaksOO.mjs.map} +1 -1
  71. package/fesm2022/{line-Dwrcg_t9.mjs → line-CtAKiRo6.mjs} +9 -9
  72. package/fesm2022/{line-Dwrcg_t9.mjs.map → line-CtAKiRo6.mjs.map} +1 -1
  73. package/fesm2022/list.mjs +55 -55
  74. package/fesm2022/list.mjs.map +1 -1
  75. package/fesm2022/menu.mjs +20 -20
  76. package/fesm2022/menu.mjs.map +1 -1
  77. package/fesm2022/{module-B-ci3hbc.mjs → module-ChwDH6BC.mjs} +27 -27
  78. package/fesm2022/{module-B-ci3hbc.mjs.map → module-ChwDH6BC.mjs.map} +1 -1
  79. package/fesm2022/{module-hX_hFZhs.mjs → module-DToxyW7l.mjs} +7 -7
  80. package/fesm2022/{module-hX_hFZhs.mjs.map → module-DToxyW7l.mjs.map} +1 -1
  81. package/fesm2022/{module-D9IKGg_w.mjs → module-DqTK2swA.mjs} +17 -17
  82. package/fesm2022/{module-D9IKGg_w.mjs.map → module-DqTK2swA.mjs.map} +1 -1
  83. package/fesm2022/{module-X29xYsIk.mjs → module-m5vWw9-5.mjs} +12 -12
  84. package/fesm2022/{module-X29xYsIk.mjs.map → module-m5vWw9-5.mjs.map} +1 -1
  85. package/fesm2022/{option-MOeehkAg.mjs → option-hkPAbXDN.mjs} +10 -10
  86. package/fesm2022/{option-MOeehkAg.mjs.map → option-hkPAbXDN.mjs.map} +1 -1
  87. package/fesm2022/paginator.mjs +25 -25
  88. package/fesm2022/paginator.mjs.map +1 -1
  89. package/fesm2022/progress-bar.mjs +8 -8
  90. package/fesm2022/progress-bar.mjs.map +1 -1
  91. package/fesm2022/progress-spinner.mjs +8 -8
  92. package/fesm2022/progress-spinner.mjs.map +1 -1
  93. package/fesm2022/{pseudo-checkbox-BFGIaGxz.mjs → pseudo-checkbox-Ddidc23S.mjs} +4 -4
  94. package/fesm2022/{pseudo-checkbox-BFGIaGxz.mjs.map → pseudo-checkbox-Ddidc23S.mjs.map} +1 -1
  95. package/fesm2022/pseudo-checkbox-module--am9-RIA.mjs +20 -0
  96. package/fesm2022/{pseudo-checkbox-module-Dxth-mPi.mjs.map → pseudo-checkbox-module--am9-RIA.mjs.map} +1 -1
  97. package/fesm2022/radio.mjs +15 -15
  98. package/fesm2022/radio.mjs.map +1 -1
  99. package/fesm2022/{ripple-CuyVtN3V.mjs → ripple-DUGA2BAa.mjs} +7 -7
  100. package/fesm2022/{ripple-CuyVtN3V.mjs.map → ripple-DUGA2BAa.mjs.map} +1 -1
  101. package/fesm2022/{ripple-loader-pOctSZby.mjs → ripple-loader-Xy4bv6Xh.mjs} +5 -5
  102. package/fesm2022/{ripple-loader-pOctSZby.mjs.map → ripple-loader-Xy4bv6Xh.mjs.map} +1 -1
  103. package/fesm2022/select.mjs +12 -12
  104. package/fesm2022/sidenav.mjs +23 -23
  105. package/fesm2022/sidenav.mjs.map +1 -1
  106. package/fesm2022/slide-toggle.mjs +11 -11
  107. package/fesm2022/slide-toggle.mjs.map +1 -1
  108. package/fesm2022/slider.mjs +20 -20
  109. package/fesm2022/slider.mjs.map +1 -1
  110. package/fesm2022/snack-bar.mjs +28 -28
  111. package/fesm2022/snack-bar.mjs.map +1 -1
  112. package/fesm2022/sort.mjs +15 -15
  113. package/fesm2022/sort.mjs.map +1 -1
  114. package/fesm2022/stepper.mjs +37 -37
  115. package/fesm2022/stepper.mjs.map +1 -1
  116. package/fesm2022/{structural-styles-CasigI3l.mjs → structural-styles-DA18Hchc.mjs} +4 -4
  117. package/fesm2022/{structural-styles-CasigI3l.mjs.map → structural-styles-DA18Hchc.mjs.map} +1 -1
  118. package/fesm2022/table.mjs +56 -56
  119. package/fesm2022/table.mjs.map +1 -1
  120. package/fesm2022/tabs.mjs +46 -46
  121. package/fesm2022/tabs.mjs.map +1 -1
  122. package/fesm2022/timepicker.mjs +20 -20
  123. package/fesm2022/timepicker.mjs.map +1 -1
  124. package/fesm2022/toolbar.mjs +11 -11
  125. package/fesm2022/toolbar.mjs.map +1 -1
  126. package/fesm2022/tooltip.mjs +2 -2
  127. package/fesm2022/tree.mjs +26 -26
  128. package/fesm2022/tree.mjs.map +1 -1
  129. package/form-field/index.d.ts +2 -2
  130. package/{form-field.d-CIxjiZIX.d.ts → form-field.d-C6p5uYjG.d.ts} +4 -2
  131. package/input/index.d.ts +4 -4
  132. package/{module.d-CDrqNC7Q.d.ts → module.d-D1Ym5Wf2.d.ts} +1 -1
  133. package/{module.d-DZ8DPHcV.d.ts → module.d-DMabQ4_c.d.ts} +2 -2
  134. package/package.json +2 -2
  135. package/paginator/index.d.ts +5 -5
  136. package/{paginator.d-Ci_wE-RV.d.ts → paginator.d-DuJ-oYgT.d.ts} +1 -1
  137. package/prebuilt-themes/azure-blue.css +1 -1
  138. package/prebuilt-themes/cyan-orange.css +1 -1
  139. package/prebuilt-themes/magenta-violet.css +1 -1
  140. package/prebuilt-themes/rose-red.css +1 -1
  141. package/schematics/ng-add/index.js +1 -1
  142. package/schematics/ng-generate/theme-color/index_bundled.js +2 -2
  143. package/schematics/ng-generate/theme-color/index_bundled.js.map +1 -1
  144. package/schematics/ng-update/index_bundled.js +54 -2
  145. package/schematics/ng-update/index_bundled.js.map +1 -1
  146. package/select/index.d.ts +3 -3
  147. package/table/index.d.ts +2 -2
  148. package/core/tokens/m3/_md-ref-palette.scss +0 -100
  149. package/core/tokens/m3/_md-ref-typeface.scss +0 -14
  150. package/fesm2022/form-field-B3aq6ikj.mjs.map +0 -1
  151. package/fesm2022/index-BHJ4tVIe.mjs +0 -22
  152. package/fesm2022/index-D2rZ0V78.mjs +0 -20
  153. package/fesm2022/pseudo-checkbox-module-Dxth-mPi.mjs +0 -20
@@ -1,18 +1,22 @@
1
- @use 'sass:color';
2
- @use '../core/theming/theming';
1
+ @use '../core/style/sass-utils';
3
2
  @use '../core/theming/inspection';
3
+ @use '../core/theming/theming';
4
4
  @use '../core/theming/validation';
5
+ @use '../core/tokens/token-utils';
5
6
  @use '../core/typography/typography';
6
7
  @use './m2-badge';
7
- @use '../core/tokens/token-utils';
8
- @use '../core/style/sass-utils';
8
+ @use './m3-badge';
9
+ @use 'sass:color';
10
+ @use 'sass:map';
9
11
 
10
12
  /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
11
13
  /// for the mat-badge.
12
14
  /// @param {Map} $theme The theme to generate base styles for.
13
15
  @mixin base($theme) {
14
16
  @if inspection.get-theme-version($theme) == 1 {
15
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
17
+ @include token-utils.create-token-values(
18
+ m3-badge.$prefix,
19
+ map.get(m3-badge.get-tokens($theme), base));
16
20
  } @else {
17
21
  @include sass-utils.current-selector-or-root() {
18
22
  @include token-utils.create-token-values-mixed(
@@ -25,12 +29,14 @@
25
29
 
26
30
  /// Outputs color theme styles for the mat-badge.
27
31
  /// @param {Map} $theme The theme to generate color styles for.
28
- /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
29
- /// $color-variant: The color variant to use for the badge: primary, secondary, tertiary,
30
- /// or error (If not specified, default error color will be used).
31
- @mixin color($theme, $options...) {
32
+ /// @param {String} $color-variant The color variant to use for
33
+ /// the badge: primary, secondary, tertiary, or error (If not specified,
34
+ /// default error color will be used).
35
+ @mixin color($theme, $color-variant: null) {
32
36
  @if inspection.get-theme-version($theme) == 1 {
33
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
37
+ @include token-utils.create-token-values(
38
+ m3-badge.$prefix,
39
+ map.get(m3-badge.get-tokens($theme, $color-variant), color));
34
40
  } @else {
35
41
  @include sass-utils.current-selector-or-root() {
36
42
  @include token-utils.create-token-values-mixed(
@@ -59,7 +65,9 @@
59
65
  /// @param {Map} $theme The theme to generate typography styles for.
60
66
  @mixin typography($theme) {
61
67
  @if inspection.get-theme-version($theme) == 1 {
62
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
68
+ @include token-utils.create-token-values(
69
+ m3-badge.$prefix,
70
+ map.get(m3-badge.get-tokens($theme), typography));
63
71
  } @else {
64
72
  @include sass-utils.current-selector-or-root() {
65
73
  @include token-utils.create-token-values-mixed(
@@ -74,7 +82,9 @@
74
82
  /// @param {Map} $theme The theme to generate density styles for.
75
83
  @mixin density($theme) {
76
84
  @if inspection.get-theme-version($theme) == 1 {
77
- // There are no M3 density tokens for this component
85
+ @include token-utils.create-token-values(
86
+ m3-badge.$prefix,
87
+ map.get(m3-badge.get-tokens($theme), density));
78
88
  } @else {
79
89
  }
80
90
  }
@@ -100,10 +110,13 @@
100
110
  /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
101
111
  /// $color-variant: The color variant to use for the badge: primary, secondary, tertiary,
102
112
  /// or error (If not specified, default error color will be used).
103
- @mixin theme($theme, $options...) {
113
+ @mixin theme($theme, $color-variant: null) {
104
114
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-badge') {
105
115
  @if inspection.get-theme-version($theme) == 1 {
106
- @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
116
+ @include base($theme);
117
+ @include color($theme, $color-variant);
118
+ @include density($theme);
119
+ @include typography($theme);
107
120
  } @else {
108
121
  @include base($theme);
109
122
  @if inspection.theme-has($theme, color) {
@@ -1,81 +1,53 @@
1
1
  @use 'sass:map';
2
- @use '../core/style/sass-utils';
3
2
  @use '../core/tokens/m3-utils';
4
3
 
5
4
  // The prefix used to generate the fully qualified name for tokens in this file.
6
5
  $prefix: (mat, badge);
7
6
 
8
7
  /// Generates custom tokens for the mat-badge.
9
- /// @param {Map} $systems The MDC system tokens
10
- /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
11
- /// @param {Map} $token-slots Possible token slots
12
- /// @return {Map} A set of custom tokens for the mat-badge
13
- @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
14
- $tokens: (
15
- background-color: map.get($systems, md-sys-color, error),
16
- text-color: map.get($systems, md-sys-color, on-error),
17
- disabled-state-background-color: sass-utils.safe-color-change(
18
- map.get($systems, md-sys-color, error),
19
- $alpha: 0.38),
20
- disabled-state-text-color: map.get($systems, md-sys-color, on-error),
21
- text-font: map.get($systems, md-sys-typescale, label-small-font),
22
- text-size: map.get($systems, md-sys-typescale, label-small-size),
23
- text-weight: map.get($systems, md-sys-typescale, label-small-weight),
24
- small-size-text-size: m3-utils.hardcode(0, $exclude-hardcoded),
25
- container-shape: map.get($systems, md-sys-shape, corner-full),
26
- container-size: m3-utils.hardcode(16px, $exclude-hardcoded),
27
- line-height: m3-utils.hardcode(16px, $exclude-hardcoded),
28
- legacy-container-size: m3-utils.hardcode(unset, $exclude-hardcoded),
29
- legacy-small-size-container-size: m3-utils.hardcode(unset, $exclude-hardcoded),
30
- small-size-container-size: m3-utils.hardcode(6px, $exclude-hardcoded),
31
- small-size-line-height: m3-utils.hardcode(6px, $exclude-hardcoded),
32
- container-padding: m3-utils.hardcode(0 4px, $exclude-hardcoded),
33
- small-size-container-padding: m3-utils.hardcode(0, $exclude-hardcoded),
34
- container-offset: m3-utils.hardcode(-12px 0, $exclude-hardcoded),
35
- small-size-container-offset: m3-utils.hardcode(-6px 0, $exclude-hardcoded),
36
- container-overlap-offset: m3-utils.hardcode(-12px, $exclude-hardcoded),
37
- small-size-container-overlap-offset: m3-utils.hardcode(-6px, $exclude-hardcoded),
38
-
39
- // This size isn't in the M3 spec so we emit the same values as for `medium`.
40
- large-size-container-size: m3-utils.hardcode(16px, $exclude-hardcoded),
41
- large-size-line-height: m3-utils.hardcode(16px, $exclude-hardcoded),
42
- large-size-container-offset: m3-utils.hardcode(-12px 0, $exclude-hardcoded),
43
- large-size-container-overlap-offset: m3-utils.hardcode(-12px, $exclude-hardcoded),
44
- large-size-text-size: map.get($systems, md-sys-typescale, label-small-size),
45
- large-size-container-padding: m3-utils.hardcode(0 4px, $exclude-hardcoded),
46
- legacy-large-size-container-size: m3-utils.hardcode(unset, $exclude-hardcoded),
47
- );
8
+ @function get-tokens($theme, $color-variant: null) {
9
+ $system: m3-utils.get-system($theme);
10
+ @if $color-variant {
11
+ $system: m3-utils.replace-colors-with-variant($system, error, $color-variant);
12
+ }
48
13
 
49
- $variant-tokens: (
50
- primary: (
51
- background-color: map.get($systems, md-sys-color, primary),
52
- text-color: map.get($systems, md-sys-color, on-primary),
53
- disabled-state-background-color: sass-utils.safe-color-change(
54
- map.get($systems, md-sys-color, primary),
55
- $alpha: 0.38,
56
- ),
57
- disabled-state-text-color: map.get($systems, md-sys-color, on-primary),
14
+ $tokens: (
15
+ base: (
16
+ container-shape: map.get($system, corner-full),
17
+ container-size: 16px,
18
+ legacy-container-size: unset,
19
+ legacy-small-size-container-size: unset,
20
+ small-size-container-size: 6px,
21
+ container-padding: 0 4px,
22
+ small-size-container-padding: 0,
23
+ container-offset: -12px 0,
24
+ small-size-container-offset: -6px 0,
25
+ container-overlap-offset: -12px,
26
+ small-size-container-overlap-offset: -6px,
27
+ large-size-container-size: 16px,
28
+ large-size-container-offset: -12px 0,
29
+ large-size-container-overlap-offset: -12px,
30
+ large-size-container-padding: 0 4px,
31
+ legacy-large-size-container-size: unset,
58
32
  ),
59
- secondary: (
60
- background-color: map.get($systems, md-sys-color, secondary),
61
- text-color: map.get($systems, md-sys-color, on-secondary),
62
- disabled-state-background-color: sass-utils.safe-color-change(
63
- map.get($systems, md-sys-color, secondary),
64
- $alpha: 0.38,
65
- ),
66
- disabled-state-text-color: map.get($systems, md-sys-color, on-secondary),
33
+ color: (
34
+ background-color: map.get($system, error),
35
+ text-color: map.get($system, on-error),
36
+ disabled-state-background-color: m3-utils.color-with-opacity(map.get($system, error), 38%),
37
+ disabled-state-text-color: map.get($system, on-error),
67
38
  ),
68
- tertiary: (
69
- background-color: map.get($systems, md-sys-color, tertiary),
70
- text-color: map.get($systems, md-sys-color, on-tertiary),
71
- disabled-state-background-color: sass-utils.safe-color-change(
72
- map.get($systems, md-sys-color, tertiary),
73
- $alpha: 0.38,
74
- ),
75
- disabled-state-text-color: map.get($systems, md-sys-color, on-tertiary),
39
+ typography: (
40
+ text-font: map.get($system, label-small-font),
41
+ text-size: map.get($system, label-small-size),
42
+ text-weight: map.get($system, label-small-weight),
43
+ large-size-text-size: map.get($system, label-small-size),
44
+ small-size-text-size: 0,
45
+ line-height: 16px,
46
+ small-size-line-height: 6px,
47
+ large-size-line-height: 16px,
76
48
  ),
77
- error: () // Default, no overrides needed
49
+ density: (),
78
50
  );
79
51
 
80
- @return m3-utils.namespace($prefix, ($tokens, $variant-tokens), $token-slots);
52
+ @return $tokens;
81
53
  }
@@ -17,7 +17,7 @@ $prefix: (mat, button-toggle);
17
17
  $tokens: sass-utils.merge-all(
18
18
  m3-utils.generate-typography-tokens($systems, label-text, label-large),
19
19
  (
20
- shape: map.get($systems, md-sys-shape, corner-full),
20
+ shape: map.get($systems, md-sys-shape, corner-extra-large),
21
21
  hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
22
22
  focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
23
23
  text-color: map.get($systems, md-sys-color, on-surface),
@@ -7,7 +7,7 @@
7
7
  @error 'No color configuration specified.';
8
8
  }
9
9
 
10
- @include all-theme.all-component-themes(
10
+ @include all-theme.all-component-colors(
11
11
  inspection.theme-remove($theme, base, typography, density));
12
12
  }
13
13
 
@@ -125,6 +125,47 @@
125
125
  @include timepicker-theme.base($theme);
126
126
  }
127
127
 
128
+ @mixin all-component-colors($theme) {
129
+ @include core-theme.color($theme);
130
+ @include card-theme.color($theme);
131
+ @include progress-bar-theme.color($theme);
132
+ @include tooltip-theme.color($theme);
133
+ @include form-field-theme.color($theme);
134
+ @include input-theme.color($theme);
135
+ @include select-theme.color($theme);
136
+ @include autocomplete-theme.color($theme);
137
+ @include dialog-theme.color($theme);
138
+ @include chips-theme.color($theme);
139
+ @include slide-toggle-theme.color($theme);
140
+ @include radio-theme.color($theme);
141
+ @include slider-theme.color($theme);
142
+ @include menu-theme.color($theme);
143
+ @include list-theme.color($theme);
144
+ @include paginator-theme.color($theme);
145
+ @include tabs-theme.color($theme);
146
+ @include checkbox-theme.color($theme);
147
+ @include button-theme.color($theme);
148
+ @include icon-button-theme.color($theme);
149
+ @include fab-theme.color($theme);
150
+ @include snack-bar-theme.color($theme);
151
+ @include table-theme.color($theme);
152
+ @include progress-spinner-theme.color($theme);
153
+ @include badge-theme.color($theme);
154
+ @include bottom-sheet-theme.color($theme);
155
+ @include button-toggle-theme.color($theme);
156
+ @include datepicker-theme.color($theme);
157
+ @include divider-theme.color($theme);
158
+ @include expansion-theme.color($theme);
159
+ @include grid-list-theme.color($theme);
160
+ @include icon-theme.color($theme);
161
+ @include sidenav-theme.color($theme);
162
+ @include stepper-theme.color($theme);
163
+ @include sort-theme.color($theme);
164
+ @include toolbar-theme.color($theme);
165
+ @include tree-theme.color($theme);
166
+ @include timepicker-theme.color($theme);
167
+ }
168
+
128
169
  // @deprecated Use `all-component-themes`.
129
170
  @mixin angular-material-theme($theme) {
130
171
  @include all-component-themes($theme);
@@ -119,23 +119,20 @@ $_overrides-only: true;
119
119
  @include _color-variant-styles($theme, primary);
120
120
  }
121
121
  .mat-badge {
122
- @include badge-theme.color($theme, $color-variant: primary,
123
- $emit-overrides-only: $_overrides-only);
122
+ @include badge-theme.color($theme, $color-variant: primary);
124
123
  }
125
124
 
126
125
  .mat-accent {
127
126
  @include _color-variant-styles($theme, tertiary);
128
127
  }
129
128
  .mat-badge-accent {
130
- @include badge-theme.color($theme, $color-variant: tertiary,
131
- $emit-overrides-only: $_overrides-only);
129
+ @include badge-theme.color($theme, $color-variant: tertiary);
132
130
  }
133
131
 
134
132
  .mat-warn {
135
133
  @include _color-variant-styles($theme, error);
136
134
  }
137
135
  .mat-badge-warn {
138
- @include badge-theme.color($theme, $color-variant: error,
139
- $emit-overrides-only: $_overrides-only);
136
+ @include badge-theme.color($theme, $color-variant: error);
140
137
  }
141
138
  }
@@ -5,6 +5,7 @@
5
5
  @use './palettes';
6
6
  @use '../tokens/m3-tokens';
7
7
  @use './config-validation';
8
+ @use '../tokens/m3';
8
9
 
9
10
  // Prefix used for component token fallback variables, e.g.
10
11
  // `color: var(--mat-text-button-label-text-color, var(--mat-sys-primary));`
@@ -18,6 +19,7 @@ $system-level-prefix: mat-sys;
18
19
 
19
20
  /// Map key used to store internals of theme config.
20
21
  $internals: _mat-theming-internals-do-not-access;
22
+
21
23
  /// The theme version of generated themes.
22
24
  $theme-version: 1;
23
25
 
@@ -30,97 +32,95 @@ $theme-version: 1;
30
32
  @error $err;
31
33
  }
32
34
 
33
- @return sass-utils.deep-merge-all(
34
- define-colors(map.get($config, color) or ()),
35
- define-typography(map.get($config, typography) or ()),
36
- define-density(map.get($config, density) or ()),
37
- ($internals: (base-tokens: m3-tokens.generate-base-tokens())),
35
+ $color-config: map.get($config, color) or ();
36
+ $typography-config: map.get($config, typography) or ();
37
+ $density-config: map.get($config, density) or ();
38
+
39
+ // colors
40
+ $type: map.get($color-config, theme-type) or light;
41
+ $primary: map.get($color-config, primary) or palettes.$violet-palette;
42
+ $tertiary: map.get($color-config, tertiary) or $primary;
43
+ $color-system-variables-prefix:
44
+ map.get($color-config, system-variables-prefix) or $system-level-prefix;
45
+ sass-utils.$use-system-color-variables: map.get($color-config, use-system-variables) or false;
46
+
47
+ $palettes: (
48
+ primary: map.remove($primary, neutral, neutral-variant, secondary),
49
+ secondary: map.get($primary, secondary),
50
+ tertiary: map.remove($tertiary, neutral, neutral-variant, secondary, error),
51
+ neutral: map.get($primary, neutral),
52
+ neutral-variant: map.get($primary, neutral-variant),
53
+ error: map.get($primary, error),
38
54
  );
39
- }
40
55
 
41
- /// Defines an Angular Material theme object with color settings.
42
- /// @param {Map} $config The color configuration
43
- /// @return {Map} A theme object
44
- @function define-colors($config: ()) {
45
- $err: config-validation.validate-color-config($config);
46
- @if $err {
47
- @error $err;
48
- }
56
+ // typography
57
+ $default-plain: (Roboto, sans-serif);
58
+ $default-brand: $default-plain;
59
+ $plain: map.get($typography-config, plain-family) or $default-plain;
60
+ $brand: map.get($typography-config, brand-family) or $default-brand;
61
+ $bold: map.get($typography-config, bold-weight) or 700;
62
+ $medium: map.get($typography-config, medium-weight) or 500;
63
+ $regular: map.get($typography-config, regular-weight) or 400;
64
+ $typography-system-variables-prefix: map.get($typography-config, system-variables-prefix) or
65
+ $system-level-prefix;
66
+ sass-utils.$use-system-typography-variables:
67
+ map.get($typography-config, use-system-variables) or false;
68
+ $typography: (
69
+ plain: $plain,
70
+ brand: $brand,
71
+ bold: $bold,
72
+ medium: $medium,
73
+ regular: $regular,
74
+ );
49
75
 
50
- $type: map.get($config, theme-type) or light;
51
- $primary: map.get($config, primary) or palettes.$violet-palette;
52
- $tertiary: map.get($config, tertiary) or $primary;
53
- $system-variables-prefix: map.get($config, system-variables-prefix) or $system-level-prefix;
54
- sass-utils.$use-system-color-variables: map.get($config, use-system-variables) or false;
76
+ // density
77
+ $density-scale: map.get($density-config, scale) or 0;
55
78
 
56
79
  @return (
57
80
  $internals: (
58
- theme-version: $theme-version,
81
+ base-tokens: m3-tokens.generate-base-tokens(),
82
+ color-system-variables-prefix: $color-system-variables-prefix,
83
+ color-tokens:
84
+ m3-tokens.generate-color-tokens($type, $palettes, $color-system-variables-prefix),
85
+ density-scale: $density-scale,
86
+ font-definition: $typography,
87
+ md-sys-color: m3-tokens.get-sys-color($type, $palettes, $color-system-variables-prefix),
88
+ md-sys-elevation: m3.md-sys-elevation-values(),
89
+ md-sys-motion: m3.md-sys-motion-values(),
90
+ md-sys-shape: m3.md-sys-shape-values(),
91
+ md-sys-state: m3.md-sys-state-values(),
92
+ md-sys-typescale:
93
+ m3-tokens.get-sys-typeface($typography, $typography-system-variables-prefix),
94
+ palettes: $palettes,
59
95
  theme-type: $type,
60
- palettes: (
61
- primary: map.remove($primary, neutral, neutral-variant, secondary),
62
- secondary: map.get($primary, secondary),
63
- tertiary: map.remove($tertiary, neutral, neutral-variant, secondary),
64
- neutral: map.get($primary, neutral),
65
- neutral-variant: map.get($primary, neutral-variant),
66
- error: map.get($primary, error),
67
- ),
68
- color-system-variables-prefix: $system-variables-prefix,
69
- color-tokens: m3-tokens.generate-color-tokens(
70
- $type, $primary, $tertiary, map.get($primary, error), $system-variables-prefix)
96
+ theme-version: $theme-version,
97
+ typography-system-variables-prefix: $typography-system-variables-prefix,
98
+ typography-tokens:
99
+ m3-tokens.generate-typography-tokens($typography, $typography-system-variables-prefix),
71
100
  )
72
101
  );
73
102
  }
74
103
 
104
+ /// Defines an Angular Material theme object with color settings.
105
+ /// @param {Map} $config The color configuration
106
+ /// @return {Map} A theme object
107
+ /// @deprecated Use define-theme with a map using the "color" key
108
+ @function define-colors($config: ()) {
109
+ @return define-theme((color: $config));
110
+ }
111
+
75
112
  /// Defines an Angular Material theme object with typography settings.
76
113
  /// @param {Map} $config The typography configuration
77
114
  /// @return {Map} A theme object
115
+ /// @deprecated Use define-theme with a map using the "typography" key
78
116
  @function define-typography($config: ()) {
79
- $err: config-validation.validate-typography-config($config);
80
- @if $err {
81
- @error $err;
82
- }
83
-
84
- $plain: map.get($config, plain-family) or (Roboto, sans-serif);
85
- $brand: map.get($config, brand-family) or $plain;
86
- $bold: map.get($config, bold-weight) or 700;
87
- $medium: map.get($config, medium-weight) or 500;
88
- $regular: map.get($config, regular-weight) or 400;
89
- $system-variables-prefix: map.get($config, system-variables-prefix) or $system-level-prefix;
90
- sass-utils.$use-system-typography-variables: map.get($config, use-system-variables) or false;
91
-
92
- @return (
93
- $internals: (
94
- theme-version: $theme-version,
95
- font-definition: (
96
- plain: $plain,
97
- brand: $brand,
98
- bold: $bold,
99
- medium: $medium,
100
- regular: $regular,
101
- ),
102
- typography-system-variables-prefix: $system-variables-prefix,
103
- typography-tokens: m3-tokens.generate-typography-tokens(
104
- $brand, $plain, $bold, $medium, $regular, $system-variables-prefix)
105
- )
106
- );
117
+ @return define-theme((typography: $config));
107
118
  }
108
119
 
109
120
  /// Defines an Angular Material theme object with density settings.
110
121
  /// @param {Map} $config The density configuration
111
122
  /// @return {Map} A theme object
123
+ /// @deprecated Use define-theme with a map using the "density" key
112
124
  @function define-density($config: ()) {
113
- $err: config-validation.validate-density-config($config);
114
- @if $err {
115
- @error $err;
116
- }
117
-
118
- $density-scale: map.get($config, scale) or 0;
119
-
120
- @return (
121
- $internals: (
122
- theme-version: $theme-version,
123
- density-scale: $density-scale,
124
- )
125
- );
125
+ @return define-theme((density: $config));
126
126
  }
@@ -3,7 +3,7 @@
3
3
  @use '../style/validation';
4
4
  @use './m2-inspection';
5
5
 
6
- $_internals: _mat-theming-internals-do-not-access;
6
+ $internals: _mat-theming-internals-do-not-access;
7
7
 
8
8
  $_m3-typescales: (
9
9
  display-large,
@@ -30,7 +30,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
30
30
  /// @return {Boolean|Null} true if the theme has errors, else null.
31
31
  @function _validate-theme-object($theme) {
32
32
  $err: validation.validate-type($theme, 'map') or
33
- map.get($theme, $_internals, theme-version) == null;
33
+ map.get($theme, $internals, theme-version) == null;
34
34
  @return if($err, true, null);
35
35
  }
36
36
 
@@ -40,7 +40,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
40
40
  /// @return {Number} The version number of the theme (0 if unknown).
41
41
  @function get-theme-version($theme) {
42
42
  $err: _validate-theme-object($theme);
43
- @return if($err, 0, map.get($theme, $_internals, theme-version) or 0);
43
+ @return if($err, 0, map.get($theme, $internals, theme-version) or 0);
44
44
  }
45
45
 
46
46
  /// Gets the type of theme represented by a theme object (light or dark).
@@ -55,13 +55,15 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
55
55
  @if not theme-has($theme, color) {
56
56
  @error 'Color information is not available on this theme.';
57
57
  }
58
- @return map.get($theme, $_internals, theme-type) or light;
58
+ @return map.get($theme, $internals, theme-type) or light;
59
59
  }
60
60
  @else {
61
61
  @error #{'Unrecognized theme version:'} $version;
62
62
  }
63
63
  }
64
64
 
65
+
66
+
65
67
  /// Gets a color from a theme object. This function take a different amount of arguments depending
66
68
  /// on if it's working with an M2 or M3 theme:
67
69
  /// - With an M3 theme it accepts either 2 or 3 arguments. If 2 arguments are passed, the second
@@ -119,7 +121,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
119
121
  @if not theme-has($theme, color) {
120
122
  @error 'Color information is not available on this theme.';
121
123
  }
122
- $color-roles: map.get($theme, $_internals, color-tokens, (mat, theme));
124
+ $color-roles: map.get($theme, $internals, color-tokens, (mat, theme));
123
125
  $result: map.get($color-roles, $color-role-name);
124
126
  @if not $result {
125
127
  @error #{'Valid color roles are: #{map.keys($color-roles)}. Got:'} $color-role-name;
@@ -141,7 +143,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
141
143
  @if not theme-has($theme, color) {
142
144
  @error 'Color information is not available on this theme.';
143
145
  }
144
- $palettes: map.get($theme, $_internals, palettes);
146
+ $palettes: map.get($theme, $internals, palettes);
145
147
  $palette: map.get($palettes, $palette-name);
146
148
  @if not $palette {
147
149
  $supported-palettes: map.keys($palettes);
@@ -185,7 +187,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
185
187
  font-weight: '-weight'
186
188
  ), $property);
187
189
  $token-name: '#{$typescale}#{$property-key}';
188
- @return map.get($theme, $_internals, typography-tokens, (mat, typography), $token-name);
190
+ @return map.get($theme, $internals, typography-tokens, (mat, typography), $token-name);
189
191
  }
190
192
  @else {
191
193
  @error #{'Unrecognized theme version:'} $version;
@@ -204,7 +206,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
204
206
  @if not theme-has($theme, density) {
205
207
  @error 'Density information is not available on this theme.';
206
208
  }
207
- @return map.get($theme, $_internals, density-scale);
209
+ @return map.get($theme, $internals, density-scale);
208
210
  }
209
211
  @else {
210
212
  @error #{'Unrecognized theme version:'} $version;
@@ -222,18 +224,18 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
222
224
  }
223
225
  @else if $version == 1 {
224
226
  @if $system == base {
225
- @return map.get($theme, $_internals, base-tokens) != null;
227
+ @return map.get($theme, $internals, base-tokens) != null;
226
228
  }
227
229
  @if $system == color {
228
- @return map.get($theme, $_internals, color-tokens) != null and
229
- map.get($theme, $_internals, theme-type) != null and
230
- map.get($theme, $_internals, palettes) != null;
230
+ @return map.get($theme, $internals, color-tokens) != null and
231
+ map.get($theme, $internals, theme-type) != null and
232
+ map.get($theme, $internals, palettes) != null;
231
233
  }
232
234
  @if $system == typography {
233
- @return map.get($theme, $_internals, typography-tokens) != null;
235
+ @return map.get($theme, $internals, typography-tokens) != null;
234
236
  }
235
237
  @if $system == density {
236
- @return map.get($theme, $_internals, density-scale) != null;
238
+ @return map.get($theme, $internals, density-scale) != null;
237
239
  }
238
240
  @error 'Valid systems are: base, color, typography, density. Got:' $system;
239
241
  }
@@ -259,19 +261,19 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
259
261
  @else if $version == 1 {
260
262
  @each $system in $systems {
261
263
  @if $system == base {
262
- $theme: map.deep-remove($theme, $_internals, base-tokens);
264
+ $theme: map.deep-remove($theme, $internals, base-tokens);
263
265
  }
264
266
  @else if $system == color {
265
- $theme: map.deep-remove($theme, $_internals, color-tokens);
266
- $theme: map.deep-remove($theme, $_internals, theme-type);
267
- $theme: map.deep-remove($theme, $_internals, palettes);
267
+ $theme: map.deep-remove($theme, $internals, color-tokens);
268
+ $theme: map.deep-remove($theme, $internals, theme-type);
269
+ $theme: map.deep-remove($theme, $internals, palettes);
268
270
  }
269
271
  @else if $system == typography {
270
- $theme: map.deep-remove($theme, $_internals, typography-tokens);
272
+ $theme: map.deep-remove($theme, $internals, typography-tokens);
271
273
  }
272
274
  @else if $system == density {
273
- $theme: map.deep-remove($theme, $_internals, density-scale);
274
- $theme: map.deep-remove($theme, $_internals, density-tokens);
275
+ $theme: map.deep-remove($theme, $internals, density-scale);
276
+ $theme: map.deep-remove($theme, $internals, density-tokens);
275
277
  }
276
278
  }
277
279
  @return $theme;
@@ -297,7 +299,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
297
299
  }
298
300
  $result: ();
299
301
  @each $system in $systems {
300
- $result: map.deep-merge($result, map.get($theme, $_internals, '#{$system}-tokens') or ());
302
+ $result: map.deep-merge($result, map.get($theme, $internals, '#{$system}-tokens') or ());
301
303
  }
302
304
 
303
305
  @return $result;