Clean Up Repetition With :is() Pseudo-Class
PreviousCircular Icons With A Massive Border RadiusNextConditional Styling For Unsupported CSS Features
Last updated
Was this helpful?
Last updated
Was this helpful?
You can use the pseudo-class to match on a number of different selectors in a concise way. For instance, here is how you can make some CSS shorter and more readable:
Here is how describes it:
:is() is the current name for the "Matches-Any" pseudo-class in the CSS4 working draft. The goal of the "Matches Any" selector (with all of it's names) is to make complex groupings of selectors easier to write.
It still has limited browser support, so use it sparingly.