design-tokens
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-08-26
- Stars
- ★ 1
- Forks
- 0
03 SKILL.md 正文
Design Tokens
Sistema de tokens de diseño para mantener consistencia visual.
Concepto
Los design tokens son las variables atómicas de un sistema de diseño: colores, tipografía, spacing, breakpoints, shadows, etc. Reemplazan valores hardcodeados y permiten theming global.
Estructura
tokens/
├── core/ # valores primitivos
│ ├── color.json
│ ├── typography.json
│ └── spacing.json
├── semantic/ # tokens semánticos (referencian core)
│ ├── light.json
│ └── dark.json
└── component/ # tokens de componente (opcional)
└── button.json
Core Tokens
{
"color": {
"blue-50": "#eff6ff",
"blue-100": "#dbeafe",
"blue-500": "#3b82f6",
"blue-900": "#1e3a5f",
"gray-50": "#f9fafb",
"gray-900": "#111827"
},
"spacing": {
"1": "4px",
"2": "8px",
"4": "16px",
"8": "32px",
"12": "48px"
},
"font-size": {
"sm": "14px",
"base": "16px",
"lg": "20px",
"xl": "24px",
"2xl": "32px"
}
}
Semantic Tokens
// tokens/semantic/light.json
{
"color": {
"bg-primary": "{color.gray-50}",
"bg-secondary": "#ffffff",
"text-primary": "{color.gray-900}",
"text-secondary": "#6b7280",
"border": "#e5e7eb",
"accent": "{color.blue-500}"
}
}
CSS Output
:root {
--color-bg-primary: #f9fafb;
--color-bg-secondary: #ffffff;
--color-text-primary: #111827;
--color-text-secondary: #6b7280;
--color-border: #e5e7eb;
--color-accent: #3b82f6;
--spacing-1: 4px;
--spacing-2: 8px;
--font-size-sm: 14px;
--font-size-base: 16px;
}
[data-theme="dark"] {
--color-bg-primary: #111827;
--color-bg-secondary: #1f2937;
--color-text-primary: #f9fafb;
--color-text-secondary: #d1d5db;
--color-border: #374151;
}
Herramientas
- Style Dictionary (Amazon): build pipeline tokens → CSS/JS/JSON
- Theo (Salesforce): token transform
- Design Tokens W3C: formato estándar
- Figma Tokens: sync Figma → code
Style Dictionary Setup
npm install -D style-dictionary
// style-dictionary.config.js
module.exports = {
source: ['tokens/**/*.json'],
platforms: {
css: {
transformGroup: 'css',
buildPath: 'dist/tokens/',
files: [{ destination: 'variables.css', format: 'css/variables' }]
},
js: {
transformGroup: 'js',
buildPath: 'dist/tokens/',
files: [{ destination: 'tokens.js', format: 'javascript/es6' }]
}
}
};
Dos & Don'ts
| Do | Don't |
|---|---|
| Empezar con tokens core (primitivas) | Crear tokens para cada componente |
Usar naming semántico (text-primary) |
Naming descriptivo (text-dark-gray) |
| Versionar tokens con el código | Tokens en sistema separado sin sync |
| Automatizar build con CI | Transformación manual |
| Documentar cada token | Asumir que se entienden solos |
04 同仓库更多 Skills
zustand-5
Zustand 5 state management patterns. Trigger: When managing React state with Zustand.
zod-4
Zod 4 schema validation patterns. Trigger: When using Zod for validation - breaking changes from v3.
x-bookmark-quote-posts
Workflow para revisar bookmarks de X/Twitter y convertirlos en drafts de quote posts. Accede a la sección de bookmarks vía browser headless, extrae posts recientes, y genera drafts con voz personal del usuario. No publica ni muta X — solo genera contenido para revisión. Trigger: X bookmarks, Twitter bookmarks, quote posts, bookmark automation, crear quote posts, revisar bookmarks, growth content X.
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
work-unit-commits
Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.