liveBook · Manning

:is()

The CSS :is() pseudo-class matches an element if it matches at least one selector in its argument list and takes the specificity of the most specific argument.

How 2 Manning books explain it

CSS in Depth, Second Edition

The CSS :is() pseudo-class matches an element if it matches at least one selector in its argument list and contributes the specificity of its most specific argument.

How it is used
Organizes growing stylesheets by consolidating repetitive selector lists and supporting graceful selector enhancement.
How deep it goes
Explains matching, specificity, invalid arguments, and nesting desugaring, including effects on targeted elements.
Examples
Uses contact-form controls, invalid-input fallbacks, and nested button, input, textarea, and select rules.
What you can do after
Apply it via CSS selectors to shorten grouped rules, preserve supported fallbacks, and reason about specificity.

Read how CSS in Depth, Second Edition explains :is() →

Tiny CSS Projects

The CSS :is() pseudo-class matches an element against any selector in a supplied selector list and takes the specificity of the most specific selector in that list.

How it is used
Groups form-control selectors so shared states such as checked, hover, and focus can be styled with less repetition.
How deep it goes
Explains selector-list matching and specificity, including an ID-selector warning, but does not detail selector specificity beyond the worked form example.
Examples
Uses grouped radio-button and check-box selectors, selected-state borders, and a comparison with repeated focus selectors.
What you can do after
Apply :is() to consolidate related selectors and control specificity when styling grouped form states.

Read how Tiny CSS Projects explains :is() →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.