# 如何使用主题配色方案

**URL:** https://meta.discourse.org/t/how-to-use-theme-color-scheme/87148
**Category:** Support
**Created:** [2018年五月10日 09:06 UTC](https://meta.discourse.org/t/how-to-use-theme-color-scheme/87148 "2018-05-10T09:06:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![TheBestPessimist](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thebestpessimist/32/247704_2.png) [@TheBestPessimist](https://meta.discourse.org/u/TheBestPessimist)
#### Post date: [2018年五月10日 09:07 UTC](https://meta.discourse.org/t/how-to-use-theme-color-scheme/87148/1 "2018-05-10T09:07:00Z")

</div>

I see that [material design stock theme](https://meta.discourse.org/t/material-design-stock-theme/47142) has multiple color schemes:

- material teal/amber
- simple dark
- material dark
- etc.

But i (as an admin) have to select exactly one of these color schemes for my users. Is there a possibility to have all the color schemes available by default to them?

One idea to “fix” this was to copy the theme multiple times and each time to chose a different color scheme, – but that just feels stupid.

Is there something i missed regarding color schemes?

Thanks.

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [2018年五月11日 14:35 UTC](https://meta.discourse.org/t/how-to-use-theme-color-scheme/87148/2 "2018-05-11T14:35:21Z")

</div>

> [@TheBestPessimist](#):
>
> Is there a possibility to have all the color schemes available by default to them?

Not that I’m aware of, no. This is not possible yet. This is very close though

> [@TheBestPessimist](#):
>
> One idea to “fix” this was to copy the theme multiple times and each time to chose a different color scheme

However, I would not recommend “copying” the entire theme, as in `html`, `js` and `css`.

This would not be very maintainable in the long run as the amount of work you have to do multiplies by the number of color variants you intend to offer to your users.

Here’s something slightly different and we’ll stick with the Material theme since you mentioned it.

If you install the material theme, you get a few color schemes with it. Namely:

```
Material Teal/Amber
Material Red/Blue
Material Blue/Red
Material Indigo/Orange
Material Dark

```

What you need to do is create a new theme for every color scheme you want to offer to your users. Let’s say you want to use

```
Material Red/Blue
Material Blue/Red
Material Dark

```

You would then create three _new_ themes and call them Red, Blue and Dark.

Once those themes in place, make them user selectable.

Now set the color scheme for each of those themes to the matching color scheme. So,

**Red** gets `Material Red/Blue`  
**Blue** gets `Material Blue/Red`  
**Dark** gets `Material Dark`

Once that’s done, you would then add the Material theme as a child theme to all these new themes you just created.

This effectively allows you to offer different color schemes for the same theme with the added benefit that the code for the theme (html, js and css) is located in one place - The Material theme.

That way, if you need to change anything in the theme code, you’d only need to change it in one place and not have do it over and over for every color variant.

---

<div class="post-metadata">

### Author: ![TheBestPessimist](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thebestpessimist/32/247704_2.png) [@TheBestPessimist](https://meta.discourse.org/u/TheBestPessimist)
#### Post date: [2018年五月11日 15:24 UTC](https://meta.discourse.org/t/how-to-use-theme-color-scheme/87148/3 "2018-05-11T15:24:16Z")

</div>

I guess that works good enough for now.

Thanks for the help.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2018年七月27日 17:13 UTC](https://meta.discourse.org/t/how-to-use-theme-color-scheme/87148/4 "2018-07-27T17:13:27Z")

</div>

Relevant:

> [@Color schemes should be specific to a single theme](https://meta.discourse.org/t/color-schemes-should-be-specific-to-a-single-theme/93290):
>
> There are two hairy issues with our current implementation of color schemes: color schemes are globally available to every theme and are not theme specific. offering more than one user-selectable color scheme for a theme requires you to “duplicate” the theme as a separate entity Neither of the above should be true. It is far more common for a site (or app) to offer multiple color schemes (most commonly one light and one dark) rather than multiple themes; practically all companies will just w…
