# Update themes and plugins to support automatic dark mode

**URL:** https://meta.discourse.org/t/update-themes-and-plugins-to-support-automatic-dark-mode/161595
**Category:** Developer Guides
**Tags:** how-to, auto-dark, theme-guides
**Created:** [August 20, 2020, 10:29pm UTC](https://meta.discourse.org/t/update-themes-and-plugins-to-support-automatic-dark-mode/161595 "2020-08-20T22:29:35Z")
**Posts on this page:** 1
**Showing post:** 5

<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: [September 9, 2020, 4:18pm UTC](https://meta.discourse.org/t/update-themes-and-plugins-to-support-automatic-dark-mode/161595/5 "2020-09-09T16:18:14Z")

</div>

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:

```scss

$bg: url(dark-light-choose($bg-light, $bg-dark));

:root {
  --custom-bg: #{$bg};
}

```

And then you can use `var(--custom-bg)` in your regular stylesheet.

---

_[View the full topic](https://meta.discourse.org/t/update-themes-and-plugins-to-support-automatic-dark-mode/161595)._
