← スキル一覧に戻る

design-tokens
by phrazzld
⭐ 2🍴 1📅 2026年1月25日
SKILL.md
name: design-tokens description: "Apply design token patterns using Tailwind CSS 4 @theme directive: CSS variables, semantic naming, color systems, typography scales, spacing, dark mode. Use when designing UI systems, reviewing design consistency, or establishing brand guidelines. Integrates with frontend-design skill for aesthetic execution."
Design Tokens
Design tokens are the single source of truth for design decisions.
Philosophy
- CSS-first: Define tokens in CSS
@theme, not JavaScript config - Semantic naming:
--color-primarynot--color-blue-500 - Brand-tinted neutrals: Add imperceptible brand hue (chroma 0.005-0.02), not pure gray
- OKLCH colors: Perceptually uniform, better than RGB/HSL
Why Tailwind CSS 4 @theme
- CSS-native (no build step overhead)
- Type-safe auto-completion
- CSS variable integration (
var(--color-primary)) - Dark mode built-in
Migration from Tailwind 3: Delete tailwind.config.js, move to CSS @theme.
Basic @theme Structure
@import "tailwindcss";
@theme {
/* Brand hue - single source of truth */
--brand-hue: 250;
/* Colors - OKLCH with semantic names */
--color-primary: oklch(0.6 0.2 var(--brand-hue));
--color-background: oklch(0.995 0.005 var(--brand-hue)); /* Brand-tinted */
--color-foreground: oklch(0.15 0.02 var(--brand-hue));
/* Typography */
--font-sans: "Inter Variable", system-ui, sans-serif;
--font-size-base: 1rem;
/* Spacing (8-point grid) */
--spacing-md: 1rem;
--radius-md: 0.5rem;
}
Best Practices
Do
- Use semantic names (
--color-primary) - Use OKLCH colors
- Tint neutrals with brand hue
- Follow 8-point spacing grid
- Support dark mode from start
- Create component tokens
Don't
- Hardcode values
- Use pure grays (chroma 0)
- Use generic fonts (Inter/Roboto)
- Skip dark mode
- Create too many tokens initially
Dark Mode Pattern
Same brand hue, inverted lightness:
@theme {
--brand-hue: 250;
--color-background: oklch(0.995 0.005 var(--brand-hue));
@media (prefers-color-scheme: dark) {
--color-background: oklch(0.12 0.015 var(--brand-hue));
}
}
References
Detailed patterns:
references/color-system.md— OKLCH, semantic colors, brand-tinted neutralsreferences/typography.md— Type scale, font pairings, font loadingreferences/spacing.md— 8-point grid, radius, shadows, breakpoints, z-indexreferences/dark-mode.md— System preference, manual toggle, componentreferences/component-tokens.md— Button, input, card, animation, WebGL
Integration
Design tokens provide the foundation; frontend-design provides aesthetic direction.
- Load design-tokens for the system
- Load frontend-design for aesthetic execution
- Result: Consistent system + distinctive design
"Design tokens are contracts between design and development."
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です