shadcn · SHAD0002

Use design-system color tokens

Prefer theme colors over raw color values.
SHAD0002vite-doctor/shadcnuiwarnSuggestion

Run this rule

pnpm vite-doctor . --extends shadcn/strict --rules shadcn/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 color token declared by the theme. For SVG, use currentColor with a theme color class or reference a theme variable.

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