I am using Angular Material 2 themes for my Angular 4 app. I have the following themes created in my theme.scss
@import '~@angular/material/theming';
@include mat-core();
$primary-color: mat-palette($mat-grey);
$accent-color: mat-palette($mat-blue, 500, 900, A100);
$warning-color: mat-palette($mat-red);
$dark-theme: mat-dark-theme($primary-color, $accent-color, $warning-color);
$light-theme: mat-light-theme($primary-color, $accent-color, $warning-color);
Run Code Online (Sandbox Code Playgroud)
And in my style.scss, I have the following
@import 'theme.scss';
.dark-theme {
@include angular-material-theme($dark-theme);
}
.light-theme {
@include angular-material-theme($light-theme);
}
Run Code Online (Sandbox Code Playgroud)
In my HTML I have hardcoded the dark theme (eventually I want to give the user an option …