Design system · DS0004

Avoid inline styles

Keep styling in the design system rather than component call sites.
DS0004vite-doctor/design-systemuiwarnSuggestion

Run this rule

pnpm vite-doctor . --extends design-system/strict --rules design-system/no-inline-styles

Why it matters

Ordinary inline properties bypass class-based styling. The Rule checks JSX elements, unreadable style objects, hardcoded colors in custom properties, and style elements.

Use classes for styling. Pass dynamic values through CSS custom properties when needed, and use theme variables for colors.

Example

Replace an inline color with a theme class

Before

<div style={{ color: "var(--color-primary)" }}>Account settings</div>

After

<div className="text-primary">Account settings</div>
Copyright © 2026