Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
One-time setup that gathers your project's design context and saves it to CLAUDE.md for future sessions.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
reference/adapt.md
1> **Additional context needed**: target platforms/devices and usage contexts.23Adapt an existing design to a different context: another screen size, device, platform, or use case. The trap is treating adaptation as scaling. The job is rethinking the experience for the new context.456---78## Assess Adaptation Challenge910Understand what needs adaptation and why:11121. **Identify the source context**:13- What was it designed for originally? (Desktop web? Mobile app?)14- What assumptions were made? (Large screen? Mouse input? Fast connection?)15- What works well in current context?16172. **Understand target context**:18- **Device**: Mobile, tablet, desktop, TV, watch, print?19- **Input method**: Touch, mouse, keyboard, voice, gamepad?20- **Screen constraints**: Size, resolution, orientation?21- **Connection**: Fast wifi, slow 3G, offline?22- **Usage context**: On-the-go vs desk, quick glance vs focused reading?23- **User expectations**: What do users expect on this platform?24253. **Identify adaptation challenges**:26- What won't fit? (Content, navigation, features)27- What won't work? (Hover states on touch, tiny touch targets)28- What's inappropriate? (Desktop patterns on mobile, mobile patterns on desktop)2930**CRITICAL**: Adaptation is rethinking the experience for the new context, not scaling pixels.3132## Plan Adaptation Strategy3334Create context-appropriate strategy:3536### Mobile Adaptation (Desktop → Mobile)3738**Layout Strategy**:39- Single column instead of multi-column40- Vertical stacking instead of side-by-side41- Full-width components instead of fixed widths42- Bottom navigation instead of top/side navigation4344**Interaction Strategy**:45- Touch targets 44x44px minimum (not hover-dependent)46- Swipe gestures where appropriate (lists, carousels)47- Bottom sheets instead of dropdowns48- Thumbs-first design (controls within thumb reach)49- Larger tap areas with more spacing5051**Content Strategy**:52- Progressive disclosure (don't show everything at once)53- Prioritize primary content (secondary content in tabs/accordions)54- Shorter text (more concise)55- Larger text (16px minimum)5657**Navigation Strategy**:58- Hamburger menu or bottom navigation59- Reduce navigation complexity60- Sticky headers for context61- Back button in navigation flow6263### Tablet Adaptation (Hybrid Approach)6465**Layout Strategy**:66- Two-column layouts (not single or three-column)67- Side panels for secondary content68- Master-detail views (list + detail)69- Adaptive based on orientation (portrait vs landscape)7071**Interaction Strategy**:72- Support both touch and pointer73- Touch targets 44x44px but allow denser layouts than phone74- Side navigation drawers75- Multi-column forms where appropriate7677### Desktop Adaptation (Mobile → Desktop)7879**Layout Strategy**:80- Multi-column layouts (use horizontal space)81- Side navigation always visible82- Multiple information panels simultaneously83- Fixed widths with max-width constraints (don't stretch to 4K)8485**Interaction Strategy**:86- Hover states for additional information87- Keyboard shortcuts88- Right-click context menus89- Drag and drop where helpful90- Multi-select with Shift/Cmd9192**Content Strategy**:93- Show more information upfront (less progressive disclosure)94- Data tables with many columns95- Richer visualizations96- More detailed descriptions9798### Print Adaptation (Screen → Print)99100**Layout Strategy**:101- Page breaks at logical points102- Remove navigation, footer, interactive elements103- Black and white (or limited color)104- Proper margins for binding105106**Content Strategy**:107- Expand shortened content (show full URLs, hidden sections)108- Add page numbers, headers, footers109- Include metadata (print date, page title)110- Convert charts to print-friendly versions111112### Email Adaptation (Web → Email)113114**Layout Strategy**:115- Narrow width (600px max)116- Single column only117- Inline CSS (no external stylesheets)118- Table-based layouts (for email client compatibility)119120**Interaction Strategy**:121- Large, obvious CTAs (buttons not text links)122- No hover states (not reliable)123- Deep links to web app for complex interactions124125## Implement Adaptations126127Apply changes systematically:128129### Responsive Breakpoints130131Choose appropriate breakpoints:132- Mobile: 320px-767px133- Tablet: 768px-1023px134- Desktop: 1024px+135- Or content-driven breakpoints (where design breaks)136137### Layout Adaptation Techniques138139- **CSS Grid/Flexbox**: Reflow layouts automatically140- **Container Queries**: Adapt based on container, not viewport141- **`clamp()`**: Fluid sizing between min and max142- **Media queries**: Different styles for different contexts143- **Display properties**: Show/hide elements per context144145### Touch Adaptation146147- Increase touch target sizes (44x44px minimum)148- Add more spacing between interactive elements149- Remove hover-dependent interactions150- Add touch feedback (ripples, highlights)151- Consider thumb zones (easier to reach bottom than top)152153### Content Adaptation154155- Use `display: none` sparingly (still downloads)156- Progressive enhancement (core content first, enhancements on larger screens)157- Lazy loading for off-screen content158- Responsive images (`srcset`, `picture` element)159160### Navigation Adaptation161162- Transform complex nav to hamburger/drawer on mobile163- Bottom nav bar for mobile apps164- Persistent side navigation on desktop165- Breadcrumbs on smaller screens for context166167**IMPORTANT**: Test on real devices. Device emulation in DevTools is helpful but not perfect.168169**NEVER**:170- Hide core functionality on mobile (if it matters, make it work)171- Assume desktop = powerful device (consider accessibility, older machines)172- Use different information architecture across contexts (confusing)173- Break user expectations for platform (mobile users expect mobile patterns)174- Forget landscape orientation on mobile/tablet175- Use generic breakpoints blindly (use content-driven breakpoints)176- Ignore touch on desktop (many desktop devices have touch)177178## Verify Adaptations179180Test thoroughly across contexts:181182- **Real devices**: Test on actual phones, tablets, desktops183- **Different orientations**: Portrait and landscape184- **Different browsers**: Safari, Chrome, Firefox, Edge185- **Different OS**: iOS, Android, Windows, macOS186- **Different input methods**: Touch, mouse, keyboard187- **Edge cases**: Very small screens (320px), very large screens (4K)188- **Slow connections**: Test on throttled network189190When the adaptation feels native to each context, hand off to `$impeccable polish` for the final pass.191192---193194## Reference Material195196The sections below were previously `responsive-design.md` and live inline now so the adapt flow has its deep responsive reference in one place.197198### Responsive Design199200#### Mobile-First: Write It Right201202Start with base styles for mobile, use `min-width` queries to layer complexity. Desktop-first (`max-width`) means mobile loads unnecessary styles first.203204#### Breakpoints: Content-Driven205206Don't chase device sizes; let content tell you where to break. Start narrow, stretch until design breaks, add breakpoint there. Three breakpoints usually suffice (640, 768, 1024px). Use `clamp()` for fluid values without breakpoints.207208#### Detect Input Method, Not Just Screen Size209210**Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard. Use pointer and hover queries:211212```css213/* Fine pointer (mouse, trackpad) */214@media (pointer: fine) {215.button { padding: 8px 16px; }216}217218/* Coarse pointer (touch, stylus) */219@media (pointer: coarse) {220.button { padding: 12px 20px; } /* Larger touch target */221}222223/* Device supports hover */224@media (hover: hover) {225.card:hover { transform: translateY(-2px); }226}227228/* Device doesn't support hover (touch) */229@media (hover: none) {230.card { /* No hover state - use active instead */ }231}232```233234**Critical**: Don't rely on hover for functionality. Touch users can't hover.235236#### Safe Areas: Handle the Notch237238Modern phones have notches, rounded corners, and home indicators. Use `env()`:239240```css241body {242padding-top: env(safe-area-inset-top);243padding-bottom: env(safe-area-inset-bottom);244padding-left: env(safe-area-inset-left);245padding-right: env(safe-area-inset-right);246}247248/* With fallback */249.footer {250padding-bottom: max(1rem, env(safe-area-inset-bottom));251}252```253254**Enable viewport-fit** in your meta tag:255```html256<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">257```258259#### Responsive Images: Get It Right260261##### srcset with Width Descriptors262263```html264<img265src="hero-800.jpg"266srcset="267hero-400.jpg 400w,268hero-800.jpg 800w,269hero-1200.jpg 1200w270"271sizes="(max-width: 768px) 100vw, 50vw"272alt="Hero image"273>274```275276**How it works**:277- `srcset` lists available images with their actual widths (`w` descriptors)278- `sizes` tells the browser how wide the image will display279- Browser picks the best file based on viewport width AND device pixel ratio280281##### Picture Element for Art Direction282283When you need different crops/compositions (not just resolutions):284285```html286<picture>287<source media="(min-width: 768px)" srcset="wide.jpg">288<source media="(max-width: 767px)" srcset="tall.jpg">289<img src="fallback.jpg" alt="...">290</picture>291```292293#### Layout Adaptation Patterns294295**Navigation**: Three stages: hamburger + drawer on mobile, horizontal compact on tablet, full with labels on desktop. **Tables**: Transform to cards on mobile using `display: block` and `data-label` attributes. **Progressive disclosure**: Use `<details>/<summary>` for content that can collapse on mobile.296297#### Testing: Don't Trust DevTools Alone298299DevTools device emulation is useful for layout but misses:300301- Actual touch interactions302- Real CPU/memory constraints303- Network latency patterns304- Font rendering differences305- Browser chrome/keyboard appearances306307**Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.308309---310311**Avoid**: Desktop-first design. Device detection instead of feature detection. Separate mobile/desktop codebases. Ignoring tablet and landscape. Assuming all mobile devices are powerful.312