Skip to main content

no-hardcoded-hex

Hardcoded hex color values should use design tokens.

SeverityDimensionFiles
ErrorToken adoption.tsx .jsx .ts .css .scss

What it flags

A line like this:

const Title = styled.h1`color: #3b82f6;`

is reported as:

Hardcoded hex color "color: #3b82f6" — use a design token instead

How to fix it

Replace with a semantic color token (e.g., var(--foreground)).

preset AI suggests a fix: Replace hardcoded color with design token. Hardcoded hex "#3b82f6" should use a semantic CSS custom property for consistent theming and dark mode support.

Before:

const Title = styled.h1`color: #3b82f6;`

After:

const Title = styled.h1`color: var(--foreground);`

Was this page helpful?

Last reviewed by @jschuyler
All systems operationalDocsDevelopersPlatformPricing
PrivacyTerms© 2026 fndd, LLC