# Toggle between dark theme and default them

**URL:** <https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277>\
**Category:** ionic-v3\
**Created:** [December 14, 2016, 8:05pm UTC](https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277 "2016-12-14T20:05:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mg1075\_ionic](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mg1075\_ionic](https://forum.ionicframework.com/u/mg1075_ionic)\
**Post date:** [December 14, 2016, 8:05pm UTC](https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277/1 "2016-12-14T20:05:35Z")

</div>

Ionic 2 has the option to use a dark theme.

> [@What's the current state of the dark theme in Ionic 2?](https://forum.ionicframework.com/t/whats-the-current-state-of-the-dark-theme-in-ionic-2/50613/3):
>
> You can include the dark theme by importing it in the app.variables.scss file, like so: // App Shared Variables // -------------------------------------------------- // To customize the look and feel of this app, you can override // the Sass variables found in Ionic's source scss files. Setting // variables before Ionic's Sass will use these variables rather than // Ionic's default Sass variable values. App Shared Sass imports belong // in the app.core.scss file and not this file. Sass variable…

> <https://stackoverflow.com/questions/40431305/include-ionic-dark-theme/40602490#40602490>

However, it is not clear to me that there is a way to switch/toggle between the dark theme and the default theme as the app is running.

One could I suppose attempt to set a class on the `body` tag, dynamically change the class, and have a bunch of css overrides. But that seems like fighting against the framework rather than working with it. Is this the only option?

---

<div class="post-metadata">

**Author:** ![eggplant](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/eggplant/32/106403_2.png) [@eggplant](https://forum.ionicframework.com/u/eggplant)\
**Post date:** [April 12, 2017, 8:34pm UTC](https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277/2 "2017-04-12T20:34:56Z")

</div>

I wonder this myself too. I would like to implement a dark theme switch button in the app settings and I can’t seem to find a solution thats not just a bunch of css overrides

---

<div class="post-metadata">

**Author:** ![LoLStats](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lolstats/32/103165_2.png) [@LoLStats](https://forum.ionicframework.com/u/LoLStats)\
**Post date:** [April 13, 2017, 6:14am UTC](https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277/3 "2017-04-13T06:14:53Z")

</div>

Yes you have to override the global scss variable’s.

---

<div class="post-metadata">

**Author:** ![BillEpic](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/billepic/32/106341_2.png) [@BillEpic](https://forum.ionicframework.com/u/BillEpic)\
**Post date:** [April 13, 2017, 10:49am UTC](https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277/4 "2017-04-13T10:49:34Z")

</div>

Could you please show how to do that?

---

<div class="post-metadata">

**Author:** ![EvanW](https://avatars.discourse-cdn.com/v4/letter/e/5daacb/32.png) [@EvanW](https://forum.ionicframework.com/u/EvanW)\
**Post date:** [April 13, 2017, 11:04am UTC](https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277/5 "2017-04-13T11:04:52Z")

</div>

@BillEpic it’s all in the docs. Go to the theme folder in your src directory and add the variables that you want to override to the variables file.

---

<div class="post-metadata">

**Author:** ![LoLStats](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lolstats/32/103165_2.png) [@LoLStats](https://forum.ionicframework.com/u/LoLStats)\
**Post date:** [April 13, 2017, 2:57pm UTC](https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277/6 "2017-04-13T14:57:57Z")

</div>

You can watch this tutorial: [https://www.youtube.com/watch?v=sXFmkdhOEVc](https://www.youtube.com/watch?v=sXFmkdhOEVc)

---

<div class="post-metadata">

**Author:** ![eggplant](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/eggplant/32/106403_2.png) [@eggplant](https://forum.ionicframework.com/u/eggplant)\
**Post date:** [April 13, 2017, 4:43pm UTC](https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277/7 "2017-04-13T16:43:55Z")

</div>

Well the thing is I want to give the user the choice of the standard light theme and the dark theme, and just overriding the variables won’t do. Any other ideas?

---

<div class="post-metadata">

**Author:** ![almighty99](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@almighty99](https://forum.ionicframework.com/u/almighty99)\
**Post date:** [January 15, 2018, 3:03pm UTC](https://forum.ionicframework.com/t/toggle-between-dark-theme-and-default-them/73277/8 "2018-01-15T15:03:17Z")

</div>

did you find any solution to this?
