liveBook · Manning

Conditional CSS rule

As explained in CSS in Depth, Second Edition

A conditional CSS construct that applies declarations or rules only when a browser supports a specified feature or condition.

A conditional CSS rule uses @supports to apply a group of declarations only when the browser understands a specified declaration. Keep broadly useful fallback styles outside the block, then add enhanced styles inside it. section 1.5.3

Progressively enhancing a coffee-link layout

Style links with inline-block, minimum widths, and margins as a fallback. Then use @supports (display: grid) to switch the container to a three-column grid, add gaps, and remove the fallback spacing. section 1.5.3

How CSS in Depth, Second Edition covers it

How deep it goes
Defines @supports syntax and browser decision behavior, then works through fallback and grid styling; defers detailed grid treatment.
Examples
Uses a coffee-link collection with inline-block fallback and a three-column grid enhancement.
What you can do after
Builds progressively enhanced layouts by placing fallback styles outside @supports and feature-dependent rules inside it.
How it connects
Connects feature queries with progressive enhancement, fallback layouts, CSS Grid, and browser support.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of CSS in Depth, Second Edition. The section links point to the parts of the book it draws on.