Need to target topics & author for CSS

We have a need to target individual topics by CSS to highlight authors in specific ways for individual threads. The ultimate goal here is to make specific authors more visible in topics with many replies - but only in that thread.

So for instance, if we were having a question/answer session in this thread there might be a specific expert responding but that person should be ‘normal’ in the rest of the forums. So we would need two new classes for each topic (full thread including replies)

  • Class for each author (their username would be ideal)
  • Class for the topic ID

This would enable use to use something like this:

div.abc.xyz {
    /* rules go here */
}

to get very specific within-topic targeting. This would also allow us to highlight multiple ‘experts’ per thread as needed.

By category/group is not specific enough in this case. Can we get more granular?

I understand we’d need to add those rules for each topic in the Customize section which is perfect for our need.

Any chance this could be added?

You can already do that using “data-topic-id” and “data-user-id:wink:

[data-topic-id="33027"] {
  [data-user-id="1995"] {
    /* rules goes here */
  }
}
6 Likes

Thank you!! :allthethings:

1 Like

Oh! Quick q: where do I find the user ID?

Go to the user page, put .json on the end of the url, and look for "user":{"id":123, . It’ll be around the middle of the response :confused:

3 Likes

Thank you @riking!

This can be closed out, appreciate all the help!

2 Likes