๐Ÿ“ฑ Responsive Design

Mobile-First Responsive Design: A Complete 2026 Workflow

By The CodeCraft Teamยทยท9 min read
Website mockup shown on phone, tablet, and desktop

Over 60% of all web traffic in 2026 comes from phones. If your site doesn't feel right on a 5-inch screen, you're losing more than half your audience. Mobile-first design solves this by starting from the smallest screen and progressively enhancing for bigger ones.

Why mobile-first

  • Forces you to prioritise content
  • Smaller base CSS = faster first paint
  • Easier to scale up than down
  • Matches Google's mobile-first indexing

The min-width media query pattern

/* base = mobile */
.card { padding: 1rem; }

@media (min-width: 768px) {
  .card { padding: 2rem; }
}

Container queries: the new responsive

Container queries let a component respond to its parent's width, not the viewport โ€” perfect for component libraries.

.sidebar { container-type: inline-size; }
@container (min-width: 400px) {
  .card { display: flex; gap: 1rem; }
}

Fluid units to use

  • clamp() โ€” fluid type and spacing
  • rem โ€” accessible base unit
  • % and fr โ€” proportional layouts
  • min() / max() โ€” responsive constraints

Frequently asked questions

Are media queries dead?

No โ€” they're still needed for viewport-level changes. Container queries complement them, not replace them.

Enjoyed this article?

Share it with a fellow developer or explore more tutorials in our blog.

More articles

Related articles