I usually saw html data-attribute
(s) to add specific values/parameters to html element like Bootstrap that uses them to "link" buttons to modal dialog to be opened, etc.
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
Now, I see that an almost famous CSS framework, Kube, in its new version extensively uses simple custom attribute such as in following:
<column cols="4">4</column>
<span class="label label-black" outline bold>Black</span>
Other in-action examples are visibile for example, here.
I did not know that was possible to use simple custom attributes so I tried to search some source about this, and I found only this old similar question in which are noted almost only (possible) compatiblity issues.
I'm surprised that a CSS framework like Kube could use a similar solution if browser support could be so "fragile"....
So my question are:
- How good (=cross-compatible) is Kube's approach?
- Can I safely replace my
data-attribute
with simple custom ones if for example I have to pass only true/false values?
This last question is better described by an example, so replace <span class="foo" data-boo='true'>Black</span>
with <span class="foo" boo>Black</span>
class
. Could you please point to an example of such usage? – Tridactyl