The discussion revolves around capitalizing a specific tag in the UI of a Discourse site. jomaxro wants to capitalize their company’s name in a unique way, but Discourse lowercases all tags. jomaxro attempts to use CSS to change the tag’s capitalization, but it doesn’t work on the /tags page.
cpradio provides a working CSS solution that uses the :after pseudo-element to display the tag with the desired capitalization. However, the solution breaks on the /tags page and in certain tag lists.
cpradio refines the solution by adding more CSS rules to exclude the tag-drop class and to handle comma-separated tag lists. jomaxro confirms that the solution requires four CSS rules, but still encounters issues with comma placement.
cpradio provides a revised solution that resolves the comma issue. jomaxro confirms that the solution works and expresses gratitude for the help. jomaxro adds two more CSS rules to fix lingering formatting issues, and the final solution is:
The company I currently work for capitalizes its name in a unique way (capital in the middle). On our Discourse site, we have a tag that we’d like to use the same capitalization. I understand Discourse lowercases all tags in the back-end, which is perfectly fine. I’m hoping to use JS or CSS to change the tag in the UI.
Is the following safe? Will it get all instances of a tag? Is there a better way to accomplish this?
Sorry for the delay, was travelling last night. Here are two examples where it’s not working. The first is the issue I mentioned yesterday. The second is another I noticed today.
One that says, hey, overwrite the existing :after rule for adding the comma in the tag separated list for my specific tag, and the second to provide some margin due to overriding it.
Added two more rules to fix some lingering formatting issues - now the grey background exists for the tag filter, and the tag is properly aligned in the dropdown: