My favourite is using emojis for classes. It's pointless but I think it's funny and that's gotta count for something right?
Someone in my team once used an emoji in a commit message and took down our CI.
The next week I see a string of poop emojis in some pull request commit messages. I talk to the dev who wrote them and he was testing a CI fix so it doesn’t go down if someone commits emoji again later.
A true highlight of my career.
I would double check that this doesn't have performance implications before going wild. Those are extra tokens that need to be parsed, and browsers do a lot of work to speed up selector matching, including building caches of class names to nodes.
It could be that browsers populate these caches even for unused class names because it's difficult to know at that point in time whether a class name is used or will be used in the future. A ton of unused class names could explode the cache, evict important classes... who knows?
It could also be that the cache is built on demand as selectors are matched and having a ton of unused classes doesn't matter at all.
The point is that it's quite implementation dependent and requires some testing to know. To be safe, I'd just stick to comments because they are very, very cheap, in all browsers and parsers.
A caveat: comments in the list of class names (as shown in the article) aren't real comments. From the point of view of the browser they are just more class names.
> Yes. That is perfectly valid HTML.
not a wild revelation, https://html.spec.whatwg.org/multipage/dom.html#global-attri...