All skills
samhvw8 avatar

/ui-design-system

@28c7616

React UI component systems with TailwindCSS + Radix + shadcn/ui. Stack: TailwindCSS (styling), Radix UI (primitives), shadcn/ui (components), React/Next.js. Capabilities: design system architecture, accessible components, responsive layouts, theming, dark mode, component composition. Actions: review, design, build, improve, refactor UI components. Keywords: TailwindCSS, Radix UI, shadcn/ui, design system, component library, accessibility, ARIA, responsive, dark mode, theming, CSS variables, component architecture, atomic design, design tokens, variant, slot, composition. Use when: building component libraries, implementing shadcn/ui, creating accessible UIs, setting up design systems, adding dark mode/theming, reviewing UI component architecture.

Use this Skill: https://skilld.dev/gh/samhvw8/dot-claude/ui-design-system

This session only. Nothing lands on disk.

referencesDESIGN_TOKENS.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Design Token Architecture

Three-Tier Token System (Industry Standard)

Based on USWDS, IBM Carbon, and Shopify Polaris patterns.

Tier 1: Primitive Tokens (Foundation Layer)

  • Raw design values without context
  • Examples: gray-50, gray-900, spacing-4, font-sans
  • Purpose: "The most basic form of tokens, reducing infinite possibilities to a select few"
  • Never reference other tokens
  • Immutable across themes

Tier 2: Semantic Tokens (Context Layer)

  • Carry meaning about usage
  • Examples: background-primary, text-error, border-interactive
  • Purpose: Describe function, not appearance
  • Reference primitive tokens
  • Change between themes (light/dark)

Tier 3: Component Tokens (Application Layer)

  • Specific to UI components
  • Examples: button-height, card-padding, input-border-radius
  • Reference semantic or primitive tokens
  • Enable component-level theming

Token Hierarchy Benefits

  • Single source of truth
  • Update one token → cascades everywhere
  • Dark mode: Change semantic layer only
  • Rebrand: Update primitive layer only

OKLCH Color Space (Modern Standard)

Why OKLCH over HSL

  • Perceptually uniform: Equal lightness steps look equal to human eyes
  • Consistent brightness: Yellow/cyan don't appear lighter than blue/red
  • Algorithmic palettes: Generate entire color systems from formulas
  • Better gradients: Smooth transitions without lightness jumps
  • Accessibility: Easier to calculate contrast ratios

Browser Support

  • 93%+ (2024) - All modern browsers
  • TailwindCSS v4 uses OKLCH by default

Format: oklch(L C H)

  • L: Lightness (0-1 or 0%-100%)
  • C: Chroma/saturation (0-0.4)
  • H: Hue (0-360 degrees)

HSL vs OKLCH Example

  • HSL: hsl(210, 100%, 50%) - Unpredictable perceived brightness
  • OKLCH: oklch(0.55 0.22 264) - Perceptually consistent

Token Naming Conventions

Best practices from Smashing Magazine & Design Systems Collective.

Structure Pattern

[category]-[property]-[variant]-[state]

Purpose-Driven Names ✅

  • background-primary (semantic)
  • text-error (semantic)
  • button-primary-hover (component + state)

Avoid Appearance-Based ❌

  • blue-500 (no context)
  • dark-blue-bg (ties to visual)
  • header-color-1 (meaningless)

Color Naming

  • Primitives: [family]-[brightness] → gray-50 to gray-900
  • Semantic: [purpose]-[role] → background-primary, text-on-primary
  • Component: [component]-[property] → button-background-primary

Key Characteristics

  • Logical: Consistent patterns team understands
  • Scalable: Accommodates growth without restructuring
  • Searchable: Easy filtering in design tools
  • Short: Balance descriptiveness with brevity

CSS Variable Configuration

Three-Tier CSS Variables

:root {
  /* Tier 1: Primitives (immutable) */
  --gray-50: 250 250 250;
  --gray-900: 24 24 27;
  --blue-500: oklch(0.55 0.22 264);

  /* Tier 2: Semantics (theme-aware) */
  --background: var(--gray-50);
  --foreground: var(--gray-900);
  --primary: var(--blue-500);

  /* Tier 3: Components */
  --button-height: 2.5rem;
  --card-padding: 1.5rem;
}

.dark {
  /* Only semantic tokens change */
  --background: var(--gray-900);
  --foreground: var(--gray-50);
}

Color Space Recommendation

  • Modern: Use OKLCH for perceptual uniformity
  • Legacy support: Use HSL with fallbacks
  • Avoid: RGB/HEX for design tokens (not human-readable)

Token Storage

  • Store in JSON for platform-agnostic distribution
  • Transform to CSS variables, Swift, XML using Style Dictionary
  • Version control tokens separately from component code

Multi-Theme Support

Support multiple brands/themes:

  • Define theme objects with token values
  • Inject CSS variables dynamically with JavaScript
  • Semantic tokens adapt per theme
  • Primitive tokens can vary by brand

Implementation Checklist

  • Define primitive tokens (colors, spacing, typography)
  • Create semantic tokens that reference primitives
  • Build component tokens for specific UI elements
  • Use OKLCH color space for modern browsers
  • Implement three-tier CSS variable structure
  • Store tokens in JSON for platform-agnostic use
  • Document naming conventions for the team
  • Test dark mode with semantic token switching
  • Validate token cascade (primitive → semantic → component)

Source: SKILL.md on GitHub

No alerts17d4 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill provides documentation and tools for designing and implementing UI systems using modern React frameworks. It includes automation scripts for configuring Tailwind CSS and installing components from the official shadcn/ui registry using standard developer tools.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    1 finding · Score: 86/100

Signed by skilld at 28c7616. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 10 months ago
version
2.0.0

README badge

README badge for samhvw8/dot-claude