mcpField
D
design-frontend

design-frontend

github.com/ravnhqDesign & UI1657 installsUpdated 21w ago
Repository

About design-frontend

A design-pattern guide for web UI developers covering responsive layouts, design tokens, and dark mode. It focuses on Tailwind CSS v4 and CSS variables, with implementation rules and troubleshooting advice.

Key features

  1. 01Design tokens and CSS variables
  2. 02Mobile-first responsive layouts
  3. 03Container query patterns
  4. 04Dark mode and contrast
  5. 05Accessible component guidelines

Use cases

  1. 01Set up theme tokens for a component library
  2. 02Build layouts that adapt to mobile screens
  3. 03Check dark-mode readability

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ravnhq/ai-toolkit --skill design-frontend

After installing, type/design-frontendin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

rules/
_sections.md
layout-avoid-important.md
layout-max-width-containers.md
layout-use-spacing-scale.md
responsive-container-queries.md
responsive-mobile-first.md
responsive-touch-targets.md
token-dark-mode-colors.md
token-never-hardcode-colors.md
token-use-cn-utility.md

Details

From the project README

Visual Design Systems for Web UIs

Design system patterns for consistent, accessible, responsive interfaces. Tailwind CSS v4 changes the game with CSS variables for runtime theming. Core patterns: design tokens (colors, spacing, typography), responsive breakpoints and container queries, dark mode with proper contrast, component composition, and spacing scales.

Key challenges: hardcoded values instead of tokens (unmaintainable), responsive design without mobile-first thinking, dark mode implemented post-hoc (inaccessible), container queries for component-level responsiveness (not just viewport-based).

Workflow

When implementing visual designs:

  1. Define tokens — Colors, spacing, typography, shadows as CSS variables in @theme
  2. Choose container — Wrap component in @container for container queries
  3. Build mobile-first — Start with mobile layout, add breakpoints upward
  4. Test dark mode — Use dark: variants; ensure contrast ratios
  5. Validate touch targets — Min 44x44px for interactive elements
  6. Measure performance — CSS-in-JS libraries impact paint time; Tailwind is zero-runtime

Rules

Patterns are organized by concern:

  • Layout — Max-width containers, consistent spacing, visual hierarchy
  • Responsive Design — Mobile-first approach, breakpoints, container queries
  • Design Tokens — Color scales, spacing scales, typography families
  • Dark Mode — Proper contrast, color pairs, CSS variables for theming
  • Components — Touch targets, affordances, accessibility

See rules/ for implementation patterns and examples.

Examples

Positive Trigger

User: "Set up a Tailwind design token system with dark mode support for our component library."

Expected behavior: Use design-frontend guidance, apply token patterns with CSS variables and color pairs.

Non-Trigger

User: "Write a Node.js REST API for user authentication."

Expected behavior: Do not prioritize design-frontend; choose a more relevant skill or proceed without it.

  • Error: Hardcoding color values in classes; theme changes require refactoring

  • Cause: Not using design tokens; colors scattered across codebase

  • Solution: Use @theme to define colors as CSS variables; reference with var(--color-*)

  • Error: Dark mode looks washed out; low contrast on dark backgrounds

  • Cause: Color pairs not designed together; assumed inversion works

  • Solution: Test dark variants; use color scales with proper contrast ratios

Troubleshooting

  • Error: Container queries not working; elements not responding to container size

  • Cause: Parent not marked with @container class

  • Solution: Add @container to parent; use @sm:, @md:, @lg: variants on children

  • Error: Dark mode styles not applying; dark: variants ignored

  • Cause: Dark mode not configured; use darkMode: "class" or "media" in config

  • Solution: Configure dark mode in tailwind.config.js or CSS @custom-variant

  • Error: Touch targets too small; users struggle to tap buttons

  • Cause: Over-optimizing for desktop; assuming mouse precision on mobile

  • Solution: Use h-11 / w-11 (44px) minimum for touch targets

Comments

Markdown supported