ckm-design-system
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDesign System
设计系统
Token architecture, component specifications, systematic design, slide generation.
Token架构、组件规范、系统化设计、幻灯片生成。
When to Use
使用场景
- Design token creation
- Component state definitions
- CSS variable systems
- Spacing/typography scales
- Design-to-code handoff
- Tailwind theme configuration
- Slide/presentation generation
- 设计Token创建
- 组件状态定义
- CSS变量系统
- 间距/排版比例
- 设计到代码的交付
- Tailwind主题配置
- 幻灯片/演示文稿生成
Token Architecture
Token架构
Load:
references/token-architecture.md加载:
references/token-architecture.mdThree-Layer Structure
三层结构
Primitive (raw values)
↓
Semantic (purpose aliases)
↓
Component (component-specific)Example:
css
/* Primitive */
--color-blue-600: #2563EB;
/* Semantic */
--color-primary: var(--color-blue-600);
/* Component */
--button-bg: var(--color-primary);Primitive (原始值)
↓
Semantic (用途别名)
↓
Component (组件专属)示例:
css
/* Primitive */
--color-blue-600: #2563EB;
/* Semantic */
--color-primary: var(--color-blue-600);
/* Component */
--button-bg: var(--color-primary);Quick Start
快速开始
Generate tokens:
bash
node scripts/generate-tokens.cjs --config tokens.json -o tokens.cssValidate usage:
bash
node scripts/validate-tokens.cjs --dir src/生成Token:
bash
node scripts/generate-tokens.cjs --config tokens.json -o tokens.css验证使用情况:
bash
node scripts/validate-tokens.cjs --dir src/References
参考资料
| Topic | File |
|---|---|
| Token Architecture | |
| Primitive Tokens | |
| Semantic Tokens | |
| Component Tokens | |
| Component Specs | |
| States & Variants | |
| Tailwind Integration | |
| 主题 | 文件 |
|---|---|
| Token架构 | |
| 原始层Token | |
| 语义层Token | |
| 组件层Token | |
| 组件规范 | |
| 状态与变体 | |
| Tailwind集成 | |
Component Spec Pattern
组件规范模式
| Property | Default | Hover | Active | Disabled |
|---|---|---|---|---|
| Background | primary | primary-dark | primary-darker | muted |
| Text | white | white | white | muted-fg |
| Border | none | none | none | muted-border |
| Shadow | sm | md | none | none |
| 属性 | 默认状态 | 悬停状态 | 激活状态 | 禁用状态 |
|---|---|---|---|---|
| 背景 | primary | primary-dark | primary-darker | muted |
| 文字 | white | white | white | muted-fg |
| 边框 | none | none | none | muted-border |
| 阴影 | sm | md | none | none |
Scripts
脚本
| Script | Purpose |
|---|---|
| Generate CSS from JSON token config |
| Check for hardcoded values in code |
| BM25 search + contextual recommendations |
| Validate slide HTML for token compliance |
| Fetch images from Pexels/Unsplash |
| 脚本 | 用途 |
|---|---|
| 从JSON Token配置生成CSS |
| 检查代码中的硬编码值 |
| BM25搜索 + 上下文推荐 |
| 验证幻灯片HTML的Token合规性 |
| 从Pexels/Unsplash获取图片 |
Templates
模板
| Template | Purpose |
|---|---|
| Starter JSON with three-layer structure |
| 模板 | 用途 |
|---|---|
| 包含三层结构的初始JSON模板 |
Integration
集成
With brand: Extract primitives from brand colors/typography
With ui-styling: Component tokens → Tailwind config
Skill Dependencies: brand, ui-styling
Primary Agents: ui-ux-designer, frontend-developer
与品牌集成: 从品牌颜色/排版中提取原始层Token
与UI样式集成: 组件层Token → Tailwind配置
技能依赖: brand、ui-styling
核心角色: ui-ux-designer、frontend-developer
Slide System
幻灯片系统
Brand-compliant presentations using design tokens + Chart.js + contextual decision system.
使用Design Token + Chart.js + 上下文决策系统制作符合品牌规范的演示文稿。
Source of Truth
单一可信来源
| File | Purpose |
|---|---|
| Brand identity, voice, colors |
| Token definitions (primitive→semantic→component) |
| CSS variables (import in slides) |
| CSS animation library |
| 文件 | 用途 |
|---|---|
| 品牌标识、语气、颜色 |
| Token定义(原始层→语义层→组件层) |
| CSS变量(导入到幻灯片中) |
| CSS动画库 |
Slide Search (BM25)
幻灯片搜索(BM25)
bash
undefinedbash
undefinedBasic search (auto-detect domain)
基础搜索(自动检测领域)
python scripts/search-slides.py "investor pitch"
python scripts/search-slides.py "investor pitch"
Domain-specific search
特定领域搜索
python scripts/search-slides.py "problem agitation" -d copy
python scripts/search-slides.py "revenue growth" -d chart
python scripts/search-slides.py "problem agitation" -d copy
python scripts/search-slides.py "revenue growth" -d chart
Contextual search (Premium System)
上下文搜索(高级系统)
python scripts/search-slides.py "problem slide" --context --position 2 --total 9
python scripts/search-slides.py "cta" --context --position 9 --prev-emotion frustration
undefinedpython scripts/search-slides.py "problem slide" --context --position 2 --total 9
python scripts/search-slides.py "cta" --context --position 9 --prev-emotion frustration
undefinedDecision System CSVs
决策系统CSV文件
| File | Purpose |
|---|---|
| 15 deck structures + emotion arcs + sparkline beats |
| 25 layouts + component variants + animations |
| Goal → Layout + break_pattern flag |
| Content type → Typography scale |
| Emotion → Color treatment |
| Slide type → Image category (Pexels/Unsplash) |
| 25 copywriting formulas (PAS, AIDA, FAB) |
| 25 chart types with Chart.js config |
| 文件 | 用途 |
|---|---|
| 15种演示文稿结构 + 情感曲线 + Duarte Sparkline节奏 |
| 25种布局 + 组件变体 + 动画效果 |
| 目标 → 布局 + break_pattern标记 |
| 内容类型 → 排版比例 |
| 情感 → 色彩处理方案 |
| 幻灯片类型 → 图片分类(Pexels/Unsplash) |
| 25种文案公式(PAS、AIDA、FAB) |
| 25种图表类型及Chart.js配置 |
Contextual Decision Flow
上下文决策流程
1. Parse goal/context
↓
2. Search slide-strategies.csv → Get strategy + emotion beats
↓
3. For each slide:
a. Query slide-layout-logic.csv → layout + break_pattern
b. Query slide-typography.csv → type scale
c. Query slide-color-logic.csv → color treatment
d. Query slide-backgrounds.csv → image if needed
e. Apply animation class from slide-animations.css
↓
4. Generate HTML with design tokens
↓
5. Validate with slide-token-validator.py1. 解析目标/上下文
↓
2. 搜索slide-strategies.csv → 获取策略 + 情感节奏
↓
3. 针对每张幻灯片:
a. 查询slide-layout-logic.csv → 布局 + break_pattern
b. 查询slide-typography.csv → 排版比例
c. 查询slide-color-logic.csv → 色彩处理方案
d. 查询slide-backgrounds.csv → 按需获取图片
e. 应用slide-animations.css中的动画类
↓
4. 使用Design Token生成HTML
↓
5. 通过slide-token-validator.py验证合规性Pattern Breaking (Duarte Sparkline)
模式打破(Duarte Sparkline)
Premium decks alternate between emotions for engagement:
"What Is" (frustration) ↔ "What Could Be" (hope)System calculates pattern breaks at 1/3 and 2/3 positions.
高级演示文稿会交替使用不同情感以提升吸引力:
"现状"(挫败感) ↔ "愿景"(希望)系统会在1/3和2/3位置计算模式打破点。
Slide Requirements
幻灯片要求
ALL slides MUST:
- Import - single source of truth
assets/design-tokens.css - Use CSS variables: ,
var(--color-primary), etc.var(--slide-bg) - Use Chart.js for charts (NOT CSS-only bars)
- Include navigation (keyboard arrows, click, progress bar)
- Center align content
- Focus on persuasion/conversion
所有幻灯片必须:
- 导入——单一可信来源
assets/design-tokens.css - 使用CSS变量:、
var(--color-primary)等var(--slide-bg) - 使用Chart.js制作图表(禁止仅用CSS实现柱状图)
- 包含导航功能(键盘箭头、点击、进度条)
- 内容居中对齐
- 聚焦于说服力/转化效果
Chart.js Integration
Chart.js集成
html
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<canvas id="revenueChart"></canvas>
<script>
new Chart(document.getElementById('revenueChart'), {
type: 'line',
data: {
labels: ['Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
data: [5, 12, 28, 45],
borderColor: '#FF6B6B', // Use brand coral
backgroundColor: 'rgba(255, 107, 107, 0.1)',
fill: true,
tension: 0.4
}]
}
});
</script>html
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<canvas id="revenueChart"></canvas>
<script>
new Chart(document.getElementById('revenueChart'), {
type: 'line',
data: {
labels: ['Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
data: [5, 12, 28, 45],
borderColor: '#FF6B6B', // 使用品牌珊瑚色
backgroundColor: 'rgba(255, 107, 107, 0.1)',
fill: true,
tension: 0.4
}]
}
});
</script>Token Compliance
Token合规性
css
/* CORRECT - uses token */
background: var(--slide-bg);
color: var(--color-primary);
font-family: var(--typography-font-heading);
/* WRONG - hardcoded */
background: #0D0D0D;
color: #FF6B6B;
font-family: 'Space Grotesk';css
/* 正确用法 - 使用Token */
background: var(--slide-bg);
color: var(--color-primary);
font-family: var(--typography-font-heading);
/* 错误用法 - 硬编码值 */
background: #0D0D0D;
color: #FF6B6B;
font-family: 'Space Grotesk';Reference Implementation
参考实现
Working example with all features:
assets/designs/slides/claudekit-pitch-251223.html包含所有功能的工作示例:
assets/designs/slides/claudekit-pitch-251223.htmlCommand
命令
bash
/slides:create "10-slide investor pitch for ClaudeKit Marketing"bash
/slides:create "10-slide investor pitch for ClaudeKit Marketing"Best Practices
最佳实践
- Never use raw hex in components - always reference tokens
- Semantic layer enables theme switching (light/dark)
- Component tokens enable per-component customization
- Use HSL format for opacity control
- Document every token's purpose
- Slides must import design-tokens.css and use var() exclusively
- 组件中绝不使用原始十六进制值——始终引用Token
- 语义层支持主题切换(亮色/暗色)
- 组件层支持按组件自定义样式
- 使用HSL格式实现透明度控制
- 为每个Token记录用途说明
- 幻灯片必须导入design-tokens.css并仅使用var()引用Token