У меня есть настраиваемая тема в Angular Material
, которая выглядит:
@import '~@angular/material/theming';
@include mat-core();
/* ======== angular material custom theme ======== */
$my-custom-primary: mat-palette($mat-blue, 800, 900, A100);
$my-custom-accent: mat-palette($mat-pink, 100, 500, A100);
$my-custom-warn: mat-palette($mat-lime);
// Light theme
$my-custom-light-theme: mat-light-theme($my-custom-primary, $my-custom-accent, $my-custom-warn);
@include angular-material-theme($my-custom-light-theme);
$my-custom-dark-theme: mat-dark-theme($my-custom-primary, $my-custom-accent, $my-custom-warn);
// Dark theme
.dark-theme {
color: $light-primary-text;
@include angular-material-theme($my-custom-dark-theme);
}
//@include angular-material-theme($my-custom-dark-theme);
// Alternate Angular Material Theme
.my-alternate-theme {
$my-alternate-primary: mat-palette($mat-red);
$my-alternate-accent: mat-palette($mat-green, 400);
$my-alternate-warn: mat-palette($mat-grey);
$my-alternate-theme: mat-light-theme($my-alternate-primary, $my-alternate-accent, $my-alternate-warn);
@include angular-material-theme($my-alternate-theme);
}
и динамический c переключатель в app.component
:
<div class="mat-app-background" [class.dark-theme]="theme.isDark()">
<router-outlet></router-outlet>
</div>
, но при переходе на темную тему цвет фона по-прежнему white
- он не меняет, устанавливаю ли я класс mat-app-background
в разделе div
. Вы знаете, как мне изменить этот цвет фона?