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.
not a wild revelation, https://html.spec.whatwg.org/multipage/dom.html#global-attri...
_benton•1d ago
tyleo•1d ago
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.