Skip to content

Commit e524567

Browse files
authored
fix(material/core): theming validation for m2 themes firing incorrectly (#28707)
Fixes that theming validation for M2 themes was firing incorrectly, because the validation code was going through the `get-color-config`, `get-density-config` and `get-typography-config` functions which in turn were reading the internalized version of the theme where all the values were the same. Since Sass maps are immutable, they were being compared based on their values and always considered as the same theme.
1 parent 4fddb7d commit e524567

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/material/core/theming/_theming.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,10 @@ $_internals: _mat-theming-internals-do-not-access;
432432
// Checks for duplicate styles in a `theme-version: 0` style theme.
433433
@mixin _check-duplicate-theme-styles-v0($theme-or-color-config, $id) {
434434
$theme: private-legacy-get-theme($theme-or-color-config);
435-
$color-config: get-color-config($theme);
436-
$density-config: get-density-config($theme);
437-
$typography-config: get-typography-config($theme);
435+
$color-config: map.get($theme, $_internals, m2-config, color) or get-color-config($theme);
436+
$density-config: map.get($theme, $_internals, m2-config, density) or get-density-config($theme);
437+
$typography-config:
438+
map.get($theme, $_internals, m2-config, typography) or get-typography-config($theme);
438439
// Lists of previous `color`, `density` and `typography` configurations.
439440
$previous-color: map.get($_emitted-color, $id) or ();
440441
$previous-typography: map.get($_emitted-typography, $id) or ();

0 commit comments

Comments
 (0)