The wasted potential of CSS attribute selectors by Elise Hein

in quicklink

Het gebruik van dingen die al aanwezig zijn in je HTML om je CSS op te targeten. Ik vind dit altijd een goede reden om dit meer te doen:

This promotes an a11y-first mindset — if there is no attribute or pseudo selector available to represent the state we wish to style, should we add one? Are we using the right HTML element? We are forced to go through a mental flow chart of native, semantic HTML and CSS features we could tap into before resorting to classes.

Het helpt ook andersom: Als je per ongeluk de juiste attributen vergeet, ziet het er ook niet ok uit.

Lees "The wasted potential of CSS attribute selectors by Elise Hein"