by zamalek · 1y ago · 0 comments
Here's what the HTML spec[1] says about data-* attributes:
Custom data attributes are intended to store custom data, state, annotations, and similar, private to the page or application, for which there are no more appropriate attributes or elements.
Doesn't sound like this would be an abuse of even their specified intended purpose, sounds totally within the realm of why the feature exists in the first place: author-defined extensibility within the language.1: https://html.spec.whatwg.org/multipage/dom.html#embedding-cu...
It'll kind of solve the previous commenter concerns about with writing invalid html. While namespaces are more a xml thing, there are probably many benefits to this approach like querying all attributes from the namespace at once too.
I'll keep this in mind for future iterations!