Communitygithub.com

color-system

Build and audit color - OKLCH ramps, semantic role tokens in Tailwind, light and dark themes, one-meaning-per-color, contrast measured on the rendered pair, gradients and P3. Use when picking or generating a palette, naming color tokens, adding dark mode, fixing contrast, or when components use raw hex or bg-blue-600 directly.

color-system とは?

color-system is a Claude Code agent skill that build and audit color - OKLCH ramps, semantic role tokens in Tailwind, light and dark themes, one-meaning-per-color, contrast measured on the rendered pair, gradients and P3. Use when picking or generating a palette, naming color tokens, adding dark mode, fixing contrast, or when components use raw hex or bg-blue-600 directly.

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/manishdashsharma/ui-ux-skills/tree/HEAD/skills/color-system

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Color System

A system is ramps and roles, not a bag of colors. Never estimate a color you can compute, never report a contrast ratio you didn't measure.

Ramps

  • One neutral ramp, one accent ramp, and only the status ramps the product actually renders. A warning ramp nothing uses is maintenance for zero pixels. A second accent hue earns its place only when two things must be told apart at a glance.
  • Build new ramps in oklch(). Hold one hue end to end, peak chroma mid-ramp, and step finely at the light end (about 0.04–0.05 in L per step there). Use a color library or script (culori, colorjs.io) — never eyeball steps or copy one chroma number across hues; use the same proportion of each hue's own maximum.
  • Tint neutrals toward the product's world (warm paper, cool graphite, ink blue) — a few thousandths of chroma, not a visible color. In apps, backgrounds and surfaces stay nearly neutral; the color lives in the accent and the moments. Landing pages can tint further.
  • Every step has a job (12-step model): 1–2 backgrounds, 3–5 component fills (rest, hover, pressed), 6–8 borders, 9–10 solid fills, 11–12 text. Don't generate steps no role consumes.

Tokens

  • Primitives name a value (--color-blue-9) and are never used in a component.
  • Semantic tokens name a job and point at a primitive: bg, surface, surface-raised, fg, fg-muted, fg-subtle, hairline, accent, accent-hover, on-accent, danger, success. Components use only these (bg-surface, text-fg-muted). Wiring is in tailwind-setup §5.
  • Name semantics by role, never hue or component: accent-solid, not blue-button. If you have primary for brand and text-primary for text, rename brand to accent.
  • Never borrow a token for another role because its value is right today. A border token used as text color breaks when borders get lighter. Missing role → add the token.

Use

  • One color, one meaning across the whole interface. Hues within ~15° in OKLCH count as the same color — keep status hues 15°+ from the accent, or give destructive actions a distinct treatment.
  • Color is never the only carrier of meaning. Pair with an icon, label or shape.
  • One filled primary action per view. Color goes on the background, not the label; peers stay neutral.
  • Three text roles (primary, secondary, muted), not ten near-identical grays.
  • Borders are quiet hairlines: the text color at 6–10% alpha.
  • No hue gradients on surfaces, gradient text, colored glows, colored shadows, radial color washes or blobs behind content. A gradient is allowed as a small tone shift inside one neutral, or inside a moment (an illustration, a rendered object).
  • Gradients interpolate in oklab by default; in oklch when a two-hue gradient goes gray in the middle.

Dark mode

  • Not the light ramp reversed. Lower the accent's chroma a little, widen the dark end, and remeasure every pair.
  • Depth on dark comes from surface steps and hairlines, not shadows.
  • On dark, the primary button can be an off-white from the ramp with dark text, with the accent on a smaller place (selection, key figure).
  • One switching mechanism (class or media query), never both.
  • prefers-contrast: more gets its own value per appearance.

Contrast

PairMinimum
Body text4.5:1
Large text (≥ 24px, or ≥ 18.67px bold)3:1
UI boundaries, focus rings, meaningful icons3:1
  • Measure the foreground against the background it actually renders on (cards, overlays, images), including alpha. Text on /50 or rgba( needs the rendered result measured.
  • White on most Tailwind 500 fills fails 4.5:1. Measure, don't assume.
  • A contrast fix changes lightness, not hue.
  • When a pair fails in someone else's design, report the pair, the measured ratio and the threshold, and leave the colors alone unless asked.

Wide gamut

Declare the sRGB value first, then the vivid P3 one inside @media (color-gamut: p3). Never ship an oklch() chroma beyond sRGB with no fallback.

Native

React Native doesn't parse oklch() everywhere — compute hex/rgb from the OKLCH ramp at build time and put those in tailwind.config.js. Same roles, same names.

Before you finish

PatternFix
Hex/rgb(/oklch( literal or bg-blue-600 in a componentSemantic token
One oklch() in an otherwise hex codebaseKeep the established notation unless migrating
Semantic name containing a hue or componentRename by role
Two accent-ish hues competingOne accent, more steps
Status hue within 15° of the accentMove it
Dark theme = light ramp reversedRebuild the dark end, remeasure
Tokens under both .dark and prefers-color-schemePick one
text-white on a 500 fillMeasure; darken the fill or use dark text

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

accessibility

Build and review interfaces against WCAG 2.2 AA - native elements first, keyboard paths, visible focus, focus trapping and restoring, hit areas, labels and forms, error announcements, accessible names, contrast thresholds, reduced motion, timers, live regions, alt text, zoom and reflow - for web (Tailwind) and React Native. Use when building any interactive UI, forms, dialogs, menus or custom widgets, or when auditing accessibility.

create-ui

Build a complete frontend from a product description — web app, landing page, dashboard or Expo/React Native mobile app — in one consistent flow - scope screens → direction (wait for OK) → Tailwind and tokens → components → every state → motion pass → review → verify in browser or iOS simulator. Use when the user asks to build, create or design an app, site, page set or set of screens (for example "build an iOS app like X with Expo", "make a dashboard for Y", "build the frontend for this PRD").

design-direction

Decide what a product should look and feel like before building it — ground the design in the subject, write a five-line direction, plan tokens (palette, type, layout, motion), check the plan against the usual AI defaults, and lock it in DESIGN.md. Uses the user's references, design system, Mobbin/inspiration tools or theme presets when given. Use at the start of any new app, page, screen set or redesign, when the user pastes references or a design system link, asks to "match this vibe", or says the UI looks generic.

typography

Set and review how text renders - choosing typefaces, a role-based type scale as Tailwind tokens, line-height and tracking by size, measure, wrapping, truncation, tabular numbers, punctuation, font loading and size floors, on web and native. Use when picking fonts, defining a type scale, fixing text that looks off, or reviewing headings, labels, numbers and long-form text.

関連スキル