# Dark/Light Mode Toggle

**URL:** https://meta.discourse.org/t/dark-light-mode-toggle/215585
**Category:** Theme component
**Tags:** deprecated, dark-mode-toggle
**Created:** [January 21, 2022, 6:50pm UTC](https://meta.discourse.org/t/dark-light-mode-toggle/215585 "2022-01-21T18:50:36Z")
**Posts on this page:** 1
**Showing post:** 163

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [December 28, 2024, 7:54pm UTC](https://meta.discourse.org/t/dark-light-mode-toggle/215585/163 "2024-12-28T19:54:25Z")

</div>

Is your question about this theme component that adds a toggle to switch to dark mode, or detecting a dark color palette in general?

There is `dark-light-choose`.

> [@Update themes and plugins to support automatic dark mode](https://meta.discourse.org/t/update-themes-and-plugins-to-support-automatic-dark-mode/161595/5):
>
> Great question, I tried this and noticed that we didn’t properly support using background images or theme variables in the special color definitions stylesheet. So I made some fixes in core, and you should be able to do this now (make sure you pull the latest core). So, if you have two images in your theme or theme component, with SCSS vars of $bg-light and $bg-dark respectively, you can add this to your color\_definitions.scss stylesheet: $bg: url(dark-light-choose($bg-light, $bg-dark)); :ro…

---

_[View the full topic](https://meta.discourse.org/t/dark-light-mode-toggle/215585)._
