I am using Kendo UI with Angular 7 application. The application needs to support changing themes on the fly. For example, some user might like to have Light mode while others will prefer the Dark mode.
Kendo UI has a very good support for themes but the problem is that themes can only be set on the compile time.
As per their recommendations, specifying the theme should be a part of the angular.json file, like the following.
"styles": [
"node_modules/@progress/kendo-theme-bootstrap/dist/all.css",
"src/styles.scss"
]
but this will only compile to embedded CSS inside the root page. We cannot change it on the fly.
The alternative approach I am considering is to add the CSS to index.html like,
<link rel="stylesheet" href="node_modules/@progress/kendo-theme-bootstrap/dist/all.css">
and to try this solution.
Is this the right way to solve the problem or there is a better solution than this one?