Is there way to write data attributes in class-like form? I mean like this:
<div data-el="asset assets.asset">Some div</div>
And I want to use it like classes in selector, I need to find this element as "[data-el='asset']" and also as "[data-el='assets.asset']".
Maybe there is similar way to do so. Thanks for advices!
Take a look at the attribute selectors available:
https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
What you want to use is this:
[data-el~="assets.asset"]
That will find "assets.asset" as a single word with whitespace delimiting. I use this sort of selection sometimes and it works well.