Lab 07: Responsive Architecture

Time: 60 minutes | Level: Architect | Docker: node:20-alpine

Overview

Fluid design system engineering: clamp()-based type and spacing scales (minor/major third ratios), container queries for component-level responsiveness, intrinsic layout with auto-fill/auto-fit, and responsive image art direction.


Step 1: Fluid Type Scale — Math

Musical scale ratios for typography:
  Minor Third:  1.200 (comfortable, compact)
  Major Third:  1.250 (clear hierarchy)
  Perfect Fourth: 1.333 (dramatic, common)
  Golden Ratio: 1.618 (bold hierarchy)

clamp(min, preferred, max)
  min = minimum at small viewport (320px)
  max = maximum at large viewport (1280px)
  preferred = slope * 100vw + intercept

Slope = (maxPx - minPx) / (maxVw - minVw)
Intercept = minPx - slope * minVw

Step 2: Fluid Type Scale Generator


Step 3: Fluid Spacing Scale


Step 4: Container Queries Architecture

💡 Container queries solve the "component in unknown context" problem. A card component can adapt to being in a sidebar, modal, or full-width layout without media query hacks.


Step 5: Intrinsic Layout — auto-fill vs auto-fit


Step 6: Responsive Images


Step 7: Viewport Units — svh/dvh/lvh


Step 8: Capstone — Fluid Type Scale

📸 Verified Output:


Summary

Technique
CSS Feature
Use Case

Fluid type

clamp(min, vw + rem, max)

Scale-aware typography

Fluid spacing

clamp() spacing tokens

Proportional whitespace

Component layout

Container queries

Self-adapting components

Intrinsic grid

auto-fill/auto-fit

No breakpoints needed

Sidebar

flex: 1 1 280px

Wraps naturally

Art direction

<picture> + <source media>

Different crops

Viewport

svh/dvh/lvh

Mobile-correct sizing

Last updated