3 ms·
It looks like you didn't read all the way to the end, and custom data attributes can be for whatever you desire. Presently a lot of people are putting style inf
by err4nt 2y ago
It looks like you didn't read all the way to the end, and custom data attributes can be for whatever you desire. Presently a lot of people are putting style information right in class names so this distinction you're speaking about isn't present now and developers are already violating it in a big way. The solution in the article is at least using tag names, attributes, and attribute values in ways they're meant to be used. There's a warning about abusing class names in the CSS spec that reads like this:
Note: Because CSS gives considerable power to the "class" attribute, authors could conceivably design their own "document language" based on elements with almost no associated presentation (such as div and span in HTML) and assigning style information through the "class" attribute. Authors should avoid this practice since the structural elements of a document language often have recognized and accepted meanings and author-defined classes may not.
https://www.w3.org/TR/selectors-4/#example-f9c08b5b https://www.w3.org/TR/selectors-4/#example-f9c08b5b