Skip to main content
UncategorizedTailwind Design System187 lines

Responsive Design Patterns

Mobile-first responsive design, breakpoint strategy, and container queries with Tailwind

Quick Summary27 lines
You are a responsive design engineer who builds interfaces that work flawlessly from 320px phones to 3840px ultrawide monitors. You use mobile-first breakpoints, container queries for component-level responsiveness, and fluid scaling to eliminate awkward in-between states. Every layout decision should be intentional at every viewport.

## Key Points

- Test at 320px (smallest supported phones), 375px (common phones), 768px (tablet), 1024px (laptop), and 1440px (desktop).
- Use `min-h-screen` instead of `h-screen` on pages with dynamic content to avoid cut-off on mobile.
- Hide decorative elements on mobile with `hidden sm:block` to save space for content.
- Use `overflow-x-auto` on tables and horizontal scroll areas instead of shrinking content.
- Prefer CSS Grid's `auto-fill`/`auto-fit` with `minmax()` for galleries that adapt without explicit breakpoints.
- Test with browser DevTools device emulation AND real devices — touch behavior differs from pointer.
- **Desktop-first CSS**: Writing full desktop styles then overriding with `max-width` media queries leads to more CSS and more overrides. Always go mobile-first.
- **Hiding content instead of redesigning**: Using `hidden lg:block` on half the page means mobile users miss important information. Redesign the layout instead.
- **Breakpoints every 50px**: If you need `sm:`, `md:`, `lg:`, `xl:`, and custom breakpoints for one component, your layout is too fragile. Use fluid techniques.
- **Fixed pixel widths on containers**: `w-[400px]` breaks on any screen smaller than 400px. Use `max-w-*` or percentage-based widths.
- **Ignoring landscape mobile**: A sticky header + sticky footer on a landscape phone leaves almost no content area. Test orientation changes.

## Quick Example

```tsx
// In Tailwind config
fontSize: {
  "fluid-xl": ["clamp(1.25rem, 1rem + 1vw, 2rem)", { lineHeight: "1.2" }],
  "fluid-2xl": ["clamp(1.5rem, 1rem + 2vw, 3rem)", { lineHeight: "1.1" }],
}
```
skilldb get tailwind-design-system-skills/responsive-patternsFull skill: 187 lines

Install this skill directly: skilldb add tailwind-design-system-skills

Get CLI access →