I\'m building an app with multiple theme with angular material design 2. I created multiple theme and it\'s working really great. Using this guideline : Angular Material des
I've created a simple mixin to solve this issue.
$theme: mat-light-theme((color:(primary: $primary,accent: $accent,warn: $warn)));
$pv-theme: mat-light-theme((color:(primary: $pv-primary,accent: $pv-accent,warn: $pv-warn)));
$avg-theme: mat-light-theme((color:(primary: $avg-primary,accent: $avg-accent,warn: $avg-warn)));
@include angular-material-theme($theme);
.avg {
@include angular-material-color($avg-theme);
}
.pv {
@include angular-material-color($pv-theme);
}
@mixin theme($property: null, $key: null) {
& {
#{$property}: mat-color(map_get($theme, $key));
}
.avg & {
#{$property}: mat-color(map_get($avg-theme, $key));
}
.pv & {
#{$property}: mat-color(map_get($pv-theme, $key));
}
}
footer .container {
@include theme(background-color, primary);
}