1

Though I have implemented the dynamic theme using CSS variables, but in that case, I have to add a new css class (which get the new color properties: values) in the HTML markup to change its colors. But I want to do it without touching the markup. Just change the variable's values in existing classes and the new theme should be visible. Is it possible to change ".scss" color variable's value dynamically (user action on production app)? Is it possible to implement dynamic theme (user can switch) on a production app, without changing build processes etc. Or what is the best way, please share.

Thanks, Nikhil

Nikhil
  • 417
  • 1
  • 6
  • 16
  • you can have a seprate file for each theme and dynamically [load css](https://stackoverflow.com/a/577002/5621827) and remove the other one – jitender Jun 19 '19 at 09:55
  • @jitender are you sure it will work in an angular production app, where we deploy the bundle build and it is about scss, which needs compilation. ? – Nikhil Jun 19 '19 at 09:59
  • we have implemented it using css runtime theme change and adding/removing css at runtime will work fine whether you are using scss or css you can simple convert your scss to css if thats not work – jitender Jun 19 '19 at 10:13

0 Answers0