Change category background color for boxes

Hello,

This is possible with css and little bit template modification. :slightly_smiling_face:

On desktop, categories border has a color variable which you can use for background too.

This is the --category-color variable which is the border-color.

But because this variable is a hex value you can’t make it transparency. However you can add this to a ::before pseudo where you can set opacity too.

I made this as a component so you can install it or fork and modify what you want. :slightly_smiling_face:

Component: GitHub - VaperinaDEV/discourse-category-background-color


Desktop CSS looks like this:


On mobile this color variable is missing from the template so you have to add this style here:


After this you can use the --category-color variable and do the similar like on desktop:

Desktop


Mobile

3 Likes