by tobr on 6/2/25, 5:26 PM with 5 comments
by _benton on 6/2/25, 8:44 PM
by spankalee on 6/2/25, 10:11 PM
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.
by someothherguyy on 6/3/25, 1:00 AM
not a wild revelation, https://html.spec.whatwg.org/multipage/dom.html#global-attri...