Home
Bookmarks
Leagues
LEARN
Courses
Career Paths
Assessments
Tutorials
Arcade
Glossary
GROW
Certifications
Log in
Glossary
Log inSign up
Courses/UX Design Foundations/Intro to Design Grids/
Exercise #6

Container Queries: Component-Centric Grids

Historically, responsive design depended on Media Queries, which evaluate the global browser viewport width. This created a major flaw in modular design systems:

A card component placed in a wide sidebar had to render in a cramped space despite the browser viewport being 1440px wide.

The Container Query Revolution (@container)

Container queries allow a component to inspect the width of its immediate parent container rather than the screen:

@container (max-width: 400px) {
  .product-card {
    flex-direction: column;
  }
}

This makes components genuinely modular: a card adapts its grid layout automatically regardless of whether it lives in a narrow sidebar or a wide main feed.

Topics

Anatomy of a Grid: Columns, Gutters, and Margins
The Universal 12-Column Responsive Grid System
Fluid vs. Fixed vs. Adaptive Grid Implementations
Baseline Grids and Vertical Typographic Rhythm
CSS Grid vs. Flexbox: Two-Dimensional vs. One-Dimensional
Container Queries: Component-Centric Grids
design
UX Design

From lesson

18

Intro to Design Grids

Level 5 · Layout and Composition

Top contributors

Community contribution details will appear here once real learner activity is available.

Share