> […] authors are encouraged to use values that describe the nature of the content, rather than values that describe the desired presentation of the content.
[*]: https://html.spec.whatwg.org/multipage/dom.html#global-attri...
> […] authors are encouraged to use values that describe the nature of the content, rather than values that describe the desired presentation of the content.
[*]: https://html.spec.whatwg.org/multipage/dom.html#global-attri...
But describing the presentation of content isn't the sole purpose of the `class` attribute. Having meaningful domain-related names included in the class makes UI testing a lot easier.
You can, for example, use a `data-testid` attribute if the element can't be identified reliably with another attribute, such as the `id` or `role`.
As I said in my (earlier) response to you: using the "class" attribute for semantic, non-styling purpose is not "overloading" or misusing it. It is simply using it. (Just like the folks who developed CSS were able to get use out of element classes by baking tier-one support for them into their selector language. CSS has no claim to the right and proper use of an attribute that predates CSS.) To argue against this is revisionism.
The HTML5 data attributes also aren't a replacement for proper use of the class attribute, either. What the class attribute encodes (surprise) the class that the content belongs to. The data attribute payload encodes a particular value associated with a given key for a particular instance (e.g. the testid payload from your own example). And aside from the use cases being incomparable, the HTML spec says they shouldn't be used the way you're saying.
Accessibility help relies on using the correct, semantic tags, and when that is not possible, WAI-ARIA attribute hints.
It's as easy as:
<img class="video-thumbnail w-24 h-24 rounded shadow"[...]
... instead of swapping out "video-thumbnail" class name with the Tailwind stuff (replacing it). They are not mutually exclusive.