Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Cleaning up Selectors with CSS :is()
March 2, 2026
The :is() pseudo-class in CSS is a total game-changer for keeping your stylesheets DRY (Don't Repeat Yourself). Instead of writing long, repetitive selectors like 'header h1, main h1, footer h1', you can simply write ':is(header, main, footer) h1'.
It handles specificity beautifully—the specificity of the :is() selector is replaced by the specificity of its most specific argument. This makes your code much easier to scan and maintain, especially when dealing with complex layouts or deeply nested components.