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.<p>It <i>could</i> 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?<p>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.<p>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.
> Yes. That is perfectly valid HTML.<p>not a wild revelation, <a href="https://html.spec.whatwg.org/multipage/dom.html#global-attributes:classes-2" rel="nofollow">https://html.spec.whatwg.org/multipage/dom.html#global-attri...</a>