Building an Ionic Theme Switcher & Dynamic CSS Variables [v4]

ionic-4-theme-switcher

Since Ionic 4 makes use of CSS variables, it has become incredibly easy to switch the whole style of your application or dynamically style parts of your components.

We don’t need any tricks and can easily apply a completely different styling that we define upfront. Or we could even set the values from code, and that’s what well do in this Quick Win.

ionic-4-theme-switch

There’s also a new functionality to implement a dark mode for your app more genuinely. Check out the official Ionic blog for their take on the dark mode!

The full quick win with snippets is only available to Ionic Academy members.
Join now for

  • Unlimited access to all quick wins
  • Library of 40+ step-by-step video courses
  • Support for Ionic questions via Slack & private community

Join now & Unlock