# Automatic Dark Mode color scheme switching

**URL:** https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593
**Category:** Announcements
**Tags:** new-feature, auto-dark
**Created:** [August 20, 2020, 10:17pm UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593 "2020-08-20T22:17:08Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [August 20, 2020, 10:17pm UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/1 "2020-08-20T22:17:08Z")

</div>

You can now set up your Discourse site to automatically switch color schemes when the user’s device is in dark mode. For a quick preview, head over to the [try.discourse.org](http://try.discourse.org) instance and toggle your device’s dark mode on and off to see this new feature in action. (This feature not enabled on meta.)

### Enabling automatic dark mode

To enable this feature on your instance, you can pick the dark mode color scheme in your site settings:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/7/578354e95c8608b602d9cf8a13943a2fbbadc68f.png)

Once that setting is set, you can reload your site with a device _in dark mode_ and you should see the dark color scheme in use.

If the logo that worked well on a light scheme doesn’t work as well on a dark background, you can now upload alternatives in the new settings available in core.

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/d/4d84f3bdb3b795624257dd8b2a90a314d690e357.png)

The files uploaded in these settings will replace the regular setting with the same name if a) automatic dark mode switching is enabled and the user’s device is in dark mode or b) the user is using a dark theme (even if not in dark mode). Sites that were previously using [https://meta.discourse.org/t/alternative-logos-for-dark-light-themes/88502](https://meta.discourse.org/t/alternative-logos-for-dark-light-themes/88502) can now switch to using the core site settings and remove that component.

Some users might not want to automatically switch to a dark color scheme when their browser is in dark mode. They can disable this feature by unchecking the “Enable automatic dark mode color scheme” option in their Preferences \> Interface screen:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/6/56aa63cdae8dd9b988a69a98d273114002eef4ab.png)

* * *

### User Selected Color Scheme Picker

To use this feature, you need to create multiple color schemes in your site, and mark them as selectable by users:

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/d/1d61ea586e5cb98049690ce09535e581d5f17234.png)

Once that is done, users should see two dropdowns in the Preferences \> Interface page:

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/0/602128f7032e316b6763bf0fc6082c2414ac34c8.png)

