Responsive design has always meant "respond to the viewport." Container queries respond to something more useful for component-based design: the size of the element's own containing box, regardless of where on the page it ends up.

.card-container { container-type: inline-size; }

@container (min-width: 400px) {
  .card { display: flex; }
}

Why this matters for component libraries

A card component dropped into a wide main column and the same component dropped into a narrow sidebar can now genuinely respond to their own available space, independently - something a viewport-based media query was never able to express.

Early days, worth watching

Browser support is still landing as this is being written, so we're prototyping with container queries on internal tools before reaching for them on client production work - but the underlying idea is clearly where component-level responsive design was always supposed to go.

The layout problem media queries can't solve

A media query only ever knows the viewport's width - it has no idea whether the component using it is sitting in a full-width hero or a 240px sidebar widget. That mismatch is exactly why the same "responsive" card component so often looks perfect in one context and cramped in another; it's responding to the wrong container.

.card-container { container-type: inline-size; }
@container (min-width: 400px) {
  .card { grid-template-columns: 120px 1fr; }
}

Designing components instead of pages

Container queries let a component describe its own responsive behavior relative to the space it's actually given, which means the same card, nav item, or gallery tile can be dropped into a sidebar, a main column, or a dense grid and lay itself out correctly in each - no per-context override classes required. That shift, from page-level to component-level responsiveness, is the more significant change than the syntax itself suggests.