Is there a way I can change scss variables declared in Angular2 component? I want to add the theme dynamically based on user selection and hence need to modify the scss variables. I read about keeping all scss variables in a separate scss file and importing the same in other scss file. But can i import the same in my component file and modify the variables. Is this feasible? TIA
Currently I am using mixin. Code goes here:
// Color themes
$themes: (
default: #ff0000,
banana: #f1c40f,
cherry: #c0392b,
blueberry: #8e44ad,
leaf: #27ae60,
nightsky: #2980b9
);
// Helper theme mixin
@mixin theme($name, $color) {
.#{$name}{
background-color: lighten($color, 30%);
}
.#{$name} {
h1{
color: $color;
}
}
.#{$name} {
nav{
a{
color: $color;
}
}
}
}
But is there a way I can alter the variables inside $themes map from Angular component.