[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B9CV33SM9AHTG2ST0AAENX":3,"skill-same:01M7B9CV33SM9AHTG2ST0AAENX":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7B9CV33SM9AHTG2ST0AAENX","refactoring-ui",null,"Audit and fix visual hierarchy, spacing, color, and depth in web UIs. Use when the user mentions \"my UI looks off\" (or amateur\u002Funprofessional), \"fix the design\", \"Tailwind styling\", \"color palette\", \"visual hierarchy\", \"design system\", \"spacing scale\", or \"component styling\". Also trigger when building consistent design tokens, creating dark mode themes, improving data-visualization clarity, or polishing UI details before launch. Covers grayscale-first workflow, constrained design scales, shadows, and component styling. For typeface selection, see web-typography. For usability audits, see ux-heuristics.","Div0011\u002FFrontend-Pipeline","Div0011","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F198384399?v=4","01M7AX16GDZ3959RM6WMDTTFV4","Div","01M7AX16HF6EPV40MA8G0G0JRC",0,"MIT","https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Frefactoring-ui\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: refactoring-ui\ndescription: 'Audit and fix visual hierarchy, spacing, color, and depth in web UIs. Use when the user mentions \"my UI looks off\" (or amateur\u002Funprofessional), \"fix the design\", \"Tailwind styling\", \"color palette\", \"visual hierarchy\", \"design system\", \"spacing scale\", or \"component styling\". Also trigger when building consistent design tokens, creating dark mode themes, improving data-visualization clarity, or polishing UI details before launch. Covers grayscale-first workflow, constrained design scales, shadows, and component styling. For typeface selection, see web-typography. For usability audits, see ux-heuristics.'\nlicense: MIT\nmetadata:\n  author: wondelai\n  version: \"1.5.0\"\n---\n\n# Refactoring UI Design System\n\nA practical, opinionated approach to UI design. Apply these principles when generating frontend code, reviewing designs, or advising on visual improvements.\n\n## Core Principle\n\n**Design in grayscale first. Add color last.** This forces proper hierarchy through spacing, contrast, and typography before relying on color as a crutch.\n\n**The foundation:** Great UI isn't about talent — it's about systems. Constrained scales for spacing, type, color, and shadows produce consistently professional results. Start with too much white space and remove; leave details (icons, shadows, micro-interactions) until layout and hierarchy work.\n\n## Scoring\n\n**Goal: 10\u002F10.** Score by counting satisfied rows in the [Quick Diagnostic](#quick-diagnostic) (8 yes\u002Fno checks): `score = round(satisfied \u002F 8 × 10)`. Bands follow directly: **10** = all 8 pass (hierarchy reads blurred and in grayscale, every value on a scale); **9** = exactly 1 gap (usually weak hierarchy or thin white space); **6-8** = 2-3 gaps; **\u003C=5** = 4+ gaps (arbitrary spacing, color doing the work hierarchy should, or failing contrast). Always state the current score and the specific diagnostic rows to fix to reach 10\u002F10.\n\n## The Refactoring UI Framework\n\nSeven principles for building professional interfaces without a designer:\n\n### 1. Visual Hierarchy\n\n**Core concept:** Not everything can be important. Create hierarchy through three levers: size, weight, and color.\n\n**Why it works:** When every element competes for attention, nothing stands out; deliberately de-emphasizing secondary content makes primary content powerful by contrast.\n\n**Key insights:**\n- Combine levers, don't multiply — primary text = large OR bold OR dark, not all three; save \"all three\" for the single most important element\n- Labels are secondary — form labels, table headers, and metadata support the data, not compete with it; make them smaller, lighter, or uppercase-small\n- Semantic color ≠ visual weight — a muted secondary button often beats screaming red for routine destructive actions\n\n**Product applications:**\n\n| Context | Hierarchy Technique | Example |\n|---------|---------------------|---------|\n| **Form fields** | De-emphasize labels, emphasize values | Small uppercase label above large value |\n| **Dashboards** | Key metric large, context small | \"$42,300\" large, \"vs last month\" small |\n| **Tables** | De-emphasize headers, emphasize data | Headers uppercase small gray, data normal |\n\n**Design patterns:**\n- Three-level hierarchy: Size (large\u002Fbase\u002Fsmall), Weight (bold\u002Fmedium\u002Fnormal), Color (dark\u002Fmedium\u002Flight gray)\n- Button hierarchy: primary (filled), secondary (outlined or muted), tertiary (text only)\n\n**Ethical boundary:** Don't use hierarchy tricks to hide important information like pricing, terms, or cancellation options.\n\nSee [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) when designing components beyond static layout — interaction\u002Fhover\u002Ffocus states, form design, empty states, border-radius systems, text truncation, and responsive breakpoints.\n\n### 2. Spacing & Sizing\n\n**Core concept:** Use a constrained spacing scale, not arbitrary values. Spacing defines relationships — closer elements read as more related.\n\n**Why it works:** Arbitrary spacing (padding: 13px) creates inconsistency; a fixed scale forces deliberate decisions and harmonious layouts. Generous spacing feels premium; dense feels overwhelming.\n\n**Key insights:**\n- Use the scale: 4, 8, 16, 24, 32, 48, 64px\n- Start with too much white space, then remove — you'll almost never remove enough\n- Spacing between groups must exceed spacing within groups\n- Constrain widths: text to 45-75 characters (`max-w-prose`), forms to 300-500px; full-width is almost never right\n\n**Product applications:**\n\n| Context | Spacing Strategy | Example |\n|---------|-----------------|---------|\n| **Icon + label** | Tight coupling (4px) | Small gap keeps them connected |\n| **Card sections** | Section separation (24px) | Title, content, footer blocks |\n| **Page sections** | Major sections (48-64px) | Hero, features, testimonials |\n\n**CSS patterns:**\n- `p-1`(4px) `p-2`(8px) `p-4`(16px) `p-6`(24px) `p-8`(32px) `p-12`(48px) `p-16`(64px)\n- `max-w-prose`(65ch) `max-w-md`(28rem) `max-w-lg`(32rem) `max-w-xl`(36rem)\n- `gap-2` for related items, `gap-6` for section separation\n\n### 3. Typography\n\n**Core concept:** Use a modular type scale, constrain line heights by context, and limit to two font families maximum.\n\n**Why it works:** A modular scale (steps growing ~1.2× each) creates natural visual rhythm; tight line heights on headings and relaxed on body text improve readability in each context.\n\n**Key insights:**\n- Scale: 12, 14, 16, 18, 20, 24, 30, 36px (~1.2 modular, hand-tuned)\n- Headings: tight line height (1.0-1.25); body: relaxed (1.5-1.75); wider text needs more line height\n- Avoid weights below 400 for body text; use bold (600-700) for emphasis, not everything\n- Two fonts max: one for headings, one for body (or one family with weight variation)\n\n**Product applications:**\n\n| Context | Typography Rule | Example |\n|---------|----------------|---------|\n| **Hero headline** | 36px, line-height 1.1, bold | Large impactful statement |\n| **Body text** | 16px, line-height 1.75, normal | Comfortable reading |\n| **Captions\u002Flabels** | 12-14px, line-height 1.5, medium gray | Secondary information |\n\n**CSS patterns:**\n- `text-xs`(12px) `text-sm`(14px) `text-base`(16px) `text-lg`(18px) `text-xl`(20px)\n- `font-normal`(400) `font-medium`(500) `font-semibold`(600) `font-bold`(700)\n- `leading-tight`(1.25) `leading-normal`(1.5) `leading-relaxed`(1.75)\n\n### 4. Color\n\n**Core concept:** Build a systematic palette with 5-9 shades per color, add subtle saturation to grays, and design in grayscale first.\n\n**Why it works:** Random colors clash; a predefined shade system ensures consistency, and HSL adjustments create natural-feeling lighter and darker variants.\n\n**Key insights:**\n- Each color needs 5-9 shades from near-white to near-black (50-900); darkest is not pure black — use `#111827`, not `#000000`\n- Pure grays look lifeless — tint them (cool UI: blue like `#64748b`; warm UI: yellow\u002Fbrown like `#78716c`)\n- HSL: lighter = raise lightness, lower saturation, hue toward 60°; darker = the reverse, hue toward 0°\u002F240°\n- Contrast minimums: 4.5:1 body text, 3:1 large text (18px+); use `#374151` (gray-700) on white, not lighter grays\n\n**Product applications:**\n\n| Context | Color Strategy | Example |\n|---------|---------------|---------|\n| **Primary palette** | 9 shades (50-900) of brand color | Blue-500 buttons, Blue-100 backgrounds |\n| **Semantic colors** | Success\u002Fwarning\u002Ferror with shade ranges | Green-500 success, Red-500 errors |\n| **Text colors** | Three levels: dark, medium, light | `text-gray-900`, `text-gray-600`, `text-gray-400` |\n\n**CSS patterns:**\n- `text-gray-900`(dark) `text-gray-600`(medium) `text-gray-400`(light)\n- `bg-blue-50` for subtle backgrounds, `bg-blue-500` for primary actions\n- `border-gray-200` for subtle borders, `border-gray-300` for stronger\n\nSee [references\u002Ftheming-dark-mode.md](references\u002Ftheming-dark-mode.md) when building a dark theme — hex shade scales, why darkest is `#111827` not black (halation), and conveying elevation via lightness instead of shadow. See [references\u002Faccessibility-depth.md](references\u002Faccessibility-depth.md) when contrast, focus rings, keyboard nav, or screen-reader support is in scope — full WCAG 2.1 AA checklist and fixes.\n\n### 5. Depth & Shadows\n\n**Core concept:** Use a shadow scale to convey elevation — small shadows for slightly raised elements, large shadows for floating ones.\n\n**Why it works:** The eye reads shadow size as height above the page; a consistent scale makes elevation legible, so users intuit what's interactive, floating, or background.\n\n**Key insights:**\n- Small shadows = raised slightly (buttons, cards); large = floating (modals, dropdowns)\n- Good shadows have two parts: a tight dark shadow for crispness plus a larger soft one for atmosphere\n- Depth without shadows: lighter top border + darker bottom border, subtle gradients, overlapping elements\n- Don't overuse — if everything floats, nothing has depth; shadow color is transparent dark, never opaque gray\n\n**Product applications:**\n\n| Context | Shadow Level | Example |\n|---------|-------------|---------|\n| **Buttons** | `shadow-sm` (subtle raise) | Slightly elevated above surface |\n| **Dropdowns** | `shadow-lg` (floating) | Menu clearly above content |\n| **Modals** | `shadow-xl` (highest) | Overlay detached from page |\n\n**CSS patterns:**\n- `shadow-sm`: `0 1px 2px rgba(0,0,0,0.05)`\n- `shadow-md`: `0 4px 6px rgba(0,0,0,0.1)`\n- `shadow-lg`: `0 10px 15px rgba(0,0,0,0.1)`\n- `shadow-xl`: `0 20px 25px rgba(0,0,0,0.15)`\n\nSee [references\u002Fanimation-microinteractions.md](references\u002Fanimation-microinteractions.md) when adding motion to interactive elements — durations, easing curves, loading states, and the `prefers-reduced-motion` rule.\n\n### 6. Images & Icons\n\n**Core concept:** Treat images as design elements, not afterthoughts. Size icons deliberately and use overlays to keep text readable on images.\n\n**Why it works:** Poorly sized icons look awkward and unstyled images break consistency; deliberate treatment (overlays, object-fit, radius) makes interfaces feel polished.\n\n**Key insights:**\n- Size icons relative to context; use sets with consistent stroke width and style\n- Never stretch or distort — use `object-fit: cover` with fixed aspect ratios and crop deliberately\n- Text over images needs an overlay (semi-transparent gradient)\n- Empty states are an opportunity — use illustrations plus a clear CTA, not just text\n\n**Product applications:**\n\n| Context | Image\u002FIcon Technique | Example |\n|---------|---------------------|---------|\n| **Hero images** | Semi-transparent gradient overlay | Text readable over any photo |\n| **Avatars** | Consistent size, rounded, fallback initials | 40px circle, object-fit cover |\n| **Empty states** | Custom illustration + CTA | Friendly illustration with \"Get started\" |\n\n**CSS patterns:**\n- `object-fit: cover` with fixed `aspect-ratio` for consistent display\n- Icon sizing: `w-4 h-4` inline, `w-6 h-6` navigation, `w-8 h-8` feature icons\n- Overlay: `bg-gradient-to-t from-black\u002F60 to-transparent` for text on images\n\n### 7. Layout & Composition\n\n**Core concept:** Don't center everything. Use alignment, overlap, and emphasis variation to create engaging compositions.\n\n**Why it works:** A consistent left edge gives the eye a fixed return point per line, so it costs less to scan; centered multi-line text moves that edge every line and slows reading.\n\n**Key insights:**\n- Left-align by default; center only short headlines, heroes, single-action CTAs, and empty states\n- Cards don't need to contain everything — let images bleed to edges or overlap containers\n- Vary visual treatment in lists and feeds — feature some items, minimize others\n- Use alignment to create relationships between unrelated elements\n\n**Product applications:**\n\n| Context | Layout Strategy | Example |\n|---------|----------------|---------|\n| **Hero sections** | Centered text, generous spacing | Short headline + subtext + single CTA |\n| **Blog feeds** | Varied card sizes for emphasis | First post large, rest in 2-column grid |\n| **Content pages** | Constrained width, left-aligned | `max-w-prose` container with left text |\n\n**CSS patterns:**\n- `text-left` by default, `text-center` only for heroes and short headlines\n- `grid grid-cols-3 gap-6` for feature grids; `max-w-4xl mx-auto` for page containers\n- `overflow-hidden` on cards with `object-fit: cover` images that bleed to edges\n\nSee [references\u002Fdata-visualization.md](references\u002Fdata-visualization.md) when laying out charts, tables, or dashboards — chart-type selection, color use in charts, table density, and dashboard composition.\n\n## Common Mistakes\n\n| Mistake | Why It Fails | Fix |\n|---------|-------------|------|\n| **\"Looks amateur\"** | Insufficient white space, unconstrained widths | More white space, constrain content widths |\n| **\"Feels flat\"** | No depth differentiation | Subtle shadows, border-bottom on sections |\n| **\"Text is hard to read\"** | Poor line-height, too wide, low contrast | Increase line-height, constrain width, boost contrast |\n| **\"Everything looks the same\"** | No visual hierarchy | Vary size\u002Fweight\u002Fcolor between primary and secondary |\n| **\"Feels cluttered\"** | Equal spacing everywhere | Group related items, larger gaps between groups |\n| **\"Colors clash\"** | Random choices, no system | Reduce saturation, more grays, limit to palette |\n| **\"Buttons don't pop\"** | Low contrast with surroundings | Increase contrast, add shadow |\n| **Arbitrary values** | px values like 13, 17, 23 breed inconsistency | Stick to the spacing and type scales |\n\n## Quick Diagnostic\n\nAudit any UI design:\n\n| Question | If No | Action |\n|----------|-------|--------|\n| Does hierarchy read when squinting (blur test)? | Elements competing | Increase primary\u002Fsecondary contrast |\n| Does it work in grayscale? | Color is a crutch | Strengthen size\u002Fweight\u002Fspacing hierarchy |\n| Is there enough white space? | Probably not — most designs are too dense | Increase spacing, especially between groups |\n| Are labels de-emphasized vs. values? | Labels competing with data | Smaller, lighter, or uppercase-small labels |\n| Does spacing follow a consistent scale? | Arbitrary spacing = visual noise | Use 4\u002F8\u002F16\u002F24\u002F32\u002F48\u002F64 only |\n| Is text width constrained? | Long lines fatigue readers | Apply `max-w-prose` (~65ch) |\n| Do colors have sufficient contrast? | Accessibility failure | WCAG-check; use gray-700+ on white |\n| Are shadows appropriate for elevation? | Elements float at wrong level | Match shadow scale to element purpose |\n\n## Further Reading\n\nFor the complete system with visual before\u002Fafter examples:\n\n- [*\"Refactoring UI\"*](https:\u002F\u002Fwww.amazon.com\u002FRefactoring-UI-Adam-Wathan\u002Fdp\u002FB0BLJ7MC21?tag=wondelai00-20) by Adam Wathan & Steve Schoger (the full book with hundreds of visual examples)\n- [*\"The Design of Everyday Things\"*](https:\u002F\u002Fwww.amazon.com\u002FDesign-Everyday-Things-Revised-Expanded\u002Fdp\u002F0465050654?tag=wondelai00-20) by Don Norman (foundational design thinking and usability)\n- [*\"Don't Make Me Think\"*](https:\u002F\u002Fwww.amazon.com\u002FDont-Make-Think-Revisited-Usability\u002Fdp\u002F0321965515?tag=wondelai00-20) by Steve Krug (web usability principles that complement Refactoring UI)\n- [Refactoring UI](https:\u002F\u002Fwww.refactoringui.com\u002F) — Official site with resources and examples\n\n## About the Authors\n\n**Adam Wathan**, creator of Tailwind CSS, and **Steve Schoger**, the visual designer behind its design language, wrote *Refactoring UI* to teach developers systematic, repeatable design techniques. Their approach replaces artistic talent with constrained systems — fixed scales for spacing, typography, color, and shadows — that produce professional results.\n","# Refactoring UI Design System\n\nA practical, opinionated approach to UI design. Apply these principles when generating frontend code, reviewing designs, or advising on visual improvements.\n\n## Core Principle\n\n**Design in grayscale first. Add color last.** This forces proper hierarchy through spacing, contrast, and typography before relying on color as a crutch.\n\n**The foundation:** Great UI isn't about talent — it's about systems. Constrained scales for spacing, type, color, and shadows produce consistently professional results. Start with too much white space and remove; leave details (icons, shadows, micro-interactions) until layout and hierarchy work.\n\n## Scoring\n\n**Goal: 10\u002F10.** Score by counting satisfied rows in the [Quick Diagnostic](#quick-diagnostic) (8 yes\u002Fno checks): `score = round(satisfied \u002F 8 × 10)`. Bands follow directly: **10** = all 8 pass (hierarchy reads blurred and in grayscale, every value on a scale); **9** = exactly 1 gap (usually weak hierarchy or thin white space); **6-8** = 2-3 gaps; **\u003C=5** = 4+ gaps (arbitrary spacing, color doing the work hierarchy should, or failing contrast). Always state the current score and the specific diagnostic rows to fix to reach 10\u002F10.\n\n## The Refactoring UI Framework\n\nSeven principles for building professional interfaces without a designer:\n\n### 1. Visual Hierarchy\n\n**Core concept:** Not everything can be important. Create hierarchy through three levers: size, weight, and color.\n\n**Why it works:** When every element competes for attention, nothing stands out; deliberately de-emphasizing secondary content makes primary content powerful by contrast.\n\n**Key insights:**\n- Combine levers, don't multiply — primary text = large OR bold OR dark, not all three; save \"all three\" for the single most important element\n- Labels are secondary — form labels, table headers, and metadata support the data, not compete with it; make them smaller, lighter, or uppercase-small\n- Semantic color ≠ visual weight — a muted secondary button often beats screaming red for routine destructive actions\n\n**Product applications:**\n\n| Context | Hierarchy Technique | Example |\n|---------|---------------------|---------|\n| **Form fields** | De-emphasize labels, emphasize values | Small uppercase label above large value |\n| **Dashboards** | Key metric large, context small | \"$42,300\" large, \"vs last month\" small |\n| **Tables** | De-emphasize headers, emphasize data | Headers uppercase small gray, data normal |\n\n**Design patterns:**\n- Three-level hierarchy: Size (large\u002Fbase\u002Fsmall), Weight (bold\u002Fmedium\u002Fnormal), Color (dark\u002Fmedium\u002Flight gray)\n- Button hierarchy: primary (filled), secondary (outlined or muted), tertiary (text only)\n\n**Ethical boundary:** Don't use hierarchy tricks to hide important information like pricing, terms, or cancellation options.\n\nSee [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) when designing components beyond static layout — interaction\u002Fhover\u002Ffocus states, form design, empty states, border-radius systems, text truncation, and responsive breakpoints.\n\n### 2. Spacing & Sizing\n\n**Core concept:** Use a constrained spacing scale, not arbitrary values. Spacing defines relationships — closer elements read as more related.\n\n**Why it works:** Arbitrary spacing (padding: 13px) creates inconsistency; a fixed scale forces deliberate decisions and harmonious layouts. Generous spacing feels premium; dense feels overwhelming.\n\n**Key insights:**\n- Use the scale: 4, 8, 16, 24, 32, 48, 64px\n- Start with too much white space, then remove — you'll almost never remove enough\n- Spacing between groups must exceed spacing within groups\n- Constrain widths: text to 45-75 characters (`max-w-prose`), forms to 300-500px; full-width is almost never right\n\n**Product applications:**\n\n| Context | Spacing Strategy | Example |\n|---------|-----------------|---------|\n| **Icon + label** | Tight coupling (4px) | Small gap keeps them connected |\n| **Card sections** | Section separation (24px) | Title, content, footer blocks |\n| **Page sections** | Major sections (48-64px) | Hero, features, testimonials |\n\n**CSS patterns:**\n- `p-1`(4px) `p-2`(8px) `p-4`(16px) `p-6`(24px) `p-8`(32px) `p-12`(48px) `p-16`(64px)\n- `max-w-prose`(65ch) `max-w-md`(28rem) `max-w-lg`(32rem) `max-w-xl`(36rem)\n- `gap-2` for related items, `gap-6` for section separation\n\n### 3. Typography\n\n**Core concept:** Use a modular type scale, constrain line heights by context, and limit to two font families maximum.\n\n**Why it works:** A modular scale (steps growing ~1.2× each) creates natural visual rhythm; tight line heights on headings and relaxed on body text improve readability in each context.\n\n**Key insights:**\n- Scale: 12, 14, 16, 18, 20, 24, 30, 36px (~1.2 modular, hand-tuned)\n- Headings: tight line height (1.0-1.25); body: relaxed (1.5-1.75); wider text needs more line height\n- Avoid weights below 400 for body text; use bold (600-700) for emphasis, not everything\n- Two fonts max: one for headings, one for body (or one family with weight variation)\n\n**Product applications:**\n\n| Context | Typography Rule | Example |\n|---------|----------------|---------|\n| **Hero headline** | 36px, line-height 1.1, bold | Large impactful statement |\n| **Body text** | 16px, line-height 1.75, normal | Comfortable reading |\n| **Captions\u002Flabels** | 12-14px, line-height 1.5, medium gray | Secondary information |\n\n**CSS patterns:**\n- `text-xs`(12px) `text-sm`(14px) `text-base`(16px) `text-lg`(18px) `text-xl`(20px)\n- `font-normal`(400) `font-medium`(500) `font-semibold`(600) `font-bold`(700)\n- `leading-tight`(1.25) `leading-normal`(1.5) `leading-relaxed`(1.75)\n\n### 4. Color\n\n**Core concept:** Build a systematic palette with 5-9 shades per color, add subtle saturation to grays, and design in grayscale first.\n\n**Why it works:** Random colors clash; a predefined shade system ensures consistency, and HSL adjustments create natural-feeling lighter and darker variants.\n\n**Key insights:**\n- Each color needs 5-9 shades from near-white to near-black (50-900); darkest is not pure black — use `#111827`, not `#000000`\n- Pure grays look lifeless — tint them (cool UI: blue like `#64748b`; warm UI: yellow\u002Fbrown like `#78716c`)\n- HSL: lighter = raise lightness, lower saturation, hue toward 60°; darker = the reverse, hue toward 0°\u002F240°\n- Contrast minimums: 4.5:1 body text, 3:1 large text (18px+); use `#374151` (gray-700) on white, not lighter grays\n\n**Product applications:**\n\n| Context | Color Strategy | Example |\n|---------|---------------|---------|\n| **Primary palette** | 9 shades (50-900) of brand color | Blue-500 buttons, Blue-100 backgrounds |\n| **Semantic colors** | Success\u002Fwarning\u002Ferror with shade ranges | Green-500 success, Red-500 errors |\n| **Text colors** | Three levels: dark, medium, light | `text-gray-900`, `text-gray-600`, `text-gray-400` |\n\n**CSS patterns:**\n- `text-gray-900`(dark) `text-gray-600`(medium) `text-gray-400`(light)\n- `bg-blue-50` for subtle backgrounds, `bg-blue-500` for primary actions\n- `border-gray-200` for subtle borders, `border-gray-300` for stronger\n\nSee [references\u002Ftheming-dark-mode.md](references\u002Ftheming-dark-mode.md) when building a dark theme — hex shade scales, why darkest is `#111827` not black (halation), and conveying elevation via lightness instead of shadow. See [references\u002Faccessibility-depth.md](references\u002Faccessibility-depth.md) when contrast, focus rings, keyboard nav, or screen-reader support is in scope — full WCAG 2.1 AA checklist and fixes.\n\n### 5. Depth & Shadows\n\n**Core concept:** Use a shadow scale to convey elevation — small shadows for slightly raised elements, large shadows for floating ones.\n\n**Why it works:** The eye reads shadow size as height above the page; a consistent scale makes elevation legible, so users intuit what's interactive, floating, or background.\n\n**Key insights:**\n- Small shadows = raised slightly (buttons, cards); large = floating (modals, dropdowns)\n- Good shadows have two parts: a tight dark shadow for crispness plus a larger soft one for atmosphere\n- Depth without shadows: lighter top border + darker bottom border, subtle gradients, overlapping elements\n- Don't overuse — if everything floats, nothing has depth; shadow color is transparent dark, never opaque gray\n\n**Product applications:**\n\n| Context | Shadow Level | Example |\n|---------|-------------|---------|\n| **Buttons** | `shadow-sm` (subtle raise) | Slightly elevated above surface |\n| **Dropdowns** | `shadow-lg` (floating) | Menu clearly above content |\n| **Modals** | `shadow-xl` (highest) | Overlay detached from page |\n\n**CSS patterns:**\n- `shadow-sm`: `0 1px 2px rgba(0,0,0,0.05)`\n- `shadow-md`: `0 4px 6px rgba(0,0,0,0.1)`\n- `shadow-lg`: `0 10px 15px rgba(0,0,0,0.1)`\n- `shadow-xl`: `0 20px 25px rgba(0,0,0,0.15)`\n\nSee [references\u002Fanimation-microinteractions.md](references\u002Fanimation-microinteractions.md) when adding motion to interactive elements — durations, easing curves, loading states, and the `prefers-reduced-motion` rule.\n\n### 6. Images & Icons\n\n**Core concept:** Treat images as design elements, not afterthoughts. Size icons deliberately and use overlays to keep text readable on images.\n\n**Why it works:** Poorly sized icons look awkward and unstyled images break consistency; deliberate treatment (overlays, object-fit, radius) makes interfaces feel polished.\n\n**Key insights:**\n- Size icons relative to context; use sets with consistent stroke width and style\n- Never stretch or distort — use `object-fit: cover` with fixed aspect ratios and crop deliberately\n- Text over images needs an overlay (semi-transparent gradient)\n- Empty states are an opportunity — use illustrations plus a clear CTA, not just text\n\n**Product applications:**\n\n| Context | Image\u002FIcon Technique | Example |\n|---------|---------------------|---------|\n| **Hero images** | Semi-transparent gradient overlay | Text readable over any photo |\n| **Avatars** | Consistent size, rounded, fallback initials | 40px circle, object-fit cover |\n| **Empty states** | Custom illustration + CTA | Friendly illustration with \"Get started\" |\n\n**CSS patterns:**\n- `object-fit: cover` with fixed `aspect-ratio` for consistent display\n- Icon sizing: `w-4 h-4` inline, `w-6 h-6` navigation, `w-8 h-8` feature icons\n- Overlay: `bg-gradient-to-t from-black\u002F60 to-transparent` for text on images\n\n### 7. Layout & Composition\n\n**Core concept:** Don't center everything. Use alignment, overlap, and emphasis variation to create engaging compositions.\n\n**Why it works:** A consistent left edge gives the eye a fixed return point per line, so it costs less to scan; centered multi-line text moves that edge every line and slows reading.\n\n**Key insights:**\n- Left-align by default; center only short headlines, heroes, single-action CTAs, and empty states\n- Cards don't need to contain everything — let images bleed to edges or overlap containers\n- Vary visual treatment in lists and feeds — feature some items, minimize others\n- Use alignment to create relationships between unrelated elements\n\n**Product applications:**\n\n| Context | Layout Strategy | Example |\n|---------|----------------|---------|\n| **Hero sections** | Centered text, generous spacing | Short headline + subtext + single CTA |\n| **Blog feeds** | Varied card sizes for emphasis | First post large, rest in 2-column grid |\n| **Content pages** | Constrained width, left-aligned | `max-w-prose` container with left text |\n\n**CSS patterns:**\n- `text-left` by default, `text-center` only for heroes and short headlines\n- `grid grid-cols-3 gap-6` for feature grids; `max-w-4xl mx-auto` for page containers\n- `overflow-hidden` on cards with `object-fit: cover` images that bleed to edges\n\nSee [references\u002Fdata-visualization.md](references\u002Fdata-visualization.md) when laying out charts, tables, or dashboards — chart-type selection, color use in charts, table density, and dashboard composition.\n\n## Common Mistakes\n\n| Mistake | Why It Fails | Fix |\n|---------|-------------|------|\n| **\"Looks amateur\"** | Insufficient white space, unconstrained widths | More white space, constrain content widths |\n| **\"Feels flat\"** | No depth differentiation | Subtle shadows, border-bottom on sections |\n| **\"Text is hard to read\"** | Poor line-height, too wide, low contrast | Increase line-height, constrain width, boost contrast |\n| **\"Everything looks the same\"** | No visual hierarchy | Vary size\u002Fweight\u002Fcolor between primary and secondary |\n| **\"Feels cluttered\"** | Equal spacing everywhere | Group related items, larger gaps between groups |\n| **\"Colors clash\"** | Random choices, no system | Reduce saturation, more grays, limit to palette |\n| **\"Buttons don't pop\"** | Low contrast with surroundings | Increase contrast, add shadow |\n| **Arbitrary values** | px values like 13, 17, 23 breed inconsistency | Stick to the spacing and type scales |\n\n## Quick Diagnostic\n\nAudit any UI design:\n\n| Question | If No | Action |\n|----------|-------|--------|\n| Does hierarchy read when squinting (blur test)? | Elements competing | Increase primary\u002Fsecondary contrast |\n| Does it work in grayscale? | Color is a crutch | Strengthen size\u002Fweight\u002Fspacing hierarchy |\n| Is there enough white space? | Probably not — most designs are too dense | Increase spacing, especially between groups |\n| Are labels de-emphasized vs. values? | Labels competing with data | Smaller, lighter, or uppercase-small labels |\n| Does spacing follow a consistent scale? | Arbitrary spacing = visual noise | Use 4\u002F8\u002F16\u002F24\u002F32\u002F48\u002F64 only |\n| Is text width constrained? | Long lines fatigue readers | Apply `max-w-prose` (~65ch) |\n| Do colors have sufficient contrast? | Accessibility failure | WCAG-check; use gray-700+ on white |\n| Are shadows appropriate for elevation? | Elements float at wrong level | Match shadow scale to element purpose |\n\n## Further Reading\n\nFor the complete system with visual before\u002Fafter examples:\n\n- [*\"Refactoring UI\"*](https:\u002F\u002Fwww.amazon.com\u002FRefactoring-UI-Adam-Wathan\u002Fdp\u002FB0BLJ7MC21?tag=wondelai00-20) by Adam Wathan & Steve Schoger (the full book with hundreds of visual examples)\n- [*\"The Design of Everyday Things\"*](https:\u002F\u002Fwww.amazon.com\u002FDesign-Everyday-Things-Revised-Expanded\u002Fdp\u002F0465050654?tag=wondelai00-20) by Don Norman (foundational design thinking and usability)\n- [*\"Don't Make Me Think\"*](https:\u002F\u002Fwww.amazon.com\u002FDont-Make-Think-Revisited-Usability\u002Fdp\u002F0321965515?tag=wondelai00-20) by Steve Krug (web usability principles that complement Refactoring UI)\n- [Refactoring UI](https:\u002F\u002Fwww.refactoringui.com\u002F) — Official site with resources and examples\n\n## About the Authors\n\n**Adam Wathan**, creator of Tailwind CSS, and **Steve Schoger**, the visual designer behind its design language, wrote *Refactoring UI* to teach developers systematic, repeatable design techniques. Their approach replaces artistic talent with constrained systems — fixed scales for spacing, typography, color, and shadows — that produce professional results.\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26},"wondelai","1.5.0","main","ba06aff3a0c008524409a6bdcf301dfe4e8f165b","artifacts\u002Fskills\u002Fwondelai-skills\u002Frefactoring-ui","https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline","https:\u002F\u002Fgithub.com\u002FDiv0011","B.Tech Computer Engineering undergrad & Full-Stack Developer. Specialized in Generative AI, Next.js, and Python architecture. Building autonomous systems.","2026-09-07 19:51:50",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add Div0011\u002FFrontend-Pipeline --skill refactoring-ui",{"tool":40,"command":41},"bunx","bunx skills add Div0011\u002FFrontend-Pipeline --skill refactoring-ui",{"tool":43,"command":44},"pnpm","pnpm dlx skills add Div0011\u002FFrontend-Pipeline --skill refactoring-ui","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Frefactoring-ui\u002FSKILL.md",true,[48,54,58,62,66],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Faccessibility-depth.md","REFERENCE","参考文档",11752,"https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Frefactoring-ui\u002Freferences\u002Faccessibility-depth.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fadvanced-patterns.md",10929,"https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Frefactoring-ui\u002Freferences\u002Fadvanced-patterns.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fanimation-microinteractions.md",9515,"https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Frefactoring-ui\u002Freferences\u002Fanimation-microinteractions.md",{"path":63,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fdata-visualization.md",11788,"https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Frefactoring-ui\u002Freferences\u002Fdata-visualization.md",{"path":67,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Ftheming-dark-mode.md",10115,"https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Frefactoring-ui\u002Freferences\u002Ftheming-dark-mode.md",[71,80,87,94,101,108],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":75,"licenseFileUrl":76,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7B9FY1YN4AX6XSKFY1GEB6F","scrapling-official","Scrape web pages using Scrapling with anti-bot bypass (like Cloudflare Turnstile), stealth headless browsing, spiders framework, adaptive scraping, and JavaScript rendering. Use when asked to scrape, crawl, or extract data from websites; web_fetch fails; the site has anti-bot protections; write Python code to scrape\u002Fcrawl; or write spiders.","BSD-3-Clause","https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fvendor_references\u002FScrapling\u002Fagent-skill\u002FScrapling-Skill\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fvendor_references\u002FScrapling\u002Fagent-skill\u002FScrapling-Skill\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7B9FNH5E90KCTDK1MABVBAX","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7B9FDRG6DG9PKTEMKZXHCXY","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7B9F6P2Y8R413YJ3WX339HH","ux-heuristics","Evaluate and improve interface usability using heuristic analysis. Use when the user mentions \"usability audit\", \"users are confused\", \"form usability\", \"navigation problems\", \"Nielsen heuristics\", \"cognitive walkthrough\", or \"is this easy to use\". Also trigger when reviewing a design for usability issues, improving form-completion rates, or evaluating information architecture and navigation. Covers Krug's laws, Nielsen's 10 heuristics, severity ratings, dark-pattern recognition, and accessibility. For visual design fixes, see refactoring-ui. For conversion-focused audits, see cro-methodology.","https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Fux-heuristics\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M7B9EZVNSBCXJFQRFVX29NR5","traction-eos","Implement the Entrepreneurial Operating System (EOS) to align vision and execution across a company. Use when the user mentions \"EOS\", \"Entrepreneurial Operating System\", \"V\u002FTO\", \"quarterly rocks\", \"Level 10 meetings\", \"accountability chart\", \"IDS process\", \"my company feels chaotic\", \"we keep having the same problems\", or \"get the whole team aligned\". Also trigger when a growing company needs meeting structure, goal-setting frameworks, or a systematic way to solve recurring organizational issues. Covers the six EOS components: Vision, People, Data, Issues, Process, Traction. For team motivation design, see drive-motivation. For lean experimentation, see lean-startup.","https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Ftraction-eos\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M7B9ESTNAY9WY8NFW590DWGA","top-design","Create award-winning, immersive web experiences at the level of Awwwards-featured agencies. Use when the user mentions \"Awwwards quality\", \"make my site stunning\", \"scroll animations\", \"parallax storytelling\", \"cinematic web design\", \"portfolio site\", or \"brand experience\". Also trigger when elevating a standard landing page into a memorable digital experience. Covers dramatic typography, purposeful motion, scroll-based composition, and performance-optimized animation. For foundational UI, see refactoring-ui. For type selection, see web-typography.","https:\u002F\u002Fgithub.com\u002FDiv0011\u002FFrontend-Pipeline\u002Fblob\u002Fmain\u002Fartifacts\u002Fskills\u002Fwondelai-skills\u002Ftop-design\u002FSKILL.md",[],[]]