# Override global Sass variables from theme

**URL:** <https://meta.discourse.org/t/override-global-sass-variables-from-theme/68146>\
**Category:** Development\
**Created:** [8월 16, 2017, 9:57오전 UTC](https://meta.discourse.org/t/override-global-sass-variables-from-theme/68146 "2017-08-16T09:57:47Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)\
**Post date:** [8월 16, 2017, 9:57오전 UTC](https://meta.discourse.org/t/override-global-sass-variables-from-theme/68146/1 "2017-08-16T09:57:47Z")

</div>

Continuing the discussion from [Cleaning up our color palette 🎨](https://meta.discourse.org/t/cleaning-up-our-color-palette/61263/18):

> [@Cleaning up our color palette artist\_palette](https://meta.discourse.org/t/cleaning-up-our-color-palette/61263/18):
>
> alongside the ability to override those variables from a theme.

Themes already have the ability to define sass variables:

> <https://github.com/discourse/discourse/blob/main/spec/models/remote_theme_spec.rb#L32-L39>

However, from personal testing, these seem to be local to the theme’s stylesheets, and won’t globally override a variable.

If they did it would prove incredibly useful for theme development, as it would allow the theme to specify exactly what colour should be used as `$primary-medium`, `$tertiary-low` and so on - rather than have it automagically calculated off of the colour scheme.

Perhaps there should be a `scope` option, something like this:

```plaintext
"fields": {
  "primary-medium": {
    "value": "#012345",
    "type": "color",
    "scope": "global"
  }
}

```

---

_[View the full topic](https://meta.discourse.org/t/override-global-sass-variables-from-theme/68146)._
