4 ms·
The wasted potential of CSS attribute selectors
- ZjA2NDFkNTNmYzQ 4y agoDoesn't touch on performance, and I believe the difference between the two is non-negligible. Nvm, it absolutely does: > And, ultimately, there’s that nagging feeling that you’re going against the grain by repurposing data attributes for styling — after all, selecting elements is what classes are for, and what browsers optimise for in selector performance.
- neon_electro 4y agoI appreciate this article's distinction between attributes that are often required for adequate accessibility (e.g., `aria-current="page"`) and ones that developers come up with on their own as far as what to leverage in your CSS and what to probably avoid. Nice write-up!