Skip to content

Commit 9291154

Browse files
committed
fix(material/core): add flag whether to copy color theme values
1 parent e71a1ba commit 9291154

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/material/core/theming/_theming.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ $_legacy-theme-warning: 'Angular Material themes should be created from a map co
2525
// comprehensive theme configurations.
2626
$_enable-strict-theme-config: false;
2727

28+
// Flag whether to disable theme definitions copying color values to the top-level theme config.
29+
// This copy is to preserve backwards compatibility.
30+
$_disable-color-backwards-compatibility: true;
31+
2832
// These variable are not intended to be overridden externally. They use `!default` to
2933
// avoid being reset every time this file is imported.
3034
$_emitted-color: () !default;
@@ -436,7 +440,7 @@ $_emitted-density: () !default;
436440
// is stored in `$theme.color` which contains a property for `primary`. This method copies
437441
// the map from `$theme.color` to `$theme` for backwards compatibility.
438442
@function private-create-backwards-compatibility-theme($theme) {
439-
@if not map.get($theme, color) {
443+
@if ($_disable-color-backwards-compatibility or not map.get($theme, color)) {
440444
@return $theme;
441445
}
442446
$color: map.get($theme, color);

0 commit comments

Comments
 (0)