Help changing color of buttons

Referencing back to this post:

Something yet again changed in latest build and Kris’ beautiful CSS solution no longer works. I’ve wasted an hour digging around in the css but have not found an elegant solution. Anyone have ideas?

I’m not aware of any recent change that would cause this. However, the good news is that if you’ve updated fairly recently then you should be able to use this new feature

https://github.com/discourse/discourse/pull/7987

What that means is that you no longer have to find all the selectors where the $primary-low color is used and override them. You only have to change it in one place. That place is the about.json file of your theme where you define the color palette.

Say for example your palate looks like this

"Solarized Light": {
  "primary": "586E75",
  "secondary": "EEE8D5",
  "tertiary": "268BD2",
  "quaternary": "CB4B16",
  "header_background": "002B36",
  "header_primary": "93A1A1",
  "highlight": "B58900",
  "danger": "CB4B16",
  "success": "859900",
  "love": "DC322F"
}

The only thing you’d need to do to override the $primary-low is to define it here like so

"Solarized Light": {
  "primary": "586E75",
+ "primary-low": "FF0000",
  "secondary": "EEE8D5",
  "tertiary": "268BD2",
  "quaternary": "CB4B16",
  "header_background": "002B36",
  "header_primary": "93A1A1",
  "highlight": "B58900",
  "danger": "CB4B16",
  "success": "859900",
  "love": "DC322F"
}

and the new color will be automatically used everywhere instead of the one Discourse generates for you.

If your theme is not remote - meaning that it was created on your Discourse site in admin > customize - then you will have to export it, make the change above and then import it again - because this is a new feature and is not fully incorporated into the UI yet.

6 Likes

That worked beautifully, thank you Joe!

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.