liveBook · Manning

Css resilience

As explained in CSS in Depth, Second Edition

The fault-tolerant behavior of CSS that allows unsupported declarations or features to be ignored while supported styling continues to apply.

CSS resilience lets unsupported declarations or features be ignored while supported styling continues to apply. This enables progressive enhancement across browsers: newer browsers use enhanced rules, while older browsers retain a usable fallback. section 1.5.3

Feature queries make the browser’s support decision explicit:

  • @supports (display: grid) applies rules only when the declaration is supported. section 1.5.3
  • @supports selector(:user-invalid) tests whether the browser understands a selector. section 1.5.3
  • Keep a broadly supported layout outside the query, then enhance it inside the query. section 1.5.3

Coffee links with a resilient layout

Style links as inline blocks by default. Inside @supports (display: grid), switch .coffees to three grid columns with gap: 10px, then remove the fallback margins and minimum width. Browsers without grid support still display usable links. section 1.5.3

@supports (display: grid) { ... }

Inspect the compact feature-query pattern used to conditionally enable grid layout. section 1.5.3

How CSS in Depth, Second Edition covers it

How deep it goes
Explains fault tolerance, declaration and selector queries, and a grid fallback pattern.
Examples
Uses coffee links, an inline-block fallback, and a three-column grid inside @supports.
What it assumes
Assumes familiarity with CSS declarations and selectors while teaching feature-query syntax and fallback structure.
What you can do after
Apply it via @supports to build progressively enhanced layouts that remain usable when features are unsupported.
How it connects
Connects CSS resilience with progressive enhancement, feature queries, browser support, CSS, and HTML.

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.