You can target your CSS based on a specific tag or category.
There are two areas where you can add category / tag specific styles to topics.
-
In the topic list
We add both the topic’s category and its tags to the
<tr>element that contains that item. So, a topic in the#metacategory that has the tagsautomotiveandmachineswill look like this in your browser inspection tools
if you want to target it based on the category, you would use
tr.category-metaas your selector. If you want to target it based on the tagautomotive, you would usetr.tag-automotiveand so on. -
On topic pages
We also do the same here. We add the relevant category and tag classes on topic pages. The only difference is that we add them to
<body>tag instead. So, it looks like this
You can read more about how to add CSS to your Discourse site here