# Global theme settings

**URL:** https://meta.discourse.org/t/global-theme-settings/82881
**Category:** Feature
**Created:** [March 13, 2018, 8:29am UTC](https://meta.discourse.org/t/global-theme-settings/82881 "2018-03-13T08:29:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)
#### Post date: [March 13, 2018, 8:29am UTC](https://meta.discourse.org/t/global-theme-settings/82881/1 "2018-03-13T08:29:04Z")

</div>

I love the ability to theme discourse and it works really well for individual themes but I feel like global settings for /head / CSS etc that would apply to all themes would make things so much easier when trying to manage multiple themes.

Is this possible?

---

<div class="post-metadata">

### Author: ![ZackFea](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zackfea/32/123509_2.png) [@ZackFea](https://meta.discourse.org/u/ZackFea)
#### Post date: [March 13, 2018, 9:24am UTC](https://meta.discourse.org/t/global-theme-settings/82881/2 "2018-03-13T09:24:08Z")

</div>

That is what the Theme Components are for. Add a general theme as compoment to your specific themes and do the general things inside the component. You can use this to override parts of existing themes as well.

---

<div class="post-metadata">

### Author: ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)
#### Post date: [March 13, 2018, 11:37am UTC](https://meta.discourse.org/t/global-theme-settings/82881/3 "2018-03-13T11:37:21Z")

</div>

Have you got an example of how that works please, I don’t fully understand what you mean, thanks

---

<div class="post-metadata">

### Author: ![ZackFea](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zackfea/32/123509_2.png) [@ZackFea](https://meta.discourse.org/u/ZackFea)
#### Post date: [March 13, 2018, 11:58am UTC](https://meta.discourse.org/t/global-theme-settings/82881/4 "2018-03-13T11:58:52Z")

</div>

Ok let me say you got a dark and a light theme and you want to add a custom html header and little bit css to both.

So you create a new theme, name it as you want, i will call it mySpecialHeader. Add your custom html and css to this.  
Now edit your dark theme, check the “Theme include other child themes”. See screenshot below.

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/2/e2d8a90916d5f15bcf26d781b185a485998a432e.jpg)

Select you “mySpecialHeader” in the new dropdwon and add it. Repeat this for light theme. That it, your done.

Pro Tipp: As Discourse uses SaSS for css, you can use sass variables with the `!default` flag and overwrite them in your light or dark theme.

Example:  
To mySpecialHeader CSS I add a var for background-color:

```
$background-color: rgba(210,210,210,0.9) !default;
#mySpecialHeader {
    background-color: $background-color;
}

```

As this white color and in my dark theme I want a black color, I do override it in dark theme by define the variable in the css of my dark theme

```
$background-color: rgba(19,20,24,0.9);

```

You can also use theme based variables. @lll did write a awesome wiki post about it

> [@Use Discourse Core Variables in your Theme](https://meta.discourse.org/t/how-to-use-discourse-core-variables-in-your-theme/77551):
>
> Discourse is incredibly customizable! The goal of this topic is to show you how make use of all the amazing options that are available to you as a theme developer. You know… so that you don’t have to reinvent the wheel smileVariables? What variables? Variables cover a large number of things, from font sizes to colors to z-index values. You can use and override the vast majority of variables in your theme editor. Colors There are many colors available for you to use or override in your them…

---

<div class="post-metadata">

### Author: ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)
#### Post date: [March 13, 2018, 12:17pm UTC](https://meta.discourse.org/t/global-theme-settings/82881/5 "2018-03-13T12:17:09Z")

</div>

Wow, that is awesome, thanks for clarifying it’s usage and the link to Core Variables, I think I can do it now 👍
