Enforce semantic CSS variable theming in Tailwind projects. Prevents raw colors (hex, rgb) and non-theme Tailwind classes. Use when project has semantic tokens, CSS vars, or custom ESLint theming rules.
Use semantic design tokens instead of raw colors. This skill teaches Claude to write theme-compliant code from the start.
This skill applies when the project has ANY of:
docs/THEMING.md existseslint-rules/no-raw-colors.js existswescobar/no-raw-colors or similar theming rulesrc/index.css defines CSS custom properties (e.g., --color-primary)Quick check: Look for these indicators before applying this skill.
classNamecn(), clsx(), or cva() class composition// FORBIDDEN - Will fail ESLint
style={{ color: '#ff0000' }}
style={{ backgroundColor: 'rgb(255, 0, 0)' }}
style={{ borderColor: 'hsl(0, 100%, 50%)' }}
// FORBIDDEN - Will fail ESLint
className="bg-red-500"
className="text-white"
className="border-blue-300"
className="bg-slate-900 text-gray-100"
className="from-purple-500 via-pink-500 to-red-500"
// CORRECT - Use semantic tokens
className="bg-surface text-primary"
className="bg-surface-secondary border-primary"
className="bg-error text-error"
className="bg-success text-success"
className="text-secondary bg-primary"
| Category | Tokens |
|----------|--------|
| Background | bg-surface, bg-surface-secondary, bg-primary, bg-error, bg-success |
| Text | text-primary, text-secondary, text-accent, text-error, text-success |
| Border | border-primary, border-error, border-surface |
// CORRECT - Semantic tokens in cn/clsx/cva
import { cn } from '@/lib/utils';
className={cn(
"bg-surface text-primary",
isActive && "bg-primary text-surface",
hasError && "border-error text-error"
)}
// CORRECT - Semantic tokens in cva
const buttonVariants = cva(
"bg-surface text-primary border-primary", // Base
{
variants: {
variant: {
primary: "bg-primary text-surface",
error: "bg-error text-surface",
success: "bg-success text-surface",
}
}
}
);
When absolutely necessary (rare):
// Line-level disable
// eslint-disable-next-line wescobar/no-raw-colors
className="bg-red-500" // Legacy code migration
// File-level disable (very rare)
/* eslint-disable wescobar/no-raw-colors */
Use sparingly - prefer fixing to disabling.
| Old (Forbidden) | New (Semantic) |
|-----------------|----------------|
| bg-white | bg-surface |
| bg-gray-900 | bg-surface-secondary |
| text-white | text-surface (on dark bg) |
| text-gray-900 | text-primary |
| text-gray-500 | text-secondary |
| border-gray-300 | border-primary |
| bg-red-500 | bg-error |
| bg-green-500 | bg-success |
| text-blue-500 | text-accent |
Check docs/THEMING.md or src/index.css for the full list of available semantic tokens in this project. Token names may vary between projects.
The no-raw-colors ESLint rule enforces this at:
Generate correct code from the start to avoid fix cycles.
validate-lint - Run linting validationquality-gate - Complete quality checks including lintAfter writing styled code:
docs/THEMING.md for available tokensnpx skills add BerryKuipers/semantic-theming下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer