mozaic-mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALLATION.md +232 -0
- package/README.md +262 -0
- package/SKILLS.md +411 -0
- package/bin/install-skills.js +171 -0
- package/data/mozaic.db +0 -0
- package/data/mozaic.db-shm +0 -0
- package/data/mozaic.db-wal +0 -0
- package/dist/__tests__/sanity-check.test.d.ts +2 -0
- package/dist/__tests__/sanity-check.test.d.ts.map +1 -0
- package/dist/__tests__/sanity-check.test.js +167 -0
- package/dist/__tests__/sanity-check.test.js.map +1 -0
- package/dist/__tests__/tools.integration.test.d.ts +2 -0
- package/dist/__tests__/tools.integration.test.d.ts.map +1 -0
- package/dist/__tests__/tools.integration.test.js +220 -0
- package/dist/__tests__/tools.integration.test.js.map +1 -0
- package/dist/db/queries.d.ts +144 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +536 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.d.ts +4 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +253 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +416 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/__tests__/docs-parser.test.d.ts +2 -0
- package/dist/parsers/__tests__/docs-parser.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/docs-parser.test.js +251 -0
- package/dist/parsers/__tests__/docs-parser.test.js.map +1 -0
- package/dist/parsers/__tests__/icons-parser.test.d.ts +2 -0
- package/dist/parsers/__tests__/icons-parser.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/icons-parser.test.js +169 -0
- package/dist/parsers/__tests__/icons-parser.test.js.map +1 -0
- package/dist/parsers/__tests__/react-parser.test.d.ts +2 -0
- package/dist/parsers/__tests__/react-parser.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/react-parser.test.js +274 -0
- package/dist/parsers/__tests__/react-parser.test.js.map +1 -0
- package/dist/parsers/__tests__/scss-parser.test.d.ts +2 -0
- package/dist/parsers/__tests__/scss-parser.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/scss-parser.test.js +364 -0
- package/dist/parsers/__tests__/scss-parser.test.js.map +1 -0
- package/dist/parsers/__tests__/tokens-parser.test.d.ts +2 -0
- package/dist/parsers/__tests__/tokens-parser.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/tokens-parser.test.js +172 -0
- package/dist/parsers/__tests__/tokens-parser.test.js.map +1 -0
- package/dist/parsers/__tests__/vue-parser.test.d.ts +2 -0
- package/dist/parsers/__tests__/vue-parser.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/vue-parser.test.js +207 -0
- package/dist/parsers/__tests__/vue-parser.test.js.map +1 -0
- package/dist/parsers/docs-parser.d.ts +4 -0
- package/dist/parsers/docs-parser.d.ts.map +1 -0
- package/dist/parsers/docs-parser.js +237 -0
- package/dist/parsers/docs-parser.js.map +1 -0
- package/dist/parsers/icons-parser.d.ts +33 -0
- package/dist/parsers/icons-parser.d.ts.map +1 -0
- package/dist/parsers/icons-parser.js +125 -0
- package/dist/parsers/icons-parser.js.map +1 -0
- package/dist/parsers/react-parser.d.ts +3 -0
- package/dist/parsers/react-parser.d.ts.map +1 -0
- package/dist/parsers/react-parser.js +406 -0
- package/dist/parsers/react-parser.js.map +1 -0
- package/dist/parsers/scss-parser.d.ts +9 -0
- package/dist/parsers/scss-parser.d.ts.map +1 -0
- package/dist/parsers/scss-parser.js +351 -0
- package/dist/parsers/scss-parser.js.map +1 -0
- package/dist/parsers/tokens/border-parser.d.ts +3 -0
- package/dist/parsers/tokens/border-parser.d.ts.map +1 -0
- package/dist/parsers/tokens/border-parser.js +83 -0
- package/dist/parsers/tokens/border-parser.js.map +1 -0
- package/dist/parsers/tokens/color-parser.d.ts +3 -0
- package/dist/parsers/tokens/color-parser.d.ts.map +1 -0
- package/dist/parsers/tokens/color-parser.js +88 -0
- package/dist/parsers/tokens/color-parser.js.map +1 -0
- package/dist/parsers/tokens/grid-parser.d.ts +3 -0
- package/dist/parsers/tokens/grid-parser.d.ts.map +1 -0
- package/dist/parsers/tokens/grid-parser.js +97 -0
- package/dist/parsers/tokens/grid-parser.js.map +1 -0
- package/dist/parsers/tokens/index.d.ts +9 -0
- package/dist/parsers/tokens/index.d.ts.map +1 -0
- package/dist/parsers/tokens/index.js +10 -0
- package/dist/parsers/tokens/index.js.map +1 -0
- package/dist/parsers/tokens/screen-parser.d.ts +3 -0
- package/dist/parsers/tokens/screen-parser.d.ts.map +1 -0
- package/dist/parsers/tokens/screen-parser.js +54 -0
- package/dist/parsers/tokens/screen-parser.js.map +1 -0
- package/dist/parsers/tokens/shadow-parser.d.ts +3 -0
- package/dist/parsers/tokens/shadow-parser.d.ts.map +1 -0
- package/dist/parsers/tokens/shadow-parser.js +62 -0
- package/dist/parsers/tokens/shadow-parser.js.map +1 -0
- package/dist/parsers/tokens/spacing-parser.d.ts +4 -0
- package/dist/parsers/tokens/spacing-parser.d.ts.map +1 -0
- package/dist/parsers/tokens/spacing-parser.js +85 -0
- package/dist/parsers/tokens/spacing-parser.js.map +1 -0
- package/dist/parsers/tokens/types.d.ts +33 -0
- package/dist/parsers/tokens/types.d.ts.map +1 -0
- package/dist/parsers/tokens/types.js +42 -0
- package/dist/parsers/tokens/types.js.map +1 -0
- package/dist/parsers/tokens/typography-parser.d.ts +3 -0
- package/dist/parsers/tokens/typography-parser.d.ts.map +1 -0
- package/dist/parsers/tokens/typography-parser.js +76 -0
- package/dist/parsers/tokens/typography-parser.js.map +1 -0
- package/dist/parsers/tokens-parser.d.ts +18 -0
- package/dist/parsers/tokens-parser.d.ts.map +1 -0
- package/dist/parsers/tokens-parser.js +57 -0
- package/dist/parsers/tokens-parser.js.map +1 -0
- package/dist/parsers/vue-parser.d.ts +3 -0
- package/dist/parsers/vue-parser.d.ts.map +1 -0
- package/dist/parsers/vue-parser.js +343 -0
- package/dist/parsers/vue-parser.js.map +1 -0
- package/dist/tools/generate-react-component.d.ts +35 -0
- package/dist/tools/generate-react-component.d.ts.map +1 -0
- package/dist/tools/generate-react-component.js +81 -0
- package/dist/tools/generate-react-component.js.map +1 -0
- package/dist/tools/generate-vue-component.d.ts +35 -0
- package/dist/tools/generate-vue-component.d.ts.map +1 -0
- package/dist/tools/generate-vue-component.js +81 -0
- package/dist/tools/generate-vue-component.js.map +1 -0
- package/dist/tools/get-component-info.d.ts +52 -0
- package/dist/tools/get-component-info.d.ts.map +1 -0
- package/dist/tools/get-component-info.js +94 -0
- package/dist/tools/get-component-info.js.map +1 -0
- package/dist/tools/get-css-utility.d.ts +41 -0
- package/dist/tools/get-css-utility.d.ts.map +1 -0
- package/dist/tools/get-css-utility.js +57 -0
- package/dist/tools/get-css-utility.js.map +1 -0
- package/dist/tools/get-design-tokens.d.ts +44 -0
- package/dist/tools/get-design-tokens.d.ts.map +1 -0
- package/dist/tools/get-design-tokens.js +124 -0
- package/dist/tools/get-design-tokens.js.map +1 -0
- package/dist/tools/get-icon.d.ts +32 -0
- package/dist/tools/get-icon.d.ts.map +1 -0
- package/dist/tools/get-icon.js +108 -0
- package/dist/tools/get-icon.js.map +1 -0
- package/dist/tools/get-install-info.d.ts +39 -0
- package/dist/tools/get-install-info.d.ts.map +1 -0
- package/dist/tools/get-install-info.js +160 -0
- package/dist/tools/get-install-info.js.map +1 -0
- package/dist/tools/list-components.d.ts +32 -0
- package/dist/tools/list-components.d.ts.map +1 -0
- package/dist/tools/list-components.js +62 -0
- package/dist/tools/list-components.js.map +1 -0
- package/dist/tools/list-css-utilities.d.ts +27 -0
- package/dist/tools/list-css-utilities.d.ts.map +1 -0
- package/dist/tools/list-css-utilities.js +48 -0
- package/dist/tools/list-css-utilities.js.map +1 -0
- package/dist/tools/search-documentation.d.ts +37 -0
- package/dist/tools/search-documentation.d.ts.map +1 -0
- package/dist/tools/search-documentation.js +120 -0
- package/dist/tools/search-documentation.js.map +1 -0
- package/dist/tools/search-icons.d.ts +41 -0
- package/dist/tools/search-icons.d.ts.map +1 -0
- package/dist/tools/search-icons.js +134 -0
- package/dist/tools/search-icons.js.map +1 -0
- package/package.json +98 -0
- package/skills/mozaic-css-utilities/skill.md +633 -0
- package/skills/mozaic-design-tokens/skill.md +621 -0
- package/skills/mozaic-icons/skill.md +624 -0
- package/skills/mozaic-react-builder/skill.md +652 -0
- package/skills/mozaic-vue-builder/skill.md +491 -0
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mozaic-design-tokens
|
|
3
|
+
description: Mozaic Design System tokens and styling expert. Access design tokens (colors, typography, spacing, shadows, borders, breakpoints, grid) in multiple formats (JSON, SCSS, CSS, JS) and search documentation for styling guidance.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Mozaic Design Tokens
|
|
8
|
+
|
|
9
|
+
An expert assistant for working with Mozaic Design System tokens and styling. This skill helps you discover and use design tokens for colors, typography, spacing, shadows, borders, responsive breakpoints, and grid systems across your projects.
|
|
10
|
+
|
|
11
|
+
## What This Skill Does
|
|
12
|
+
|
|
13
|
+
1. **Browse Design Tokens**: Access tokens by category (colors, typography, spacing, etc.)
|
|
14
|
+
2. **Multiple Formats**: Get tokens in JSON, SCSS, CSS, or JavaScript formats
|
|
15
|
+
3. **Search Documentation**: Find styling guidance and best practices
|
|
16
|
+
4. **Responsive Design**: Work with breakpoints and responsive patterns
|
|
17
|
+
5. **Consistent Styling**: Ensure design system consistency across your app
|
|
18
|
+
|
|
19
|
+
## MCP Tools Used
|
|
20
|
+
|
|
21
|
+
This skill uses the Mozaic MCP server tools:
|
|
22
|
+
- `mcp__mozaic__get_design_tokens` - Get design tokens by category and format
|
|
23
|
+
- `mcp__mozaic__search_documentation` - Search Mozaic documentation for styling info
|
|
24
|
+
|
|
25
|
+
## When to Use This Skill
|
|
26
|
+
|
|
27
|
+
Use this skill when you:
|
|
28
|
+
- Need to know brand colors or semantic colors
|
|
29
|
+
- Want to use consistent typography (font sizes, weights, line heights)
|
|
30
|
+
- Need spacing values following the magic unit scale
|
|
31
|
+
- Want to apply shadows, borders, or other design tokens
|
|
32
|
+
- Need responsive breakpoint values
|
|
33
|
+
- Want to understand grid system configuration
|
|
34
|
+
- Need tokens in specific format (SCSS variables, CSS custom properties, etc.)
|
|
35
|
+
|
|
36
|
+
## Design Token Categories
|
|
37
|
+
|
|
38
|
+
### 1. Colors
|
|
39
|
+
- **Brand Colors**: Primary brand identity colors
|
|
40
|
+
- **Semantic Colors**: Success, error, warning, info colors
|
|
41
|
+
- **Component Colors**: Specific to UI components (buttons, inputs, etc.)
|
|
42
|
+
- **Grays**: Neutral color scale
|
|
43
|
+
- **Background Colors**: Surface and background colors
|
|
44
|
+
- **Text Colors**: Typography color palette
|
|
45
|
+
|
|
46
|
+
### 2. Typography
|
|
47
|
+
- **Font Sizes**: Consistent type scale
|
|
48
|
+
- **Font Weights**: Regular, medium, bold, etc.
|
|
49
|
+
- **Line Heights**: Optimal line spacing
|
|
50
|
+
- **Letter Spacing**: Character spacing values
|
|
51
|
+
- **Font Families**: Primary and fallback fonts
|
|
52
|
+
|
|
53
|
+
### 3. Spacing
|
|
54
|
+
- **Magic Unit Scale**: Consistent spacing system (4px, 8px, 16px, 24px, etc.)
|
|
55
|
+
- **Component Spacing**: Internal component padding/margins
|
|
56
|
+
- **Layout Spacing**: Page-level spacing values
|
|
57
|
+
|
|
58
|
+
### 4. Shadows
|
|
59
|
+
- **Elevation Levels**: Shadow depths for layering
|
|
60
|
+
- **Focus Shadows**: Interactive element focus states
|
|
61
|
+
- **Component Shadows**: Card, modal, dropdown shadows
|
|
62
|
+
|
|
63
|
+
### 5. Borders
|
|
64
|
+
- **Border Widths**: Consistent border thickness
|
|
65
|
+
- **Border Radius**: Corner rounding values
|
|
66
|
+
- **Border Colors**: Border color palette
|
|
67
|
+
|
|
68
|
+
### 6. Screens (Breakpoints)
|
|
69
|
+
- **Mobile**: Small screen breakpoints
|
|
70
|
+
- **Tablet**: Medium screen breakpoints
|
|
71
|
+
- **Desktop**: Large screen breakpoints
|
|
72
|
+
- **Wide**: Extra-large screen breakpoints
|
|
73
|
+
|
|
74
|
+
### 7. Grid
|
|
75
|
+
- **Gutters**: Grid column spacing
|
|
76
|
+
- **Columns**: Grid column configuration
|
|
77
|
+
- **Container Widths**: Max container widths per breakpoint
|
|
78
|
+
|
|
79
|
+
## Interactive Workflow
|
|
80
|
+
|
|
81
|
+
### Step 1: What Do You Need?
|
|
82
|
+
|
|
83
|
+
When you activate this skill, I'll ask:
|
|
84
|
+
|
|
85
|
+
**"What type of design token do you need?"**
|
|
86
|
+
|
|
87
|
+
Options:
|
|
88
|
+
- A) Colors (brand, semantic, component)
|
|
89
|
+
- B) Typography (sizes, weights, line heights)
|
|
90
|
+
- C) Spacing (magic unit scale, component spacing)
|
|
91
|
+
- D) Shadows (elevation, focus, component)
|
|
92
|
+
- E) Borders (widths, radius, colors)
|
|
93
|
+
- F) Breakpoints (responsive screen sizes)
|
|
94
|
+
- G) Grid (gutters, columns, containers)
|
|
95
|
+
- H) All tokens (complete system)
|
|
96
|
+
|
|
97
|
+
### Step 2: Choose Output Format
|
|
98
|
+
|
|
99
|
+
**"What format do you need?"**
|
|
100
|
+
|
|
101
|
+
- A) JSON (structured data)
|
|
102
|
+
- B) SCSS ($variables)
|
|
103
|
+
- C) CSS (--custom-properties)
|
|
104
|
+
- D) JavaScript (constants)
|
|
105
|
+
|
|
106
|
+
### Step 3: Browse and Select
|
|
107
|
+
|
|
108
|
+
I'll use `mcp__mozaic__get_design_tokens` to show available tokens.
|
|
109
|
+
|
|
110
|
+
**Example - Colors in SCSS format**:
|
|
111
|
+
```scss
|
|
112
|
+
// Brand Colors
|
|
113
|
+
$color-primary-01: #007DBC;
|
|
114
|
+
$color-primary-02: #0062CC;
|
|
115
|
+
$color-secondary-01: #78BE20;
|
|
116
|
+
|
|
117
|
+
// Semantic Colors
|
|
118
|
+
$color-success: #78BE20;
|
|
119
|
+
$color-error: #E4032E;
|
|
120
|
+
$color-warning: #FFB400;
|
|
121
|
+
$color-info: #007DBC;
|
|
122
|
+
|
|
123
|
+
// Grays
|
|
124
|
+
$color-gray-100: #F5F5F5;
|
|
125
|
+
$color-gray-200: #EBEBEB;
|
|
126
|
+
$color-gray-500: #999999;
|
|
127
|
+
$color-gray-900: #333333;
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Step 4: Usage Examples
|
|
131
|
+
|
|
132
|
+
I'll provide examples for your chosen format:
|
|
133
|
+
|
|
134
|
+
**CSS Custom Properties**:
|
|
135
|
+
```css
|
|
136
|
+
:root {
|
|
137
|
+
--color-primary: #007DBC;
|
|
138
|
+
--color-success: #78BE20;
|
|
139
|
+
--spacing-unit: 0.25rem; /* 4px */
|
|
140
|
+
--spacing-s: 0.5rem; /* 8px */
|
|
141
|
+
--spacing-m: 1rem; /* 16px */
|
|
142
|
+
--spacing-l: 1.5rem; /* 24px */
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.button-primary {
|
|
146
|
+
background-color: var(--color-primary);
|
|
147
|
+
padding: var(--spacing-m) var(--spacing-l);
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Common Use Cases
|
|
152
|
+
|
|
153
|
+
### Use Case 1: Getting Brand Colors
|
|
154
|
+
|
|
155
|
+
**User**: "What are the brand colors?"
|
|
156
|
+
|
|
157
|
+
**Workflow**:
|
|
158
|
+
1. Use `mcp__mozaic__get_design_tokens` with category: "colors"
|
|
159
|
+
2. Show brand color palette
|
|
160
|
+
3. Provide usage examples
|
|
161
|
+
4. Suggest semantic color alternatives
|
|
162
|
+
|
|
163
|
+
**Output**:
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"colors": {
|
|
167
|
+
"brand": {
|
|
168
|
+
"primary-01": "#007DBC",
|
|
169
|
+
"primary-02": "#0062CC",
|
|
170
|
+
"secondary-01": "#78BE20",
|
|
171
|
+
"secondary-02": "#5FA700"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Use Case 2: Typography Scale
|
|
178
|
+
|
|
179
|
+
**User**: "What font sizes should I use?"
|
|
180
|
+
|
|
181
|
+
**Workflow**:
|
|
182
|
+
1. Use `mcp__mozaic__get_design_tokens` with category: "typography"
|
|
183
|
+
2. Show type scale with line heights
|
|
184
|
+
3. Provide semantic naming (heading, body, caption)
|
|
185
|
+
4. Show usage examples
|
|
186
|
+
|
|
187
|
+
**Output**:
|
|
188
|
+
```scss
|
|
189
|
+
// Typography Scale
|
|
190
|
+
$font-size-xs: 0.75rem; // 12px
|
|
191
|
+
$font-size-s: 0.875rem; // 14px
|
|
192
|
+
$font-size-m: 1rem; // 16px (base)
|
|
193
|
+
$font-size-l: 1.125rem; // 18px
|
|
194
|
+
$font-size-xl: 1.5rem; // 24px
|
|
195
|
+
$font-size-2xl: 2rem; // 32px
|
|
196
|
+
|
|
197
|
+
// Line Heights
|
|
198
|
+
$line-height-tight: 1.2;
|
|
199
|
+
$line-height-normal: 1.5;
|
|
200
|
+
$line-height-relaxed: 1.75;
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Use Case 3: Spacing System
|
|
204
|
+
|
|
205
|
+
**User**: "How do I use consistent spacing?"
|
|
206
|
+
|
|
207
|
+
**Workflow**:
|
|
208
|
+
1. Use `mcp__mozaic__get_design_tokens` with category: "spacing"
|
|
209
|
+
2. Explain magic unit system (4px base)
|
|
210
|
+
3. Show spacing scale
|
|
211
|
+
4. Provide component examples
|
|
212
|
+
|
|
213
|
+
**Output**:
|
|
214
|
+
```css
|
|
215
|
+
/* Magic Unit: 4px */
|
|
216
|
+
--spacing-unit: 0.25rem; /* 4px */
|
|
217
|
+
--spacing-xs: 0.5rem; /* 8px */
|
|
218
|
+
--spacing-s: 0.75rem; /* 12px */
|
|
219
|
+
--spacing-m: 1rem; /* 16px */
|
|
220
|
+
--spacing-l: 1.5rem; /* 24px */
|
|
221
|
+
--spacing-xl: 2rem; /* 32px */
|
|
222
|
+
--spacing-2xl: 3rem; /* 48px */
|
|
223
|
+
--spacing-3xl: 4rem; /* 64px */
|
|
224
|
+
|
|
225
|
+
/* Usage */
|
|
226
|
+
.card {
|
|
227
|
+
padding: var(--spacing-l);
|
|
228
|
+
margin-bottom: var(--spacing-m);
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Use Case 4: Responsive Breakpoints
|
|
233
|
+
|
|
234
|
+
**User**: "What are the responsive breakpoints?"
|
|
235
|
+
|
|
236
|
+
**Workflow**:
|
|
237
|
+
1. Use `mcp__mozaic__get_design_tokens` with category: "screens"
|
|
238
|
+
2. Show breakpoint values
|
|
239
|
+
3. Provide media query examples
|
|
240
|
+
4. Suggest mobile-first approach
|
|
241
|
+
|
|
242
|
+
**Output**:
|
|
243
|
+
```scss
|
|
244
|
+
// Breakpoints
|
|
245
|
+
$screen-xs: 320px; // Mobile
|
|
246
|
+
$screen-s: 480px; // Large mobile
|
|
247
|
+
$screen-m: 768px; // Tablet
|
|
248
|
+
$screen-l: 1024px; // Desktop
|
|
249
|
+
$screen-xl: 1280px; // Large desktop
|
|
250
|
+
$screen-2xl: 1920px; // Wide desktop
|
|
251
|
+
|
|
252
|
+
// Media Queries (Mobile-first)
|
|
253
|
+
@media (min-width: $screen-m) {
|
|
254
|
+
// Tablet and up
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@media (min-width: $screen-l) {
|
|
258
|
+
// Desktop and up
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Use Case 5: Shadow System
|
|
263
|
+
|
|
264
|
+
**User**: "How do I add elevation to a card?"
|
|
265
|
+
|
|
266
|
+
**Workflow**:
|
|
267
|
+
1. Use `mcp__mozaic__get_design_tokens` with category: "shadows"
|
|
268
|
+
2. Show elevation levels
|
|
269
|
+
3. Explain when to use each level
|
|
270
|
+
4. Provide component examples
|
|
271
|
+
|
|
272
|
+
**Output**:
|
|
273
|
+
```css
|
|
274
|
+
/* Elevation Levels */
|
|
275
|
+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
276
|
+
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
277
|
+
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
|
|
278
|
+
--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
|
|
279
|
+
|
|
280
|
+
/* Usage */
|
|
281
|
+
.card {
|
|
282
|
+
box-shadow: var(--shadow-md);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.card:hover {
|
|
286
|
+
box-shadow: var(--shadow-lg);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.modal {
|
|
290
|
+
box-shadow: var(--shadow-xl);
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Use Case 6: Grid System
|
|
295
|
+
|
|
296
|
+
**User**: "How does the grid system work?"
|
|
297
|
+
|
|
298
|
+
**Workflow**:
|
|
299
|
+
1. Use `mcp__mozaic__get_design_tokens` with category: "grid"
|
|
300
|
+
2. Show grid configuration
|
|
301
|
+
3. Explain gutter system
|
|
302
|
+
4. Provide layout examples
|
|
303
|
+
|
|
304
|
+
**Output**:
|
|
305
|
+
```scss
|
|
306
|
+
// Grid System
|
|
307
|
+
$grid-columns: 12;
|
|
308
|
+
$grid-gutter-xs: 1rem; // 16px
|
|
309
|
+
$grid-gutter-s: 1.5rem; // 24px
|
|
310
|
+
$grid-gutter-m: 2rem; // 32px
|
|
311
|
+
|
|
312
|
+
// Container Widths
|
|
313
|
+
$container-sm: 540px;
|
|
314
|
+
$container-md: 720px;
|
|
315
|
+
$container-lg: 960px;
|
|
316
|
+
$container-xl: 1140px;
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## Token Usage Patterns
|
|
320
|
+
|
|
321
|
+
### Pattern 1: CSS Custom Properties (Recommended)
|
|
322
|
+
|
|
323
|
+
```css
|
|
324
|
+
/* Define tokens as CSS variables */
|
|
325
|
+
:root {
|
|
326
|
+
--color-primary: #007DBC;
|
|
327
|
+
--spacing-m: 1rem;
|
|
328
|
+
--font-size-m: 1rem;
|
|
329
|
+
--border-radius-m: 0.25rem;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/* Use in components */
|
|
333
|
+
.button {
|
|
334
|
+
background: var(--color-primary);
|
|
335
|
+
padding: var(--spacing-m);
|
|
336
|
+
font-size: var(--font-size-m);
|
|
337
|
+
border-radius: var(--border-radius-m);
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Pattern 2: SCSS Variables
|
|
342
|
+
|
|
343
|
+
```scss
|
|
344
|
+
// Import Mozaic tokens
|
|
345
|
+
@use '@mozaic-ds/tokens' as tokens;
|
|
346
|
+
|
|
347
|
+
.component {
|
|
348
|
+
color: tokens.$color-primary;
|
|
349
|
+
padding: tokens.$spacing-m;
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Pattern 3: JavaScript/TypeScript
|
|
354
|
+
|
|
355
|
+
```typescript
|
|
356
|
+
import { tokens } from '@mozaic-ds/tokens';
|
|
357
|
+
|
|
358
|
+
const styles = {
|
|
359
|
+
backgroundColor: tokens.colors.primary,
|
|
360
|
+
padding: tokens.spacing.m,
|
|
361
|
+
fontSize: tokens.typography.fontSize.m
|
|
362
|
+
};
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## Best Practices
|
|
366
|
+
|
|
367
|
+
### 1. Use Semantic Tokens
|
|
368
|
+
|
|
369
|
+
```css
|
|
370
|
+
/* Good: Semantic meaning */
|
|
371
|
+
.success-message {
|
|
372
|
+
color: var(--color-success);
|
|
373
|
+
background: var(--color-success-light);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* Avoid: Direct color values */
|
|
377
|
+
.success-message {
|
|
378
|
+
color: #78BE20;
|
|
379
|
+
background: #E8F5E9;
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### 2. Follow the Spacing Scale
|
|
384
|
+
|
|
385
|
+
```css
|
|
386
|
+
/* Good: Use spacing tokens */
|
|
387
|
+
.card {
|
|
388
|
+
padding: var(--spacing-l);
|
|
389
|
+
margin-bottom: var(--spacing-m);
|
|
390
|
+
gap: var(--spacing-s);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* Avoid: Arbitrary values */
|
|
394
|
+
.card {
|
|
395
|
+
padding: 23px;
|
|
396
|
+
margin-bottom: 15px;
|
|
397
|
+
gap: 9px;
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### 3. Mobile-First Responsive Design
|
|
402
|
+
|
|
403
|
+
```scss
|
|
404
|
+
/* Good: Mobile-first with tokens */
|
|
405
|
+
.container {
|
|
406
|
+
padding: $spacing-m;
|
|
407
|
+
|
|
408
|
+
@media (min-width: $screen-m) {
|
|
409
|
+
padding: $spacing-l;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
@media (min-width: $screen-l) {
|
|
413
|
+
padding: $spacing-xl;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### 4. Consistent Typography
|
|
419
|
+
|
|
420
|
+
```css
|
|
421
|
+
/* Good: Use typography scale */
|
|
422
|
+
h1 {
|
|
423
|
+
font-size: var(--font-size-2xl);
|
|
424
|
+
line-height: var(--line-height-tight);
|
|
425
|
+
font-weight: var(--font-weight-bold);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/* Avoid: Random values */
|
|
429
|
+
h1 {
|
|
430
|
+
font-size: 31px;
|
|
431
|
+
line-height: 1.23;
|
|
432
|
+
font-weight: 650;
|
|
433
|
+
}
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### 5. Layered Shadows
|
|
437
|
+
|
|
438
|
+
```css
|
|
439
|
+
/* Good: Use elevation tokens */
|
|
440
|
+
.card-low {
|
|
441
|
+
box-shadow: var(--shadow-sm);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.card-medium {
|
|
445
|
+
box-shadow: var(--shadow-md);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.modal {
|
|
449
|
+
box-shadow: var(--shadow-xl);
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
## Format Comparison
|
|
454
|
+
|
|
455
|
+
### JSON Format
|
|
456
|
+
**Best for**: Configuration files, design tools, documentation
|
|
457
|
+
|
|
458
|
+
```json
|
|
459
|
+
{
|
|
460
|
+
"colors": {
|
|
461
|
+
"primary": "#007DBC",
|
|
462
|
+
"success": "#78BE20"
|
|
463
|
+
},
|
|
464
|
+
"spacing": {
|
|
465
|
+
"m": "1rem",
|
|
466
|
+
"l": "1.5rem"
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
### SCSS Format
|
|
472
|
+
**Best for**: Sass/SCSS projects, preprocessor workflows
|
|
473
|
+
|
|
474
|
+
```scss
|
|
475
|
+
$color-primary: #007DBC;
|
|
476
|
+
$color-success: #78BE20;
|
|
477
|
+
$spacing-m: 1rem;
|
|
478
|
+
$spacing-l: 1.5rem;
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### CSS Format
|
|
482
|
+
**Best for**: Modern CSS, runtime theming, CSS-in-JS
|
|
483
|
+
|
|
484
|
+
```css
|
|
485
|
+
:root {
|
|
486
|
+
--color-primary: #007DBC;
|
|
487
|
+
--color-success: #78BE20;
|
|
488
|
+
--spacing-m: 1rem;
|
|
489
|
+
--spacing-l: 1.5rem;
|
|
490
|
+
}
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### JavaScript Format
|
|
494
|
+
**Best for**: JS/TS projects, React, styled-components
|
|
495
|
+
|
|
496
|
+
```javascript
|
|
497
|
+
export const tokens = {
|
|
498
|
+
colors: {
|
|
499
|
+
primary: '#007DBC',
|
|
500
|
+
success: '#78BE20'
|
|
501
|
+
},
|
|
502
|
+
spacing: {
|
|
503
|
+
m: '1rem',
|
|
504
|
+
l: '1.5rem'
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
## Documentation Search
|
|
510
|
+
|
|
511
|
+
Use `mcp__mozaic__search_documentation` to find:
|
|
512
|
+
- Color usage guidelines
|
|
513
|
+
- Typography best practices
|
|
514
|
+
- Spacing system rules
|
|
515
|
+
- Responsive design patterns
|
|
516
|
+
- Accessibility considerations
|
|
517
|
+
|
|
518
|
+
**Example**:
|
|
519
|
+
```
|
|
520
|
+
"How to use primary colors" → Returns documentation on brand color usage
|
|
521
|
+
"Responsive breakpoints" → Returns breakpoint strategy and media queries
|
|
522
|
+
"Spacing system" → Returns magic unit scale explanation
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
## Commands
|
|
526
|
+
|
|
527
|
+
When this skill is active:
|
|
528
|
+
|
|
529
|
+
- **"Show [category] tokens"**: Get tokens by category
|
|
530
|
+
- **"Colors in [format]"**: Get colors in specific format
|
|
531
|
+
- **"What spacing should I use for [element]?"**: Spacing guidance
|
|
532
|
+
- **"Responsive breakpoints"**: Get breakpoint values
|
|
533
|
+
- **"Typography scale"**: Get font size scale
|
|
534
|
+
- **"How do I use [token]?"**: Token usage examples
|
|
535
|
+
- **"Search docs for [topic]"**: Search documentation
|
|
536
|
+
|
|
537
|
+
## Integration with Other Skills
|
|
538
|
+
|
|
539
|
+
This skill works well with:
|
|
540
|
+
- **mozaic-vue-builder**: Apply tokens to Vue components
|
|
541
|
+
- **mozaic-react-builder**: Apply tokens to React components
|
|
542
|
+
- **mozaic-css-utilities**: Combine tokens with utility classes
|
|
543
|
+
|
|
544
|
+
## Example Session
|
|
545
|
+
|
|
546
|
+
**User**: "I need to style a card component"
|
|
547
|
+
|
|
548
|
+
**Skill**:
|
|
549
|
+
I'll help you with design tokens for your card!
|
|
550
|
+
|
|
551
|
+
What aspects do you need?
|
|
552
|
+
- A) Colors (background, borders)
|
|
553
|
+
- B) Spacing (padding, margins)
|
|
554
|
+
- C) Shadows (elevation)
|
|
555
|
+
- D) All of the above
|
|
556
|
+
|
|
557
|
+
**User**: "D - All of the above"
|
|
558
|
+
|
|
559
|
+
**Skill**:
|
|
560
|
+
Perfect! What format do you prefer?
|
|
561
|
+
- A) CSS custom properties
|
|
562
|
+
- B) SCSS variables
|
|
563
|
+
- C) JavaScript
|
|
564
|
+
- D) JSON
|
|
565
|
+
|
|
566
|
+
**User**: "A - CSS"
|
|
567
|
+
|
|
568
|
+
**Skill**:
|
|
569
|
+
[Uses `mcp__mozaic__get_design_tokens` for colors, spacing, shadows]
|
|
570
|
+
|
|
571
|
+
Here are the tokens for your card component:
|
|
572
|
+
|
|
573
|
+
```css
|
|
574
|
+
:root {
|
|
575
|
+
/* Colors */
|
|
576
|
+
--card-bg: #FFFFFF;
|
|
577
|
+
--card-border: #EBEBEB;
|
|
578
|
+
|
|
579
|
+
/* Spacing */
|
|
580
|
+
--card-padding: 1.5rem; /* 24px */
|
|
581
|
+
--card-gap: 1rem; /* 16px */
|
|
582
|
+
--card-margin-bottom: 1rem; /* 16px */
|
|
583
|
+
|
|
584
|
+
/* Shadows */
|
|
585
|
+
--card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
586
|
+
--card-shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
|
|
587
|
+
|
|
588
|
+
/* Borders */
|
|
589
|
+
--card-border-radius: 0.5rem; /* 8px */
|
|
590
|
+
--card-border-width: 1px;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.card {
|
|
594
|
+
background: var(--card-bg);
|
|
595
|
+
padding: var(--card-padding);
|
|
596
|
+
margin-bottom: var(--card-margin-bottom);
|
|
597
|
+
border: var(--card-border-width) solid var(--card-border);
|
|
598
|
+
border-radius: var(--card-border-radius);
|
|
599
|
+
box-shadow: var(--card-shadow);
|
|
600
|
+
transition: box-shadow 0.2s ease;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.card:hover {
|
|
604
|
+
box-shadow: var(--card-shadow-hover);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.card__content {
|
|
608
|
+
display: flex;
|
|
609
|
+
flex-direction: column;
|
|
610
|
+
gap: var(--card-gap);
|
|
611
|
+
}
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
Would you like me to:
|
|
615
|
+
- Show responsive variations?
|
|
616
|
+
- Add dark theme tokens?
|
|
617
|
+
- Show SCSS or JS version?
|
|
618
|
+
|
|
619
|
+
---
|
|
620
|
+
|
|
621
|
+
**Let's build consistent, beautiful interfaces with Mozaic Design Tokens!**
|