I'm looking to implement a theme in my Angular (5) webapp. I'm not using Angular Material for everything (I.e. I only use the input fields and certain components)
I'm looking for a theming solution I can use/control/change at runtime, and not have to recompile my app.
I use SCSS/Sass.
What I've done currently: (In a very basic example)
variables.scss
$color-1: #fff;
$color-2: #000;
test-component/test-component.scss
@import "../variables.scss";
.test {
color: $color-1;
border: 1px solid $color-2;
}
Since I started development on my app I simply assigned values to SCSS variables and used them, but a little down the line I'd like to implement a decent theming solution where I can control the theme during run time, as variables are only set at compilation time.
Additional things I've looked into:
I came across this article which seems like a decent idea to implement, however at a component level I'm not entirely sure how effective it'll be since deeply nested components would not be able to see what a class a container surrounding their router would be, for instance.
Any other ideas? Just to reiterate, I'm not looking to modify the Angular Material theme I have.
EDIT 1:
I came across this magical post, will do some coding in the morning and see what I can do with it.