I try to build an application that can be themed completely at runtime. Therefore i want to set global settings like font-size, color, background-color etc. on my root app.component. For now i do it with predefined CSS classes:
// CSS
.font-size-16::ng-deep { font-size: 16px; }
// TS
fontSizeClass = 'font-size-16'
// HTML
<div [ngClass]="fontSizeClass"></div>
Changing the fontSizeClass
string to another class works for deep styling my application. But this solution is not dynamic at all. What i actually want is to set the font-size
via [ngStyle]
but keep the ng::deep
functionality, too.
Is that possible?
And are there reasons to not implement theming completely with JavaScript and Redux?
Thanks in advance!