See also [Update themes and plugins to support automatic dark mode](https://meta.discourse.org/t/updating-themes-and-plugins-to-support-automatic-dark-mode/161595)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [December 17, 2020, 3:28am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/28 "2020-12-17T03:28:02Z")

</div>

When it lands on the Beta channel, I’ll be able to test. Technically, there’s no reason why it wouldn’t work, if ChromeOS (like Android, iOS, macOS, etc.) respects the [prefer-color-scheme](https://caniuse.com/prefers-color-scheme) media query.

I just tried this out on a Chromebook in the beta channel. It kinda works, but it is unpolished. I could get it to force dark mode for all web content, including Discourse sites (I tested using [try.discourse.org](http://try.discourse.org)). But it doesn’t look like it can toggle the web content when toggling the OS between dark and light themes. And playing around with it, I ended up quite often in a hybrid state, where parts of the UI are using light mode and other parts dark mode.

For others who want to try this out, head over to `chrome://flags`, search for “Dark”, and enable “Dark/light mode of system UI” and “Force Dark Mode for Web Contents”.

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [December 19, 2020, 10:42pm UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/35 "2020-12-19T22:42:16Z")

</div>

We have a light and a dark theme. The dark theme renders everything the way we want, also tag icons and topic previews. But the dark color scheme has quite some glitches, when using these addons. I just wonder: why not be able to set a default theme for automatic dark mode, instead of a default color scheme? The theme seems to allow for much better adjustments than the color scheme.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [December 21, 2020, 6:24pm UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/36 "2020-12-21T18:24:33Z")

</div>

> [@manuel](#):
>
> But the dark color scheme has quite some glitches, when using these addons.

I suspect you mean that there are some dark mode glitches with the topic previews plugin? If I click on the site on your user profile, I do see some hover colors are wrong when in dark mode. Maybe the topic previews plugin needs a small update to better support dark mode (there is a [guide for plugins devs](https://meta.discourse.org/t/updating-themes-and-plugins-to-support-automatic-dark-mode/161595)), if so, I think it’s worth raising the issue in that plugin’s topic.

> [@manuel](#):
>
> why not be able to set a default theme for automatic dark mode, instead of a default color scheme? The theme seems to allow for much better adjustments than the color scheme.

We cannot switch themes on-the-fly, themes can have custom javascript code, and it’s not possible to switch the javascript code without reloading the page.

---

<div class="post-metadata">

### Author: ![Alex\_P](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alex_p/32/163548_2.png) [@Alex\_P](https://meta.discourse.org/u/Alex_P)
#### Post date: [January 6, 2021, 8:24am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/37 "2021-01-06T08:24:15Z")

</div>

> [@pmusaraj](#):
>
> Some users might not want to automatically switch to a dark color scheme when their browser is in dark mode. They can disable this feature by unchecking the “Enable automatic dark mode color scheme” option in their Preferences \> Interface screen:

hm, I don’t see it in the latest version.

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/b/ab8763e4cdf4ce941eac4685c68500a831695420.png)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [January 6, 2021, 1:50pm UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/38 "2021-01-06T13:50:24Z")

</div>

Right, the checkbox shows up if there is only one available dark scheme, we have recently introduced the WCAG-compatible schemes, and that changes the interface to the two dropdowns you see under Color Schemes in your screenshot.

Users wanting to disable automatic dark mode can click on the Dark Mode dropdown, and set it to “Same as Regular”.

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/a/8aed22dffc0e559e88a8e2e4d4e1081109a041fa.png)

---

<div class="post-metadata">

### Author: ![littleviolette](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@littleviolette](https://meta.discourse.org/u/littleviolette)
#### Post date: [February 11, 2021, 12:22am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/42 "2021-02-11T00:22:41Z")

</div>

> [@pmusaraj](#):
>
> Some users might not want to automatically switch to a dark color scheme when their browser is in dark mode. They can disable this feature by unchecking the “Enable automatic dark mode color scheme” option in their Preferences \> Interface screen:

Is it possible to have this box unchecked by default? Most members of our community are not used to navigating the site in dark mode. Some users who would still like to have the auto dark mode option.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [March 22, 2021, 4:29pm UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/47 "2021-03-22T16:29:26Z")

</div>

> [@pmusaraj](#):
>
> You can now set up your Discourse site to automatically switch color schemes when the user’s device is in dark mode. For a quick preview, head over to the [try.discourse.org](http://try.discourse.org) instance and toggle your device’s dark mode on and off to see this new feature in action. (This feature not yet enabled on meta.)

Is this still the best way to test this feature? I don’t see any change to the theme on try when I visit using my chromebook and enable/disable dark mode. Even refreshing the web page does nothing. I’m on the latest version of chromeos. I also tried creating a test account and did the same with no change.

I also had a look around on other sites I use, including self-hosted and Teams, and am not able to get this to automatically change based on my device dark mode setting.

ps- loving the screencast feature in chromeos. Pretty sweet! :heart_eyes:

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 23, 2021, 1:47am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/53 "2021-03-23T01:47:44Z")

</div>

So it works on Windows, and iOS, but not on ChromeOS? That’s what the testing shows? That implies to me that ChromeOS maybe needs some updating or isn’t doing it quite the same as everyone else? Any thoughts @pmusaraj?

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [March 23, 2021, 1:50am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/54 "2021-03-23T01:50:17Z")

</div>

Yes, this is very much a ChromeOS issue, it works well on all OSes that support dark mode, i.e. macOS, Windows, iOS, Android and several Linux flavors. There is really nothing for us to do here.

---

<div class="post-metadata">

### Author: ![anon73664359](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@anon73664359](https://meta.discourse.org/u/anon73664359)
#### Post date: [July 6, 2021, 2:11am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/59 "2021-07-06T02:11:13Z")

</div>

> [@pmusaraj](#):
>
> (This feature not yet enabled on meta.)

Could it possibly be enabled now?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 7, 2021, 12:38am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/60 "2021-07-07T00:38:02Z")

</div>

Hmm, good point, how do we test this @pmusaraj on meta? I’ve enabled “dark mode” for apps in Windows 10 and I am seeing Twitter (web/Chrome) go dark, but not meta?

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [July 7, 2021, 12:47am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/61 "2021-07-07T00:47:23Z")

</div>

Yes, this is still not enabled on meta because we have many themes enabled here, each designed to work with a specific color scheme. Plus we have the theme switcher in the hamburger menu, which doesn’t play well with color schemes.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 7, 2021, 12:58am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/62 "2021-07-07T00:58:50Z")

</div>

Oh, I see. Does it work with a default install of Discourse? Can I get it to work with [https://discourse.codinghorror.com/](https://discourse.codinghorror.com/) ?

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [July 7, 2021, 1:01am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/63 "2021-07-07T01:01:13Z")

</div>

Yes, it works on a default install. It works on [https://try.discourse.org](https://try.discourse.org), for example.

On [https://discourse.codinghorror.com/](https://discourse.codinghorror.com/) you might have to toggle the setting (by default it is set to None):

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/a/aafa3b73372e3c363525e9eea6150b50ce34c9dd.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 7, 2021, 1:03am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/64 "2021-07-07T01:03:34Z")

</div>

Ah, I see. My install is quite old and only had one color scheme, light. I added a new color scheme based on the dark default, and that worked – I can verify that switching the dark and light color schemes in the Windows Settings automatically affects Discourse now! :tada:

But does this work out of the box for a new Discourse install? Hopefully yes?

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [July 7, 2021, 1:07am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/65 "2021-07-07T01:07:01Z")

</div>

It does, there are a few color schemes added by default (Light, Dark, WCAG Light, WCAG Dark). The setting is default off though, new admins need to find it to enable it.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 7, 2021, 1:12am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/66 "2021-07-07T01:12:15Z")

</div>

Should we perhaps make a goal of having that setting be on by default in this release? As long as we ship default logos in the dark version it should be good?

---

<div class="post-metadata">

### Author: ![Kchalk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kchalk/32/226787_2.png) [@Kchalk](https://meta.discourse.org/u/Kchalk)
#### Post date: [July 7, 2021, 2:26am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/69 "2021-07-07T02:26:03Z")

</div>

This feature is so useful, thank you for including in core.

I’ve done up a gif to demonstrate it on Windows. Discourse switches instantly, faster than the OS itself :+1:  
 ![](https://global.discourse-cdn.com/meta/original/3X/d/f/dfa6967fcf4802190f747ac9464605339f77fc9b.gif)

Additional details here on my [instance](https://forums.chalk.sg/t/prefer-a-dark-theme-try-out-dark-mode/110/2) if keen.

[https://forums.chalk.sg/t/prefer-a-dark-theme-try-out-dark-mode/110/2](https://forums.chalk.sg/t/prefer-a-dark-theme-try-out-dark-mode/110/2)

---

<div class="post-metadata">

### Author: ![JimPas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimpas/32/148179_2.png) [@JimPas](https://meta.discourse.org/u/JimPas)
#### Post date: [July 7, 2021, 4:25am UTC](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/70 "2021-07-07T04:25:14Z")

</div>

> [@codinghorror](#):
>
> Can I get it to work with [https://discourse.codinghorror.com/](https://discourse.codinghorror.com/) ?

> [@codinghorror](#):
>
> I can verify that switching the dark and light color schemes in the Windows Settings automatically affects Discourse now!

:clap: Now I can read twice as much. :laughing:

[Next page](https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593.md?page=2)
