diff --git a/.claude/skills/frontend-design/SKILL.md b/.claude/skills/frontend-design/SKILL.md index 883f1419b..b5fa11c53 100644 --- a/.claude/skills/frontend-design/SKILL.md +++ b/.claude/skills/frontend-design/SKILL.md @@ -41,7 +41,11 @@ Interpret creatively and make unexpected choices that feel genuinely designed fo Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision. +--- +## Reference Files + +For deeper expertise, consult: [typography](reference/typography.md), [color](reference/color-and-contrast.md), [spatial](reference/spatial-design.md), [responsive](reference/responsive-design.md), [interaction](reference/interaction-design.md), [motion](reference/motion-design.md), [ux-writing](reference/ux-writing.md). ## Design Patterns Reference @@ -91,47 +95,3 @@ These patterns create generic "AI slop" aesthetics: - Don't hide critical functionality on mobile These anti-patterns are baked into training data from countless generic templates. Without explicit guidance, AI reproduces them. This skill ensures your AI knows both what to do AND what to avoid. - - ---- - -## Domain Reference Files - -For deeper expertise in specific design domains, consult these reference files: - -### Typography -For type systems, font selection, readability, and typographic hierarchy. -**See**: [reference/typography.md](reference/typography.md) - -### Color & Contrast -For color systems, palettes, accessibility, theming, and WCAG compliance. -**See**: [reference/color-and-contrast.md](reference/color-and-contrast.md) - -### Spatial Design -For spacing systems, grids, visual hierarchy, and composition. -**See**: [reference/spatial-design.md](reference/spatial-design.md) - -### Responsive Design -For mobile-first layouts, breakpoints, fluid design, and cross-device adaptation. -**See**: [reference/responsive-design.md](reference/responsive-design.md) - -### Interaction Design -For forms, states, feedback patterns, keyboard navigation, and touch optimization. -**See**: [reference/interaction-design.md](reference/interaction-design.md) - -### Motion Design -For animations, micro-interactions, transitions, and performance optimization. -**See**: [reference/motion-design.md](reference/motion-design.md) - -### UX Writing -For interface copy, error messages, microcopy, and voice/tone guidelines. -**See**: [reference/ux-writing.md](reference/ux-writing.md) - ---- - -## When to Use Reference Files - -- **Quick builds**: Use this main skill file for most frontend work -- **Deep dives**: Consult specific reference files when facing complex challenges in that domain -- **Systematic work**: When building design systems or establishing patterns, reference multiple domain files -- **Troubleshooting**: When something feels "off", check the relevant domain reference for best practices \ No newline at end of file diff --git a/.claude/skills/frontend-design/reference/color-and-contrast.md b/.claude/skills/frontend-design/reference/color-and-contrast.md index 29a1f9851..77aaf0329 100644 --- a/.claude/skills/frontend-design/reference/color-and-contrast.md +++ b/.claude/skills/frontend-design/reference/color-and-contrast.md @@ -1,26 +1,5 @@ # Color & Contrast -This reference guides the creation of color systems that are both beautiful and functional, balancing creative expression with accessibility and systematic coherence. - -The user provides a color challenge: building a color palette, implementing theming, fixing contrast issues, establishing brand colors, or creating dark mode variants. They may include brand guidelines, accessibility requirements, or existing design constraints. - -## Color System Thinking - -Before choosing colors, understand the strategic requirements: - -- **Brand & Emotion**: What feelings should the colors evoke? Trust (blues)? Energy (reds/oranges)? Growth (greens)? Luxury (purples/golds)? Colors are never neutral. -- **Functional Requirements**: How many semantic states needed? Success, error, warning, info? How many UI layers? Background, surface, border, text? -- **Context**: Industry conventions (avoid red for finance), cultural considerations, competitor differentiation. -- **Accessibility Goals**: WCAG level (A/AA/AAA), audience considerations (aging users need higher contrast). - -**CRITICAL**: Color is both an art and a science. Aesthetics matter, but accessibility is non-negotiable. - -Then build a color system that is: -- Accessible and WCAG compliant -- Systematically organized with clear roles -- Flexible enough for theming and variations -- Aesthetically cohesive and on-brand - ## Color Spaces: Use OKLCH **Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark. @@ -105,19 +84,7 @@ These commonly fail contrast or cause readability issues: ### Never Use Pure Gray or Pure Black -Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. They look uncanny and lifeless. - -```css -/* Dead and artificial */ ---gray: oklch(50% 0 0); ---black: oklch(0% 0 0); - -/* Natural and warm */ ---gray: oklch(50% 0.01 60); /* Warm gray */ ---black: oklch(12% 0.01 250); /* Very dark blue-gray */ -``` - -Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted. +Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted. (See tinted neutrals example above.) ### Testing @@ -154,63 +121,12 @@ You can't just swap colors. Dark mode requires different design decisions: ### Token Hierarchy -Use two layers of abstraction: - -```css -/* Layer 1: Primitive tokens (rarely use directly) */ ---blue-500: oklch(55% 0.2 250); ---blue-600: oklch(45% 0.2 250); - -/* Layer 2: Semantic tokens (use these) */ ---color-primary: var(--blue-500); ---color-primary-hover: var(--blue-600); ---color-text: var(--gray-900); ---color-text-muted: var(--gray-600); ---color-border: var(--gray-200); ---color-surface: var(--white); -``` - -**For dark mode, only redefine the semantic layer:** - -```css -:root[data-theme="dark"] { - --color-primary: var(--blue-400); /* Lighter in dark mode */ - --color-text: var(--gray-100); - --color-surface: var(--gray-900); -} -``` +Use two layers: primitive tokens (`--blue-500`) and semantic tokens (`--color-primary: var(--blue-500)`). For dark mode, only redefine the semantic layer—primitives stay the same. ## Alpha Is A Design Smell -If you're using lots of transparency (rgba, hsla), your palette is probably incomplete. Alpha creates: -- Unpredictable contrast (depends on what's behind it) -- Performance overhead (compositing) -- Inconsistency across contexts - -**Instead**: Define explicit overlay colors: - -```css -/* Bad: unpredictable */ ---overlay: rgba(0, 0, 0, 0.5); - -/* Good: explicit colors for each context */ ---overlay-on-light: oklch(40% 0 0); ---overlay-on-dark: oklch(70% 0 0); ---overlay-on-image: oklch(20% 0 0 / 60%); /* Alpha only when necessary */ -``` - -The exception: Focus rings and interactive states where you need to see through to the element beneath. +Heavy use of transparency (rgba, hsla) usually means an incomplete palette. Alpha creates unpredictable contrast, performance overhead, and inconsistency. Define explicit overlay colors for each context instead. Exception: focus rings and interactive states where see-through is needed. --- -**IMPORTANT**: Test color combinations in context, not in isolation. Colors behave differently on different backgrounds and at different sizes. - -**NEVER**: -- Rely on color alone to convey information -- Use color combinations that fail WCAG contrast requirements -- Create palettes with arbitrary color choices (every color needs a purpose) -- Ignore color blindness (8% of men, 0.5% of women) -- Use pure black (#000) or pure white (#fff) for large areas -- Create theme systems without testing all combinations - -Remember: Color is powerful. Use it deliberately, systematically, and inclusively. +**Avoid**: Relying on color alone to convey information. Creating palettes without clear roles for each color. Using pure black (#000) for large areas. Skipping color blindness testing (8% of men affected). diff --git a/.claude/skills/frontend-design/reference/interaction-design.md b/.claude/skills/frontend-design/reference/interaction-design.md index a6cbbe014..10a77564b 100644 --- a/.claude/skills/frontend-design/reference/interaction-design.md +++ b/.claude/skills/frontend-design/reference/interaction-design.md @@ -1,26 +1,5 @@ # Interaction Design -This reference guides the creation of interaction patterns that are intuitive, accessible, and delightful - the conversation between user and interface. - -The user provides an interaction challenge: designing forms, improving button states, fixing navigation patterns, optimizing input UX, implementing keyboard navigation, or creating feedback mechanisms. They may include accessibility requirements, device constraints, or specific interaction problems to solve. - -## Interaction Design Thinking - -Before designing interactions, understand the user's mental model and context: - -- **User Context**: What are users trying to accomplish? What's their experience level? What's their emotional state (stressed during checkout vs relaxed browsing)? -- **Device & Input**: Touch vs pointer? Keyboard navigation? Voice input? Gamepad? Different inputs need different affordances. -- **Error Tolerance**: High-stakes actions (delete, purchase) vs low-stakes (filter, sort)? Design appropriate safeguards. -- **Speed vs Accuracy**: Quick scanning vs careful reading? Simple taps vs precise manipulation? - -**CRITICAL**: Good interaction design is invisible. Users should complete tasks without thinking about the interface. - -Then implement interactions that are: -- Intuitive with clear affordances and feedback -- Accessible to all users and input methods -- Forgiving with error prevention and recovery -- Responsive with immediate feedback and state changes - ## The Eight Interactive States Every interactive element needs these states designed: @@ -63,92 +42,11 @@ button:focus-visible { ## Form Design: The Non-Obvious -### Don't Use Placeholders as Labels +**Placeholders aren't labels**—they disappear on input. Always use visible `