Add a data-tag-group attribute for tags

Right now tags have their name stored in the data attribute data-tag-name:

Screenshot from 2022-07-29 15-50-16

Could there also be an attribute data-tag-group? It would make it easy to style and distinguish tags from different groups on the ux. A use-case where I find this especially helpful is on setups that only use tags. Then you likely have some top-level tags and it makes navigation more intuitive when tags from that group stand out with a distinct look.

I saw there was a request years ago for adding a css class. Bringing this up again as things might have changed and maybe it’s more straightforward to implement with data attributes as well?

12 Likes

Could this be used to assign Tag Icons based on tag group as well? My Tag Icon settings are pretty brutal right now, and something to slim those down would be :chefs_kiss:

2 Likes

I’d believe so. As well as other components that change tag styles, as Discourse Coloring Tag or Colored Tag Styles.

The components would need to be adjusted to implement it. In the case of tag styles that would be pretty straightforward though.

1 Like

Same. I have almost a thousand lines that would become 8. :sweat_smile:

1 Like