一键导入
frontend-design
Use when building UI components, making design decisions for frontend work, reviewing UI implementation quality, or planning interaction patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when building UI components, making design decisions for frontend work, reviewing UI implementation quality, or planning interaction patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when user mentions "brand", "Open Session colors", "Aperol", "Charcoal", "Vanilla", "brand guidelines", or works on UI following Open Session standards.
Use when reviewing UI/frontend code, conducting PR reviews for components, checking design system compliance, or after any UI component work.
基于 SOC 职业分类
| name | frontend-design |
| description | Use when building UI components, making design decisions for frontend work, reviewing UI implementation quality, or planning interaction patterns. |
| version | 1.0.0 |
| triggers | ["UI component","frontend","interface","design system","interaction pattern","animation","form design","accessibility","responsive design","component","layout"] |
Create distinctive, production-grade frontend interfaces with intentional aesthetics.
This skill guides creation of frontend interfaces that feel genuinely designed—not auto-generated. It covers design thinking, interaction patterns, motion, forms, layout, accessibility, and performance.
Use this skill when:
Before writing any code, establish your design intent:
What problem are we solving? Who uses this? Think about the user's emotional state, their goals, and what success looks like.
Choose a clear visual direction:
| Direction | Feel | When to Use |
|---|---|---|
| Warm Minimal | Clean, inviting, focused | Dashboard UIs, tools, productivity |
| Editorial | Magazine-like, typographic | Content-heavy pages, portfolios |
| Soft/Organic | Rounded, gentle, approachable | Consumer apps, onboarding |
| Industrial/Raw | Utilitarian, honest, functional | Developer tools, technical docs |
| Luxury/Refined | Spacious, elegant, deliberate | Brand sites, premium products |
Key insight: Bold maximalism and refined minimalism both work—the magic is in commitment, not intensity.
Ask yourself: What's the one thing someone will remember about this interface? Maybe it's a delightful hover state, an unexpected color choice, or how perfectly the typography flows.
/* Use semantic tokens, not arbitrary colors */
--bg-primary /* Main background */
--bg-secondary /* Elevated surfaces */
--fg-primary /* Primary text */
--fg-secondary /* Secondary text */
--border-primary /* Interactive borders */
--border-secondary /* Container borders */
--brand-primary /* Accent/CTA color */
| Category | Usage |
|---|---|
| Display | Headlines, titles, hero text |
| Body | Paragraphs, inputs, tabs |
| Small | Labels, captions, hints, metadata |
| Accent | Special callouts, tech feel (use sparingly) |
Borders should support, not dominate:
// Default: nearly invisible
className="border border-border-secondary"
// Hover: slightly more visible
className="hover:border-border-primary"
// Focus: full visibility
className="focus:border-border-primary"
| Context | Minimum Size | Notes |
|---|---|---|
| Desktop | 24×24px | Visual can be smaller if hit area is expanded |
| Mobile | 44×44px | Apple HIG standard |
| Input font | ≥16px | Prevents iOS Safari auto-zoom |
// Expand hit target beyond visual bounds
<button className="p-2 -m-2">
<Icon className="w-6 h-6" /> {/* Visual is 24px, hit area is 40px */}
</button>
:focus-visible over :focus to avoid focus rings on click:focus-within for grouped controls (e.g., input with icon)| Timing | Value | Purpose |
|---|---|---|
| Show delay | 150–300ms | Prevent flash on fast responses |
| Minimum visible | 300–500ms | Avoid jarring disappearance |
// Don't: Show spinner immediately
{isLoading && <Spinner />}
// Do: Delay spinner appearance
const showSpinner = isLoading && loadingDuration > 200;
Update the UI immediately when success is likely:
| Pattern | When to Use |
|---|---|
| Confirmation dialog | Permanent deletion, irreversible changes |
| Undo with timeout | Soft deletes, sends, publishes |
| Type-to-confirm | Account deletion, production deployments |
Animate only when it serves a purpose:
Don't animate for decoration or to fill silence.
| Property Changing | Recommended Easing |
|---|---|
| Opacity only | linear or gentle ease |
| Size/Scale | easeOut (fast start, slow end) |
| Position | easeOut or spring |
| Enter | easeOut |
| Exit | easeIn (slow start, fast end) |
GPU-accelerated (prefer these):
transform: translate(), scale(), rotate();
opacity;
filter;
Layout-triggering (avoid animating):
width, height, padding, margin;
top, left, right, bottom;
font-size, line-height;
Anti-patterns:
/* Never: Animates everything including layout */
transition: all 0.3s;
/* Do: Explicit properties only */
transition: transform 0.3s, opacity 0.3s;
Always honor the user's motion preference:
const prefersReducedMotion = window.matchMedia(
'(prefers-reduced-motion: reduce)'
).matches;
| Input Type | Enter Key Behavior |
|---|---|
| Single text input | Submits form |
| Multiple inputs | Submits on last field |
<textarea> | Creates new line |
<textarea> + Cmd/Ctrl+Enter | Submits form |
| Timing | What to Validate |
|---|---|
| On blur | Format, required fields |
| On submit | All validation, server errors |
| Real-time | Only for character limits or live search |
Rules:
type and inputmode for better keyboards:| Data | type | inputmode |
|---|---|---|
email | — | |
| Phone | tel | — |
| Number | text | numeric |
| Credit card | text | numeric |
Geometry lies. Adjust ±1–2px when perception beats math:
Child radius must be ≤ parent radius, and curves should be concentric:
Outer radius: 16px
Gap (padding): 8px
Inner radius: 16px - 8px = 8px
Use ≥2 shadow layers to mimic real light (ambient + direct):
box-shadow:
0 1px 2px rgba(0,0,0,0.06), /* Tight, direct light */
0 4px 12px rgba(0,0,0,0.08); /* Soft, ambient light */
Never rely on color alone for meaning:
aria-labelaria-hidden="true"button, a, label) before ARIAh1 → h2 → h3)| Operation | Target |
|---|---|
| UI response to input | <100ms |
| API mutations | <500ms |
| Page load (LCP) | <2.5s |
content-visibility: auto for off-screen content| Asset | Strategy |
|---|---|
| Above-fold images | Preload |
| Below-fold images | Lazy load |
| Fonts | Preload critical, subset via unicode-range |
| Third-party scripts | defer or async |
Generic AI aesthetics:
Interaction anti-patterns:
transition: all (performance killer)Instead:
Version: 1.0.0 | Interaction patterns adapted from Vercel Web Interface Guidelines