Design system · DS0002

Use design-system color tokens

Prefer theme colors over raw color values.
DS0002vite-doctor/design-systemuiwarnSuggestion

Run this rule

pnpm vite-doctor . --extends design-system/strict --rules design-system/no-raw-colors

Why it matters

Raw palette colors and literal SVG colors bypass the project's theme. Checking undeclared color tokens and suggesting theme replacements requires a readable theme; without one, those checks are unavailable.

Use a theme token that preserves the color and opacity at the use site. Use currentColor with a theme color class only for a monochrome SVG; otherwise use a matching theme variable for each paint.

Example

Inherit the SVG color without theme lookup

Before

<svg><path fill="#ec4899" d="M0 0h10v10H0z" /></svg>

After

<svg><path fill="currentColor" d="M0 0h10v10H0z" /></svg>
Copyright © 2026