Found 8 bookmarks
Newest
Reducing CSS complexity with the :is() pseudo-class
Reducing CSS complexity with the :is() pseudo-class
Last week, I finally had a reason to use the newish :is() CSS pseudo-class, and wow is it glorious! Today, I want to show you how it can dramatically reduce selector complexity. Let’s dig in! What :is() does The :is() pseudo-class accepts a comma-separated list of selectors, and can be used to group them together. For example, these two selector strings do the same thing… h1, h2, h3, h4, h5, h6 { font-weight: bold; } :is(h1, h2, h3, h4, h5, h6) { font-weight: bold; } You’re probably look at this and thinking…
·gomakethings.com·
Reducing CSS complexity with the :is() pseudo-class
The :empty pseudo-class in CSS
The :empty pseudo-class in CSS
One of my favorite not-so-new aspects of CSS is the :empty pseudo-class. You can use this to target elements that have no children—either child elements or whitespace and text nodes—and style them differently than they would be otherwise. For example, imagine you have some CSS to layout items in a row using flexbox… .grid-flex { display: flex; gap: 1rem; } .grid-flex div { background-color: #ffdc00; border: 1px solid #665800; color: #665800; padding: 1rem 2rem; text-align: center; } And a row of items generated from an API or database or something.
·gomakethings.com·
The :empty pseudo-class in CSS
A Guide To Newly Supported, Modern CSS Pseudo-Class Selectors — Smashing Magazine
A Guide To Newly Supported, Modern CSS Pseudo-Class Selectors — Smashing Magazine
The CSS Working Group Editor’s Draft for [Selectors Level 4](https://drafts.csswg.org/selectors-4/) includes several pseudo-class selectors that already have proposal candidates in most modern browsers. This guide will cover ones that currently have the best support along with examples to demonstrate how you can start using them today!
·smashingmagazine.com·
A Guide To Newly Supported, Modern CSS Pseudo-Class Selectors — Smashing Magazine