jason's blogObservations on web standards, browsers, and frontend development

Category: CSS

Modern CSS is more than syntax sugar: from container queries to native nesting

A review of recent CSS capabilities and the jobs that no longer need JavaScript or a preprocessor.

Published 06/03/2026

CSS has taken back more layout decisions

Many responsive components used to depend on viewport media queries or JavaScript measurements. Container queries let a component react to the space it actually receives.

.card-list {
  container-type: inline-size;
}
 
@container (min-width: 36rem) {
  .card {
    grid-template-columns: 12rem 1fr;
  }
}

This makes a component easier to reuse in a main column, sidebar, or embedded panel without inventing page-specific breakpoints.

Native nesting changes authoring, not architecture

Native nesting reduces repetition, but deeply nested selectors are still difficult to override. The same restraint that applied to Sass applies to browser-native nesting.

FeaturePreviously common solutionNative option
Component responsivenessJavaScript or viewport queriesContainer Queries
Nested selectorsSass/PostCSSCSS Nesting
Parent-aware statesExtra classes or JavaScript:has()

The larger shift

Modern CSS is not only syntax sugar. It moves layout, state selection, and responsive behavior closer to the browser, reducing the amount of JavaScript and build-time abstraction needed for ordinary interface work.