ui-design
Skill1 starsChanged 48 days agoMITView on GitHub
UI 设计基础总纲:布局、排版、色彩、间距、视觉层级、响应式、无障碍、动效、组件状态、设计 Token 三层架构, 含「设计质量 80/20」权重表、8px 间距标尺、1.25 字号阶、WCAG 对比度表,以及交付前 7 类检查清单。 触发词:UI设计、界面设计、设计基础、排版规范、配色、色彩搭配、间距系统、视觉层级、 设计审查、设计质量、组件状态、hover态、focus态、设计token、CSS变量、网页美化、视觉规范 不用于:创意美学方向选择(走 frontend-design-guidelines);具体 CSS 语法写法(走 responsive-design)
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 48 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 154
Every palette needs five functional roles:
- Distinctive: line 166
Create depth through lightness, not shadows:
- Distinctive: line 341
Use motion to communicate, not decorate.
- Distinctive: line 384
Every interactive element needs clear states.
“Common” is measured: kept by at least 6 in 10 of the 48 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UI Design Fundamentals
The definitive guide for building production-grade web interfaces. Covers the full stack of design decisions from layout to motion.
WHEN To Use
- Designing new UI components or pages
- Building landing pages, dashboards, or applications
- Reviewing code for design quality
- Creating distinctive interfaces that avoid generic aesthetics
- Implementing accessibility requirements
KEYWORDS
ui design, web design, layout, typography, color palette, spacing, visual hierarchy, responsive design, accessibility, motion design, component design, design tokens, frontend, css, tailwind
Design Philosophy
The 80/20 of Design Quality
| Factor | Impact | Time Investment |
| Typography | 40% | Choose 1-2 fonts well |
| Spacing | 25% | Use consistent scale |
| Color | 20% | Limit palette, ensure contrast |
| Everything else | 15% | Shadows, borders, motion |
Focus on typography and spacing first. They're 65% of perceived quality.
Commit to a Direction
Mediocrity is forgettable. Pick an extreme:
| Direction | Characteristics | Use When |
| Brutally Minimal | Stark, essential, nothing extra | Developer tools, productivity |
| Luxury/Refined | Premium, subtle elegance | High-end products, fashion |
| Playful | Fun, bright, approachable | Consumer apps, games |
| Editorial | Type-forward, grid-based | Content sites, magazines |
| Industrial | Function-forward, robust | B2B, enterprise |
Layout
Grid vs Flexbox Decision
| Layout Need | Tool | Why |
| Page-level structure | CSS Grid (grid-template-areas) | Named regions, explicit control |
| Navigation bars | Flexbox | Single-axis, gap spacing |
| Card grids | Grid (auto-fill/auto-fit) | Responsive without media queries |
| Centering | Grid (place-items: center) | Shortest, most reliable |
| Sidebar + content | Grid (250px 1fr) | Fixed + fluid |
| Stacking/overlaps | Grid + grid-area: 1/1 | No position: absolute needed |
Container Strategy
/* Standard content width */
.container {
width: 100%;
max-width: 1280px;
margin-inline: auto;
padding-inline: clamp(1rem, 5vw, 3rem);
}
/* Full-bleed with contained content */
.full-bleed {
width: 100vw;
margin-left: calc(50% - 50vw);
}Common Layout Mistakes
| Mistake | Problem | Fix |
| Mixing container widths | Inconsistent alignment | Use single max-w-* value |
| Content behind fixed navbar | Hidden content | Add pt-[navbar-height] |
| No mobile padding | Edge-to-edge text | Add px-4 minimum |
| Centered everything | Weak hierarchy | Left-align body text |
Typography
Typography carries 90% of a design's personality.
Font Pairing by Context
| Context | Display Font | Body Font | Example |
| Editorial | High-contrast serif | Neutral humanist | Playfair + Source Sans |
| SaaS | Geometric sans | Matching sans | DM Sans + DM Mono |
| Luxury | Thin modern serif | Elegant sans | Cormorant + Jost |
| Developer | Monospace display | Monospace body | JetBrains Mono + IBM Plex |
| Playful | Rounded/quirky | Clean readable | Nunito + Outfit |
Type Scale (1.25 ratio)
--text-xs: 0.64rem; /* 10px - captions */
--text-sm: 0.8rem; /* 13px - secondary */
--text-base: 1rem; /* 16px - body */
--text-lg: 1.25rem; /* 20px - lead */
--text-xl: 1.563rem; /* 25px - h4 */
--text-2xl: 1.953rem; /* 31px - h3 */
--text-3xl: 2.441rem; /* 39px - h2 */
--text-4xl: 3.052rem; /* 49px - h1 */Typography Rules
| Rule | Value | Why |
| Minimum body size | 16px | Below is hard to read |
| Body line-height | 1.5-1.75 | Improves readability |
| Heading line-height | 1.1-1.2 | Tighter for large text |
| Line length | 60-75 characters | Optimal reading |
| Paragraph spacing | 1.5em | Clear separation |
Typography Mistakes
| Mistake | Problem | Fix |
| System fonts only | Generic look | Use Google Fonts or variable fonts |
| Too many fonts | Visual chaos | Max 2 families |
| Weak weight contrast | Poor hierarchy | Bold headings (600+), regular body |
| Long lines | Hard to read | Add max-w-prose (65ch) |
Color
Building a Palette
Every palette needs five functional roles:
| Role | Purpose | Usage |
| Primary | Brand identity | Buttons, links, active states |
| Neutral | Text, backgrounds | Body text, cards, dividers |
| Accent | Secondary actions | Tags, badges, highlights |
| Semantic | Feedback | Success/warning/error states |
| Surface | Layered backgrounds | Cards, modals, overlays |
Surface Layering (Dark Mode)
Create depth through lightness, not shadows:
:root {
--surface-0: hsl(220 15% 8%); /* page background */
--surface-1: hsl(220 15% 12%); /* card */
--surface-2: hsl(220 15% 16%); /* raised element */
--surface-3: hsl(220 15% 20%); /* popover/modal */
}Contrast Requirements (WCAG)
| Text Size | Minimum Ratio | Enhanced (AAA) |
| Normal text (<18px) | 4.5:1 | 7:1 |
| Large text (≥18px bold, ≥24px) | 3:1 | 4.5:1 |
| UI components | 3:1 | — |
Color Mistakes
| Mistake | Problem | Fix |
| Purple gradient on white | "AI aesthetic" cliché | Use intentional brand colors |
| Low contrast text | Accessibility fail | Test with contrast checker |
| Color-only indicators | Colorblind users excluded | Add icons/text |
| Too many colors | Visual noise | 3-5 colors maximum |
| Light gray text on white | Unreadable | slate-600 minimum |
Spacing
8px Base Unit Scale
--space-1: 0.25rem; /* 4px - tight gaps */
--space-2: 0.5rem; /* 8px - input padding */
--space-3: 0.75rem; /* 12px - button padding */
--space-4: 1rem; /* 16px - default spacing */
--space-6: 1.5rem; /* 24px - section padding */
--space-8: 2rem; /* 32px - section gaps */
--space-12: 3rem; /* 48px - major breaks */
--space-16: 4rem; /* 64px - page rhythm */Spacing Rules
| Rule | Implementation |
Use gap not margins | display: flex; gap: var(--space-4) |
| Consistent padding | Same values on all cards/sections |
| More space between groups | Less space within groups (Gestalt) |
| No arbitrary values | Only use scale tokens |
Spacing Mistakes
| Mistake | Problem | Fix |
| Arbitrary pixel values | Inconsistent rhythm | Use spacing scale only |
| Margin on children | Margin collapse bugs | Use gap on parent |
| Equal spacing everywhere | No visual grouping | More between, less within |
| Tight mobile padding | Cramped feeling | Minimum p-4 on mobile |
Visual Hierarchy
Guide the eye through deliberate contrast.
Hierarchy Techniques
| Technique | How | Impact |
| Size | Hero 3-4x body | Immediate focal point |
| Weight | Bold headings, regular body | Scannability |
| Color | Primary vs muted | Information layers |
| Space | Isolation creates emphasis | Draws attention |
| Position | Top-left anchors reading | Natural flow |
Card Hierarchy Pattern
Eyebrow ← xs, uppercase, muted color
Title ← xl, semibold, primary color
Body ← base, secondary color, 1.6 line-height
Action ← spaced apart, mt-4 minimumResponsive Design
Breakpoint Strategy
| Breakpoint | Target | Key Changes |
| < 640px | Mobile | Single column, stacked nav, 44px touch targets |
| 640-1024px | Tablet | Two columns, collapsible sidebars |
| 1024-1440px | Desktop | Full layout, hover enabled |
| > 1440px | Wide | Max-width container, prevent ultra-wide lines |
Fluid Techniques
/* Fluid typography */
h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.5rem); }
/* Fluid spacing */
section { padding-block: clamp(2rem, 1rem + 4vw, 6rem); }
/* Intrinsic grid */
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
gap: var(--space-6);
}Responsive Mistakes
| Mistake | Problem | Fix |
| No viewport meta | Broken mobile | Add width=device-width |
| Fixed widths | Overflow on mobile | Use max-w-* and % |
| Tiny touch targets | Frustrating taps | Minimum 44x44px |
| Hidden horizontal scroll | Broken layout | Test at 375px width |
Accessibility
Accessibility is not optional.
Critical Requirements
| Requirement | Implementation | Standard |
| Color contrast | 4.5:1 normal, 3:1 large | WCAG 2.1 AA |
| Keyboard navigation | Tab order matches visual | WCAG 2.1.1 |
| Focus indicators | Visible :focus-visible ring | WCAG 2.4.7 |
| Semantic HTML | <button>, <nav>, <main> | WCAG 1.3.1 |
| Alt text | Descriptive for images | WCAG 1.1.1 |
| Motion safety | prefers-reduced-motion | WCAG 2.3.3 |
| Touch targets | 44×44px minimum | WCAG 2.5.8 |
Focus Styles
:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
/* Remove default only if custom exists */
:focus:not(:focus-visible) {
outline: none;
}Motion Safety
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}Motion & Animation
Use motion to communicate, not decorate.
Timing Guidelines
| Interaction | Duration | Easing |
| Button hover | 150ms | ease-out |
| Modal open | 250ms | ease-out |
| Modal close | 200ms | ease-in |
| Page transition | 300ms | ease-in-out |
| Stagger delay | 50-80ms per item | — |
| Micro-feedback | 100ms | ease-out |
Staggered Entrance
.item {
opacity: 0;
translate: 0 1rem;
animation: reveal 0.5s ease-out forwards;
}
.item:nth-child(1) { animation-delay: 0ms; }
.item:nth-child(2) { animation-delay: 60ms; }
.item:nth-child(3) { animation-delay: 120ms; }
@keyframes reveal {
to { opacity: 1; translate: 0 0; }
}Motion Mistakes
| Mistake | Problem | Fix |
| Animating width/height | Performance hit | Use transform only |
| > 500ms duration | Feels sluggish | 150-300ms for most |
| Motion everywhere | Overwhelming | Focus on entrances/exits |
| No reduced-motion | Accessibility fail | Always check preference |
Component States
Every interactive element needs clear states.
| State | Visual Treatment |
| Default | Base styling |
| Hover | Subtle background/shadow shift |
| Active/Pressed | Slight inset, reduced shadow |
| Focus | High-visibility ring |
| Disabled | 50% opacity, not-allowed cursor |
| Loading | Spinner or skeleton |
Button Example
.btn {
transition: all 150ms ease-out;
}
.btn:hover {
background: var(--color-primary-600);
}
.btn:active {
transform: scale(0.98);
}
.btn:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}Design Tokens Architecture
Structure tokens in three layers:
/* Layer 1: Primitives */
--blue-500: oklch(0.55 0.2 250);
--gray-100: oklch(0.95 0.005 250);
--radius-md: 0.5rem;
/* Layer 2: Semantic */
--color-primary: var(--blue-500);
--color-surface: var(--gray-100);
--radius-button: var(--radius-md);
/* Layer 3: Component */
--btn-bg: var(--color-primary);
--btn-radius: var(--radius-button);
--btn-padding: var(--space-2) var(--space-4);This allows theme switching by remapping Layer 2 only.
Pre-Delivery Checklist
Typography
- Intentional font pairing (not system defaults)
- Consistent type scale
- Line length ≤ 75 characters
- 16px minimum body text
Color
- Cohesive palette (3-5 colors)
- WCAG contrast met (4.5:1 normal, 3:1 large)
- Semantic colors defined
- Dark mode tested (if applicable)
Spacing
- Consistent rhythm using scale
- No arbitrary pixel values
- Proper mobile padding
Hierarchy
- Clear visual flow
- Primary action obvious
- Information layered by importance
Responsive
- Mobile tested (375px)
- No horizontal overflow
- Touch targets ≥ 44px
Accessibility
- Keyboard navigable
- Focus visible
- Screen reader tested
- Motion-safe
States
- Hover on all interactive elements
- Focus-visible on all focusable
- Loading states for async
- Error states for forms
Performance
- Images optimized (WebP, srcset)
- Fonts subset
- Animations use
transform/opacity
NEVER Do
- NEVER skip contrast checking — Test every text/background combination
- NEVER use color alone — Always pair with icons/text for meaning
- NEVER remove focus outlines — Unless replacing with visible alternative
- NEVER use arbitrary spacing — Stick to the scale
- NEVER animate layout properties — Only
transformandopacity - NEVER ignore reduced-motion — Always check the preference
- NEVER center everything — Left-align body text
- NEVER use tiny touch targets — 44px minimum
- NEVER use low-contrast text —
slate-600minimum on white - NEVER use generic system fonts — Choose intentional typography
Related Skills
ui-ux-pro-max— Searchable design databases with CLIfrontend-design— Creative aesthetics, avoiding "AI slop"theme-factory— Applying themes to artifactsdesign-system-patterns— Token architecture and theming
Other versions57 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- wpank/ai★ 1197% same
Wrote their own version · 56
- epicenter-md/epicenter★ 4.8ksame name
- EpicenterHQ/epicenter★ 4.8ksame name
- yunshu0909/yunshu_skillshub★ 760same name
- Mindrally/skills★ 275same name
- AnastasiyaW/codex-claude-code-config★ 213same name
- AnastasiyaW/claude-code-config★ 209same name
- mblode/agent-skills★ 177same name
- JayZeeDesign/awesome-claude-skills★ 169same name
- frappe/skills★ 162same name
- TencentCloudBase/skills★ 80same name
46 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use harness-design, typescript and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
VictoriakaeySkillharness-design
Use when designing or improving the action space, observation format, tool boundaries, and evaluation signals of an LLM agent. Covers the five layers of harness design: what tools the agent has, what it sees after acting, how each tool is scoped, how behavior is evaluated, and how to iterate when the agent misbehaves. Prevents the most common harness failures — agents that pick wrong tools, ignore critical information, or loop without progress.
Also in 3 projects that use this
MicrosoftSkilltypescript
TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.
Also in 6 projects that use this
OpenAISkillauth
Authentication integration guidance — Clerk (native Vercel Marketplace), Descope, and Auth0 setup for Next.js applications. Covers middleware auth patterns, sign-in/sign-up flows, and Marketplace provisioning. Use when implementing user authentication.
Also in 3 projects that use this
jarosser06Skilltest-strategy
Plans pytest test strategies for Drift's 90%+ coverage requirement using coverage analysis, edge case identification, and test suite design. Use when determining what tests to write, analyzing coverage gaps, or planning test strategies.
Also in 3 projects that use this
3stoneBrotherSkillcode-audit
Professional code security audit skill covering 55+ vulnerability types. Enhanced with WooYun 88,636 real-world vulnerability cases (2010-2016). This skill should be used when performing security audits, vulnerability scanning, penetration testing preparation, or code review for security issues. Supports 9 languages: Java, Python, Go, PHP, JavaScript/Node.js, C/C++, .NET/C#, Ruby, Rust. Includes 143 mandatory detection items across all languages with language-specific checklists. Covers SQL injection, XSS, RCE, deserialization, SSRF, JNDI injection, JDBC protocol injection, authentication bypass, business logic flaws, race conditions, and modern security domains (LLM, Serverless, Android). WooYun integration adds: statistical-driven parameter priority, bypass techniques library, logic vulnerability patterns, and real-case references. v1.0: Initial public release with Docker deployment verification framework.
Also in 3 projects that use this
VercelSkillreact
React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.
Also in 3 projects that use this
In this repository60 other files it gives its agents.
- accessibility-auditSkill
- agent-browser-coreSkill
- ai-explainer-videoSkill
- ai-short-video-makerSkill
- ai-video-shortSkill
- AI 工具箱Skill
- antislopSkill
- browser-useSkill
- cangjie-skillSkill
- delivery-no-pseudoblockSkill
- design-reviewSkill
- design-routerSkill
- edge-tts-readSkill
- frontend-designSkill
- frontend-devSkill
- fuheshun-auto-clipSkill
- fullstack-devSkill
- githubSkill
- git-shipSkill
- grillingSkill
- hfut-inspectorSkill
- humanizerSkill
- image-to-editable-pptxSkill
- kdocsSkill
- local-video-pipelineSkill
- markitdown-skillSkill
- pdfSkill
- pptxSkill
- qf-english-polishSkill
- qq-emailSkill
- responsive-designSkill
- self-improving-agentSkill
- sherpa-onnx-ttsSkill
- short-video-script-to-finished-videoSkill
- skill-creatorSkill
- skill-integratorSkill
- tastemakerSkill
- techdebtSkill
- Typography FoundationsSkill
- video-scriptSkill
- web-accessSkill
- web-design-guidelinesSkill
- web-design-layoutSkill
- wechat-article-proSkill
- wechat-article-searchSkill
- weekly-reviewSkill
- word-toolkitSkill
- WorkBuddy 工作原则Skill
- xlsxSkill
- yuketang-harvesterSkill
- 学术研究工具箱Skill
- 安全审查工具箱Skill
- 工程方法论工具箱Skill
- 开发工具箱Skill
- 微信小程序开发套件Skill
- 技能包跨机器打包Skill
- 文档工具箱Skill
- 知识工具箱Skill
- 联网工具箱Skill
- 评审委员会Skill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

