How can I customise CSS for each category? (as in having different design for each category)

(Panteen Pro-V) #1

Hi, I’m running a game forum and I’d like to be able to customise CSS for each category so that each category will look different with each other (example: Fallout 4 category can have more post-nuclear design, Halo category will have futuristic design,etc…) Currently the CSS customize in Admin affect all categories. Any possible way to change css for each category without affecting other category?

(Mittineague) #2

Isn’t it only a matter of using the correct selector(s)?

eg. the body tags class value should have a category specific value you could use.

(Robin Ward) #4

When you’re in a category, discourse adds the category slug to the body element. For example, on meta here when I visit the bug category I get category-bug in the body tag. If you use that as a selector you can style each category differently.

(Panteen Pro-V) #5

Thanks for the info. I will try it out