semantic-theming

Enforce semantic theming in Tailwind projects by preventing raw color literals.

7|3|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/BerryKuipers/claude-code-toolkit --skill semantic-theming
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semantic-theming
Source: https://github.com/BerryKuipers/claude-code-toolkit/tree/main/.claude/skills/styling/semantic-theming
Command: npx skills add https://github.com/BerryKuipers/claude-code-toolkit --skill semantic-theming

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforce semantic design tokens instead of raw colors to maintain consistent theming and reduce design drift.

Core Features & Use Cases

  • Detection: Identify raw color literals and non-semantic Tailwind classes.
  • Guidance: Suggest migration to semantic tokens from the project's tokens.
  • Integration: Works with ESLint rules and Tailwind configs to enforce theming.

Quick Start

When editing UI, prefer semantic tokens like bg-surface, text-primary, and border-primary over raw colors.

Frequently Asked Questions about semantic-theming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce semantic tokens instead of raw colors in Tailwind?

Enforce semantic tokens by defining CSS variables for your design system and using ESLint rules like no-raw-colors to prevent raw color literals. Replace hardcoded colors with semantic class names such as bg-surface, text-primary, and border-primary across your Tailwind utilities.

What's the best way to migrate raw Tailwind colors to semantic tokens?

Identify raw color utilities in your codebase, map them to semantic tokens defined in your project's theming documentation, then refactor className compositions using cn, clsx, or cva helpers. The ESLint theming rule flags violations to guide migration.

Can I use semantic theming with my existing Tailwind config?

Yes. Semantic theming integrates with your Tailwind configuration and ESLint setup. Define semantic tokens via CSS variables, configure the no-raw-colors ESLint rule, and reference your docs/THEMING.md during refactoring for consistency.

How do I audit my React components for semantic token usage?

Run your ESLint theming rule across React components and UI code to detect non-semantic utility classes and raw color literals. The rule identifies violations and suggests replacements aligned with your project's semantic token definitions.

Why should I use semantic tokens instead of raw colors?

Semantic tokens maintain consistent theming across your UI and reduce design drift. They centralize color decisions, make theme changes easier, and ensure all components follow your design system conventions rather than using arbitrary hardcoded values.

What setup do I need before using semantic theming enforcement?

Define semantic tokens as CSS variables, configure Tailwind to recognize them, and set up ESLint with the no-raw-colors theming rule. Document your token names and mappings in docs/THEMING.md for reference during refactoring.