@@ -14,6 +14,12 @@ $_generate-default-density: true !default;
14
14
$_duplicate-warning : ' Read more about how style duplication can be avoided in a dedicated ' +
15
15
' guide. https://github.com/angular/components/blob/main/guides/duplicate-theming-styles.md' ;
16
16
17
+ // Warning that will be printed if the legacy theming API is used.
18
+ $_legacy-theme-warning : ' Angular Material themes should be created from a map containing the ' +
19
+ ' keys "color", "typography", and "density". The color value should be a map containing the ' +
20
+ ' palette values for "primary", "accent", and "warn". ' +
21
+ ' See https://material.angular.io/guide/theming for more information.' ;
22
+
17
23
// These variable are not intended to be overridden externally. They use `!default` to
18
24
// avoid being reset every time this file is imported.
19
25
$_emitted-color : () !default ;
@@ -167,6 +173,7 @@ $_emitted-density: () !default;
167
173
// If the legacy pattern is used, we generate a container object only with a light-themed
168
174
// configuration for the `color` theming part.
169
175
@if $accent != null {
176
+ @warn $_legacy-theme-warning ;
170
177
@return private-create-backwards-compatibility-theme (_mat-validate-theme ((
171
178
_is- legacy- theme: true,
172
179
color : _mat-create-light-color-config ($primary , $accent , $warn ),
@@ -207,6 +214,7 @@ $_emitted-density: () !default;
207
214
// If the legacy pattern is used, we generate a container object only with a dark-themed
208
215
// configuration for the `color` theming part.
209
216
@if $accent != null {
217
+ @warn $_legacy-theme-warning ;
210
218
@return private-create-backwards-compatibility-theme (_mat-validate-theme ((
211
219
_is- legacy- theme: true,
212
220
color : _mat-create-dark-color-config ($primary , $accent , $warn ),
@@ -432,6 +440,8 @@ $_emitted-density: () !default;
432
440
@if private-is-theme-object ($theme-or-color-config ) {
433
441
@return $theme-or-color-config ;
434
442
}
443
+
444
+ @warn $_legacy-theme-warning ;
435
445
@return private-create-backwards-compatibility-theme ((
436
446
_is- legacy- theme: true,
437
447
color : $theme-or-color-config
0 commit comments