Is “is” Useful? #Funny
3 months ago
Is “is” Useful?“is”-Useful.png God I’m funny. Anytime we have fairly repetitive selectors that have a common parent, it’s probably a place we can use the :is() pseudo-selector. Holger Bartel demonstrates like this: section section h1, section article h1, section aside h1, section nav h1, article section h1, article article h1, article aside h1, article nav h1, aside section h1, aside article h1, aside aside h1, aside nav h1, nav section h1, nav article h1, nav aside h1, nav nav h1 { font-size: 20px; } Becomes: :is(section, article, aside, nav) :is(section, article, aside, nav) h1 { font-size: 20px; } Adam Argyle demonstrated like this: #CSS :is() selector 🎉the successor to :any() and :matches() sneak peak into our talk, here’s a neat gif I made with XD showing what the :is() selector syntax can do. be excited for Chrome Dev Summit y’all! — Adam Argyle (@argyleink) November 7, 2019 MDN has an extra…

Leave a Reply