We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Switching FlexMonster theme

Answered
Venkatesh Prasad asked on July 12, 2021

Hi Team,
Can you please suggest how to dynamically switch between different themes in flexMonster (for angular application).
 
Eg: Light to Dark.
 
 

3 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster July 13, 2021

Hi Venkatesh,
 
Thank you for posting your question.
 
Since Flexmonster themes are configurable through CSS, you need to simply load a new CSS stylesheet to the page to change the theme while also clearing out the previously loaded one.
 
Here's a JSFiddle sample demonstrating this: https://jsfiddle.net/flexmonster/sohrytu9/.
 
Please let us know if this helps.
 
Best regards,
Mykhailo

Public
Venkatesh Prasad July 13, 2021

Hi,
I am loading light-theme file in style.scss file (angular)
@import '../light-theme.css';
 
How can I switch it to dark when the application theme has changed.
 
Thanks,
Venkatesh

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster July 13, 2021

Venkatesh,
 
We don't have ready-to-use samples for dynamic SCSS themes with Angular, since this is not a part of the core Flexmonster functionality.
 
However, we've done a little bit of research on this topic and it looks like this is possible in Angular. Here's a Stack Overflow thread discussing a similar question: https://stackoverflow.com/questions/52952475/change-styles-scss-dynamically-in-angular.
 
Hope this helps!
 
Regards,
Mykhailo

Please login or Register to Submit Answer