/design-engine:responsive-and-adaptive-layoutfrom design-engine
Guides responsive and adaptive layout decisions for browser-rendered surfaces: breakpoints, fluid values, container queries, and clamp(). Use when a page, component, dashboard, or email must adapt across widths.
Ships in design-engine. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com.
clamp().03-layout-grid-and-composition/layout-grid-and-spacing, then make them respond here.01-typography-and-fonts/font-selection-and-pairing)
or purely which colours (02-color-brand-and-visual-identity). Set those, then size them here.layout-grid-and-spacing for page/slide grids; this skill targets resizable surfaces.internationalization-and-rtl-design (combine with it; logical properties below support both).performance-as-ux-and-core-web-vitals. This skill respects those budgets; it does not own them.| Input | Source | Required evidence |
|---|---|---|
| Realistic width and input-mode range | Product requirements, device support policy, or analytics | Minimum/maximum widths and keyboard, touch, or pointer needs |
| Base grid, hierarchy, and content priority | Layout skill and approved content model | Named focal point, grid tokens, and reflow priorities |
| Portable component inventory | Component library or interface audit | Placement contexts and widths at which each component fails |
| Performance and accessibility constraints | Project budgets and doctrine | CLS budget, zoom/text-resize target, and required platform states |
layout-grid-and-spacing (you re-compose
hierarchy at each size; you cannot do that without knowing what should dominate).doctrine/references/type-scale-and-spacing.md
(fluid type interpolates between scale steps; it does not invent new ones).doctrine/references/web-performance-budgets-2026.md (CLS ≤ 0.1 in
particular constrains how images and fluid blocks may resize).Start mobile-first, and design — don't reflow. Author the smallest realistic width first
and let layout add structure as space appears (min-width media/container queries only). This
is not just a CSS convention: it forces you to decide what the focal point and hierarchy are
when space is scarcest, which is the honest test of a composition. Per
layout-grid-and-spacing §8, each width is re-composed, never collapsed into one stacked
column of identical cards — that collapse is the single most common responsive slop tell.
Prefer intrinsic, content-driven layout over breakpoints. Most "responsiveness" should need
no breakpoint at all. Let CSS Grid and Flexbox respond to content and available space:
grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)) reflows a card field
from 1 to N columns with zero media queries and never produces a too-narrow column. Reach for an
explicit breakpoint only where the design itself must change (a sidebar appears, a nav becomes
a bar, the focal point moves) — not merely because the screen got wider. See
references/container-queries-and-intrinsic.md.
Make portable components respond to their CONTAINER, not the viewport. A card, media object,
or stat block that appears in several different column widths must adapt to where it is placed.
Viewport media queries cannot do this — the same card is "wide" in a hero and "narrow" in a
4-up grid at the same viewport width. Use container queries: set container-type: inline-size
on the wrapper and switch the component's internal layout with @container (min-width: …).
This is the core modern capability of this skill — define the breakpoint where the component
breaks, intrinsically, regardless of page context. Patterns in
references/container-queries-and-intrinsic.md.
Choose breakpoints from the CONTENT, not from device names. Do not target "iPhone" or
"iPad" widths. Resize until the layout breaks — a line gets too long (>~70–75ch), a column
too narrow to hold its content, a focal point lost — and put a breakpoint there. Keep the set
small (typically 2–4). Express widths in em/rem so breakpoints respect the user's font size.
Full rationale and a starter scale in references/breakpoint-strategy.md.
Make size fluid with clamp() instead of stepping at breakpoints. Type, spacing, and
measure should interpolate smoothly between a floor and a ceiling so the page bends rather than
snapping. Fluid type: font-size: clamp(<min>, <preferred-with-vw>, <max>), where the floor and
ceiling are real steps from doctrine/references/type-scale-and-spacing.md (clamp interpolates
between the scale; it does not replace it). Always set a rem floor and ceiling so text
stays readable on tiny screens and never balloons on ultrawide, and so the user can still zoom
(a pure-vw size defeats zoom — a WCAG 1.4.4 failure). Recipe in references/breakpoint-strategy.md.
Size images and media to prevent layout shift. Every image/video/embed gets an intrinsic
width/height or aspect-ratio so the box is reserved before load — this is what keeps
CLS ≤ 0.1 per doctrine/references/web-performance-budgets-2026.md. Serve responsive
sources (srcset/sizes, AVIF→WebP→fallback) and lazy-load below the fold. A fluid image is
max-width: 100%; height: auto inside an aspect-ratio box. Never resize a block in a way that
reflows content already on screen.
Use logical properties and modern fit functions. Author with inline-size,
margin-inline, padding-block, inset-inline instead of physical width/left/right so
the layout survives RTL and vertical writing modes for free (pairs with
internationalization-and-rtl-design). Constrain measure with width: min(100% - 2rem, 70ch)
and centre content columns with margin-inline: auto; cap line length at ~66ch for body text
regardless of viewport.
Re-decide the focal point and asymmetry at every size — apply progressive enhancement, not
graceful degradation. Carry the authored composition from layout-grid-and-spacing (focal
point, intentional asymmetry, uneven whitespace) into each size. The mobile view is not a
lesser version of desktop: decide what leads on a phone, then enrich as width allows (a margin
column appears, an image bleeds off one edge). Mobile must still have a focal point and tension
— not a flat single-column stack.
Respect user and device preferences as first-class adaptivity. Honour
prefers-reduced-motion (no large fluid motion for those users), prefers-color-scheme, and
coarse-vs-fine pointers (@media (pointer: coarse) → ≥24px / ideally ≥44px touch targets per
doctrine/references/wcag-2.2-criteria.md target-size). Adaptivity is about the person and
context, not only the pixel width.
Run the responsive anti-slop checklist (below). If any item fails, fix before shipping.
For Apple surfaces, test resizable windows, not just device presets. On iOS/iPadOS/macOS and Safari/WebKit, resize through intermediate widths; verify Liquid Glass chrome, safe areas, toolbars, keyboards, popovers, pointer states, and home-screen PWA display modes do not clip, overlap, or hide primary actions.
auto-fit/minmax/clamp) — breakpoints reserved for real
design changes, and there are only a handful.em/rem — not at device-name pixel widths.clamp() with a real rem floor and ceiling; zoom still works (no pure-vw).aspect-ratio/width+height); CLS ≤ 0.1 holds.inline-size, margin-inline…) so RTL/vertical modes work; measure capped ~66ch.prefers-reduced-motion, prefers-color-scheme, and coarse-pointer target sizes honoured.| Condition | Choose | Wrong-choice failure |
|---|---|---|
| A component appears in differently sized parents | Container query at its content failure point | Viewport queries make the same component fail in sidebars or embeds |
| A value can interpolate safely | Bounded clamp() tied to approved scale endpoints | Abrupt jumps feel crude; unbounded fluid values become illegible |
| Structure changes because content no longer fits | Content-derived breakpoint | Device-name breakpoints leave damaging intermediate widths |
| Source order already matches reading/task order | CSS reflow without DOM duplication | Duplicate desktop/mobile markup creates accessibility and state drift |
| Dense information cannot remain useful when stacked | Recompose, prioritise, or provide controlled overflow | Blind one-column stacking destroys comparison and task context |
@media (max-width: 768px) chasing yesterday's iPad instead of
putting the breakpoint where this content actually breaks.max-width queries hand-tuning every element because the base layout
isn't intrinsic; brittle, and it snaps instead of bending.vw font sizing: font-size: 5vw with no floor/ceiling — illegible on small screens,
gigantic on ultrawide, and it breaks browser zoom (WCAG 1.4.4 reflow/zoom failure).Grounds only in human design and web-standards authority — never in an AI tool's responsive
suggestions, per doctrine/design-doctrine.md §2. Canonical sources for this skill:
clamp() math functions,
logical properties) as the standards basis — admissible as standards, not as AI endorsement.03-layout-grid-and-composition/layout-grid-and-spacing (the grid, spacing
unit, focal point, and asymmetry this skill makes responsive).When an AI tool recommends "three max-width breakpoints at 768/1024/1280 with everything
stacking on mobile," treat that as the convergent mean to avoid — not as endorsement.
| Output | Consumer | Evidence and acceptance |
|---|---|---|
| Responsive behaviour specification | Designer and frontend implementer | Intrinsic rules, breakpoints, container queries, fluid ranges, and priority changes are explicit |
| Boundary test matrix | QA and accessibility reviewer | Representative widths/containers and critical states pass without overflow or order defects |
| Release gate record | Approver | Render evidence, performance/accessibility checks, fallbacks, and unresolved risks are recorded |
clamp() floors
and ceilings (tied to the type scale), and how the focal point + asymmetry re-compose at each
size — including the smallest.examples/responsive-grid-template.md.doctrine/design-doctrine.md §0 and within the budgets of
doctrine/references/web-performance-budgets-2026.md.examples/responsive-grid-template.md — a complete, real responsive card grid: intrinsic
auto-fit/minmax reflow, a container-query-driven card that changes its own internal layout
by available width, and fluid type/space via clamp() — annotated against the checklist.doctrine/design-doctrine.md (§0 Mission — "the moat is looking human-made"; §2 sourcing-
authority asymmetry rule).doctrine/references/type-scale-and-spacing.md (the scale steps and spacing unit that fluid
clamp() interpolates between — clamp does not invent sizes).doctrine/references/web-performance-budgets-2026.md (CLS ≤ 0.1, responsive image budgets,
font-display/preload — the constraints fluid sizing and media must respect).doctrine/references/wcag-2.2-criteria.md (1.4.4 zoom/reflow for fluid type; 2.5.8 target size
for coarse-pointer adaptivity).03-layout-grid-and-composition/layout-grid-and-spacing (the grid, spacing unit, focal point,
and intentional asymmetry this skill carries responsively across sizes).references/container-queries-and-intrinsic.md and references/breakpoint-strategy.md.references/modern-css-capability-baseline.md — load when a spec relies on container/style queries,
subgrid, :has(), svh/dvh, view transitions, popover or anchor positioning: dated Baseline
status, carry-versus-enhance rules, and replacements for older layout techniques.references/mobile-web-patterns.md — load when phones in a browser are the main surface: responsive
versus different mobile experience, first-screen rule, sticky actions, tap-to-contact, phone forms,
browser-chrome and keyboard constraints.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub peterbamuhigire/chwezi-design-engine --plugin design-engine110 skills in this plugin
/accessibility-wcag-2-2-complianceUse when designing or auditing an interactive UI for WCAG 2.2 AA, keyboard and focus behaviour, accessible names, screen readers, target size, reflow, authentication, or reduced motion. Use inclusive-and-assistive-design for needs beyond the compliance floor./accessible-color-and-contrastUse when verifying or fixing text, UI, focus, border, status, or data colours for contrast and colour-vision accessibility. Unlike color-system-and-palette, this is the focused WCAG/APCA and non-colour-cue gate, not palette creation./advertising-creative-art-direction