@symbo.ls/mcp 1.0.11 → 1.0.14
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/README.md +1 -0
- package/package.json +1 -1
- package/symbols_mcp/skills/AUDIT.md +148 -174
- package/symbols_mcp/skills/BRAND_IDENTITY.md +75 -0
- package/symbols_mcp/skills/COMPONENTS.md +151 -306
- package/symbols_mcp/skills/COOKBOOK.md +850 -0
- package/symbols_mcp/skills/DEFAULT_COMPONENTS.md +3856 -0
- package/symbols_mcp/skills/DEFAULT_LIBRARY.md +301 -0
- package/symbols_mcp/skills/DESIGN_CRITIQUE.md +70 -59
- package/symbols_mcp/skills/DESIGN_DIRECTION.md +109 -175
- package/symbols_mcp/skills/DESIGN_SYSTEM.md +473 -181
- package/symbols_mcp/skills/DESIGN_SYSTEM_ARCHITECT.md +65 -57
- package/symbols_mcp/skills/DESIGN_TO_CODE.md +83 -64
- package/symbols_mcp/skills/DESIGN_TREND.md +62 -50
- package/symbols_mcp/skills/FIGMA_MATCHING.md +69 -58
- package/symbols_mcp/skills/LEARNINGS.md +374 -0
- package/symbols_mcp/skills/MARKETING_ASSETS.md +71 -59
- package/symbols_mcp/skills/MIGRATION.md +158 -117
- package/symbols_mcp/skills/PATTERNS.md +101 -74
- package/symbols_mcp/skills/PRESENTATION.md +78 -0
- package/symbols_mcp/skills/PROJECT_STRUCTURE.md +114 -116
- package/symbols_mcp/skills/RULES.md +179 -148
- package/symbols_mcp/skills/RUNNING_APPS.md +476 -0
- package/symbols_mcp/skills/SEO-METADATA.md +33 -18
- package/symbols_mcp/skills/SNIPPETS.md +598 -0
- package/symbols_mcp/skills/SSR-BRENDER.md +99 -0
- package/symbols_mcp/skills/SYNTAX.md +356 -298
- package/symbols_mcp/skills/BRAND_INDENTITY.md +0 -69
- package/symbols_mcp/skills/THE_PRESENTATION.md +0 -69
|
@@ -1,39 +1,33 @@
|
|
|
1
|
-
# Symbols Design System
|
|
1
|
+
# Symbols Design System -- Token Reference
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
---
|
|
3
|
+
Design system config lives in `designSystem/`. All tokens resolve to CSS via DOMQL props.
|
|
6
4
|
|
|
7
5
|
## Design System Files
|
|
8
6
|
|
|
9
|
-
| File
|
|
10
|
-
|
|
11
|
-
| `
|
|
12
|
-
| `
|
|
13
|
-
| `
|
|
14
|
-
| `
|
|
15
|
-
| `
|
|
16
|
-
| `
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
|
|
25
|
-
---
|
|
7
|
+
| File | Purpose |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `color.js` | Named color palette |
|
|
10
|
+
| `gradient.js` | Gradient definitions |
|
|
11
|
+
| `theme.js` | Semantic surface themes |
|
|
12
|
+
| `font.js` | Custom font faces |
|
|
13
|
+
| `font_family.js` | Font family stacks |
|
|
14
|
+
| `typography.js` | Type scale (ratio + range) |
|
|
15
|
+
| `spacing.js` | Spacing scale (ratio + range) |
|
|
16
|
+
| `timing.js` | Easing curves and duration scale |
|
|
17
|
+
| `class.js` | Utility CSS class overrides |
|
|
18
|
+
| `animation.js` | Named keyframe animations |
|
|
19
|
+
| `media.js` | Custom media query breakpoints |
|
|
20
|
+
| `cases.js` | Conditional environment flags |
|
|
21
|
+
| `reset.js` | Global CSS reset overrides |
|
|
26
22
|
|
|
27
23
|
## How Tokens Are Used in Props
|
|
28
24
|
|
|
29
|
-
Props accept design tokens as strings. The system resolves them into CSS values via sequences, themes, and colors.
|
|
30
|
-
|
|
31
25
|
```js
|
|
32
26
|
Card: {
|
|
33
27
|
padding: 'B C', // spacing token
|
|
34
28
|
background: 'primary.08', // color + opacity
|
|
35
|
-
borderRadius: 'B', // spacing token
|
|
36
|
-
shadow: 'soft', // shadow token
|
|
29
|
+
borderRadius: 'B', // spacing token (also via `round`)
|
|
30
|
+
shadow: 'soft', // shadow token from designSystem
|
|
37
31
|
fontSize: 'B', // typography token
|
|
38
32
|
color: 'title' // adaptive color token
|
|
39
33
|
}
|
|
@@ -41,97 +35,143 @@ Card: {
|
|
|
41
35
|
|
|
42
36
|
---
|
|
43
37
|
|
|
44
|
-
##
|
|
38
|
+
## color
|
|
45
39
|
|
|
46
40
|
### Static colors
|
|
47
41
|
|
|
48
|
-
| Token
|
|
49
|
-
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `black`
|
|
56
|
-
| `white`
|
|
57
|
-
| `gray`
|
|
58
|
-
| `
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
|
65
|
-
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
42
|
+
| Token | Value | Use |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| `blue` | `#213eb0` | Primary interactive |
|
|
45
|
+
| `green` | `#389d34` | Success states |
|
|
46
|
+
| `red` | `#e15c55` | Warning/error states |
|
|
47
|
+
| `yellow` | `#EDCB38` | Attention states |
|
|
48
|
+
| `orange` | `#e97c16` | Accent states |
|
|
49
|
+
| `black` | `black` | Pure black |
|
|
50
|
+
| `white` | `white` | Pure white |
|
|
51
|
+
| `gray` | `#4e4e50` | Neutral mid-tone |
|
|
52
|
+
| `transparent` | `rgba(0, 0, 0, 0)` | Fully transparent |
|
|
53
|
+
|
|
54
|
+
### Adaptive semantic colors
|
|
55
|
+
|
|
56
|
+
Array syntax `[darkValue, lightValue]` with relative tone shifts from gray:
|
|
57
|
+
|
|
58
|
+
| Token | Dark | Light | Use |
|
|
59
|
+
|---|---|---|---|
|
|
60
|
+
| `title` | near-white (+168) | near-black (-168) | Primary text |
|
|
61
|
+
| `caption` | mid-gray (+68) | mid-gray (-68) | Secondary/meta |
|
|
62
|
+
| `paragraph` | lighter-gray (+42) | darker-gray (-42) | Body copy |
|
|
63
|
+
| `disabled` | dimmer-gray (+26) | dimmer-gray (-26) | Disabled state |
|
|
64
|
+
| `line` | subtle-gray (+16) | subtle-gray (-16) | Borders/dividers |
|
|
70
65
|
|
|
71
66
|
### Color modifier syntax (dot-notation)
|
|
72
67
|
|
|
73
|
-
|
|
68
|
+
Dot = opacity. `+`/`-` = relative tone shift. `=` = absolute lightness.
|
|
74
69
|
|
|
75
|
-
```
|
|
76
|
-
'gray.95-68' //
|
|
77
|
-
'gray+168' //
|
|
70
|
+
```
|
|
71
|
+
'gray.95-68' // 95% opacity, darkened 68 steps
|
|
72
|
+
'gray+168' // full opacity, lightened 168 steps
|
|
78
73
|
'white-78' // white darkened 78 steps
|
|
79
74
|
'primary.5' // primary at 50% opacity
|
|
80
75
|
'primary+5' // shifted tone
|
|
81
|
-
'gray=90' //
|
|
82
|
-
'gray.5+15' // 50% opacity + 15
|
|
76
|
+
'gray=90' // absolute 90% lightness
|
|
77
|
+
'gray.5+15' // 50% opacity + 15 lighter
|
|
83
78
|
```
|
|
84
79
|
|
|
85
80
|
Opacity rules:
|
|
86
|
-
- `.XX`
|
|
87
|
-
- Full opacity (1.0) = no modifier needed
|
|
81
|
+
- `.XX` = `0.XX` -- `.1` = 0.1, `.35` = 0.35, `.0` = 0.0
|
|
82
|
+
- Full opacity (1.0) = no modifier needed
|
|
88
83
|
- Raw CSS values (`rgba()`, `hsl()`, `#hex`) pass through unchanged
|
|
84
|
+
- CSS variables (`--myVar`) convert to `var(--myVar)`
|
|
89
85
|
|
|
90
|
-
### Usage
|
|
86
|
+
### Usage
|
|
91
87
|
|
|
92
88
|
```js
|
|
93
|
-
//
|
|
94
|
-
|
|
89
|
+
Text: { color: 'blue' } // static
|
|
90
|
+
Caption: { color: 'caption' } // adaptive semantic
|
|
91
|
+
Box: { background: 'gray.1' } // inline tint
|
|
92
|
+
Card: { background: 'gray.92+8' } // with tone modifier
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
95
96
|
|
|
96
|
-
|
|
97
|
-
Caption: { color: 'caption' }
|
|
97
|
+
## gradient
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
| Token | Description |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `gradient-blue-light` | Linear blue-to-dark-blue |
|
|
102
|
+
| `gradient-blue-dark` | Linear blue gradient (hex) |
|
|
103
|
+
| `gradient-dark` | Subtle dark overlay |
|
|
104
|
+
| `gradient-dark-active` | Stronger dark overlay (active state) |
|
|
105
|
+
| `gradient-light` | Subtle light overlay |
|
|
106
|
+
| `gradient-light-active` | Stronger light overlay (active state) |
|
|
107
|
+
| `gradient-colorful` | Multi-color gradient (blue-purple-pink) |
|
|
101
108
|
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
```js
|
|
110
|
+
Hero: { background: 'gradient-colorful' }
|
|
111
|
+
Button: { background: 'gradient-blue-dark' }
|
|
104
112
|
```
|
|
105
113
|
|
|
114
|
+
Gradients with color tokens inside are auto-resolved via `resolveColorsInGradient()`.
|
|
115
|
+
|
|
106
116
|
---
|
|
107
117
|
|
|
108
|
-
##
|
|
118
|
+
## theme
|
|
119
|
+
|
|
120
|
+
Apply with `theme: 'name'`. Themes define `background` + `color` pairs per dark/light mode.
|
|
121
|
+
|
|
122
|
+
### Surface themes
|
|
109
123
|
|
|
110
|
-
|
|
124
|
+
| Theme | Use |
|
|
125
|
+
|---|---|
|
|
126
|
+
| `document` | Page root surface (black/white) |
|
|
127
|
+
| `dialog` | Elevated card/panel with glass blur |
|
|
128
|
+
| `card` | Card surface with `.child` and `.secondary` variants |
|
|
129
|
+
| `field` | Input control surface with `::placeholder` |
|
|
130
|
+
| `label` | Label surface with `.light` and `.dark` variants |
|
|
131
|
+
| `transparent` | No background, inherits text color |
|
|
132
|
+
| `none` | Resets both color and background to `none` |
|
|
111
133
|
|
|
112
|
-
###
|
|
134
|
+
### Priority themes
|
|
113
135
|
|
|
114
|
-
| Theme
|
|
115
|
-
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
|
125
|
-
|
|
126
|
-
| `
|
|
136
|
+
| Theme | Use |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `primary` | CTA: blue/gradient background, white text; `.color-only`, `.inactive`, `.gradient` variants |
|
|
139
|
+
| `secondary` | Green background, white text; `.color-only` variant |
|
|
140
|
+
| `tertiary` | Subtle gray background |
|
|
141
|
+
| `quaternary` | Gradient overlay background |
|
|
142
|
+
| `quinary` | Interactive with `:hover`, `:focus`, `:active`, `.active` states |
|
|
143
|
+
|
|
144
|
+
### State themes
|
|
145
|
+
|
|
146
|
+
| Theme | Use |
|
|
147
|
+
|---|---|
|
|
148
|
+
| `alert` | Red background (destructive) |
|
|
149
|
+
| `warning` | Yellow background (caution) |
|
|
150
|
+
| `success` | Green background (positive) |
|
|
127
151
|
|
|
128
152
|
```js
|
|
129
|
-
Page: {
|
|
130
|
-
Card: {
|
|
153
|
+
Page: { flow: 'y', theme: 'document', minHeight: '100dvh' }
|
|
154
|
+
Card: { flow: 'y', theme: 'dialog', round: 'A', padding: 'A' }
|
|
131
155
|
Input: { theme: 'field' }
|
|
132
156
|
Button: { theme: 'primary', text: 'Save' }
|
|
133
|
-
Badge: { theme: '
|
|
134
|
-
|
|
157
|
+
Badge: { theme: 'alert', text: 'Error' }
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Variant modifiers (dot-notation)
|
|
161
|
+
|
|
162
|
+
```js
|
|
163
|
+
Button: { theme: 'primary', '.gradient': true } // gradient variant
|
|
164
|
+
Card: { theme: 'card', '.secondary': true } // secondary variant
|
|
165
|
+
Label: { theme: 'label', '.dark': true } // dark variant
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### themeModifier
|
|
169
|
+
|
|
170
|
+
Force a color scheme regardless of global theme:
|
|
171
|
+
|
|
172
|
+
```js
|
|
173
|
+
DarkSection: { themeModifier: 'dark', theme: 'document' }
|
|
174
|
+
LightCard: { themeModifier: 'light', theme: 'card' }
|
|
135
175
|
```
|
|
136
176
|
|
|
137
177
|
### Custom theme definition
|
|
@@ -143,25 +183,27 @@ theme: {
|
|
|
143
183
|
background: 'primary',
|
|
144
184
|
':hover': { background: 'primary.85' },
|
|
145
185
|
':active': { background: 'primary.75' },
|
|
146
|
-
'@dark': { background: 'primary.6' }
|
|
186
|
+
'@dark': { background: 'primary.6' },
|
|
187
|
+
'@light': { background: 'blue' },
|
|
188
|
+
'.active': { background: 'primary' }
|
|
147
189
|
}
|
|
148
190
|
}
|
|
149
191
|
```
|
|
150
192
|
|
|
151
193
|
---
|
|
152
194
|
|
|
153
|
-
##
|
|
195
|
+
## typography
|
|
154
196
|
|
|
155
|
-
Scale
|
|
197
|
+
Scale generated from ratio (Major Third = 1.25 default).
|
|
156
198
|
|
|
157
|
-
| Token range
|
|
158
|
-
|
|
159
|
-
| `W
|
|
160
|
-
| `Z
|
|
161
|
-
| `Y
|
|
162
|
-
| `A1
|
|
163
|
-
| `B1
|
|
164
|
-
| `C1
|
|
199
|
+
| Token range | Approx size | Use |
|
|
200
|
+
|---|---|---|
|
|
201
|
+
| `W`-`W2` | ~8-10 px | Micro text |
|
|
202
|
+
| `Z`-`Z2` | ~10-12 px | Caption, footnote |
|
|
203
|
+
| `Y`-`A` | ~12-16 px | Body text, small headings |
|
|
204
|
+
| `A1`-`B` | ~18-24 px | Headings, large body |
|
|
205
|
+
| `B1`-`C` | ~28-40 px | Display headings |
|
|
206
|
+
| `C1`-`C2` | ~48-64 px | Hero headlines |
|
|
165
207
|
|
|
166
208
|
```js
|
|
167
209
|
Heading: { fontSize: 'C' }
|
|
@@ -170,33 +212,56 @@ Body: { fontSize: 'A' }
|
|
|
170
212
|
```
|
|
171
213
|
|
|
172
214
|
Config:
|
|
215
|
+
|
|
173
216
|
```js
|
|
174
|
-
typography: {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
217
|
+
typography: { base: 16, ratio: 1.25, subSequence: true }
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Sequence ratios
|
|
221
|
+
|
|
222
|
+
| Name | Value |
|
|
223
|
+
|---|---|
|
|
224
|
+
| `minor-second` | 1.067 |
|
|
225
|
+
| `major-second` | 1.125 |
|
|
226
|
+
| `minor-third` | 1.2 |
|
|
227
|
+
| `major-third` | 1.25 |
|
|
228
|
+
| `perfect-fourth` | 1.333 |
|
|
229
|
+
| `augmented-fourth` | 1.414 |
|
|
230
|
+
| `perfect-fifth` | 1.5 |
|
|
231
|
+
| `minor-sixth` | 1.6 |
|
|
232
|
+
| `phi` | 1.618 |
|
|
233
|
+
| `major-sixth` | 1.667 |
|
|
234
|
+
| `minor-seventh` | 1.778 |
|
|
235
|
+
| `major-seventh` | 1.875 |
|
|
236
|
+
| `octave` | 2 |
|
|
237
|
+
|
|
238
|
+
### fontWeight
|
|
239
|
+
|
|
240
|
+
Auto-sets `fontVariationSettings` for variable fonts:
|
|
241
|
+
|
|
242
|
+
```js
|
|
243
|
+
Title: { fontWeight: 700 }
|
|
244
|
+
// outputs: fontWeight: 700, fontVariationSettings: '"wght" 700'
|
|
180
245
|
```
|
|
181
246
|
|
|
182
247
|
---
|
|
183
248
|
|
|
184
|
-
##
|
|
249
|
+
## spacing
|
|
185
250
|
|
|
186
|
-
Golden Ratio scale (1.618
|
|
251
|
+
Golden Ratio scale (1.618 default). Applies to `padding`, `margin`, `gap`, `width`, `height`, `boxSize`, `borderRadius`/`round`, `inset`, `top`, `left`, `right`, `bottom`, etc.
|
|
187
252
|
|
|
188
|
-
| Token
|
|
189
|
-
|
|
190
|
-
| `W
|
|
191
|
-
| `X
|
|
192
|
-
| `Z
|
|
193
|
-
| `A
|
|
194
|
-
| `B
|
|
195
|
-
| `C
|
|
196
|
-
| `D
|
|
197
|
-
| `E
|
|
253
|
+
| Token | Approx value | Use |
|
|
254
|
+
|---|---|---|
|
|
255
|
+
| `W`-`W2` | 2-4 px | Micro gaps, offsets |
|
|
256
|
+
| `X`-`X2` | 4-6 px | Icon padding, tight gaps |
|
|
257
|
+
| `Z`-`Z2` | 10-16 px | Compact padding |
|
|
258
|
+
| `A`-`A2` | 16-26 px | Default padding, gutters |
|
|
259
|
+
| `B`-`B2` | 26-42 px | Section padding |
|
|
260
|
+
| `C`-`C2` | 42-68 px | Container padding, avatar sizes |
|
|
261
|
+
| `D`-`D2` | 68-110 px | Large sections |
|
|
262
|
+
| `E`-`F` | 110-178 px | Hero padding, max-widths |
|
|
198
263
|
|
|
199
|
-
|
|
264
|
+
Sub-sequence rules: `W` and `X` only have `W`, `W1`, `W2` and `X`, `X1`, `X2`. Sub-tokens like `W4`, `X4` do NOT exist. Sub-steps `3` and `4` (e.g. `A3`, `A4`, `B3`, `B4`) only appear from `A` and above.
|
|
200
265
|
|
|
201
266
|
### Shorthand spacing
|
|
202
267
|
|
|
@@ -214,61 +279,205 @@ margin: '- - - auto' // use '-' to skip a side
|
|
|
214
279
|
Box: { padding: 'A+Z', margin: '-B', width: 'C+Z2' }
|
|
215
280
|
```
|
|
216
281
|
|
|
282
|
+
### Compound spacing
|
|
283
|
+
|
|
284
|
+
```js
|
|
285
|
+
padding: 'F+X2 - - -' // top = F + 2*X, skip others
|
|
286
|
+
margin: 'D2+Y2 - B2+W -' // complex with multipliers
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Config:
|
|
290
|
+
|
|
291
|
+
```js
|
|
292
|
+
spacing: { ratio: 1.618, subSequence: true }
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## CSS-in-Props Shorthand Properties
|
|
298
|
+
|
|
299
|
+
### Layout
|
|
300
|
+
|
|
301
|
+
| Prop | Effect |
|
|
302
|
+
|---|---|
|
|
303
|
+
| `flow` | `display: flex` + `flexFlow` (`'x'`=row, `'y'`=column) |
|
|
304
|
+
| `wrap` | `display: flex` + `flexWrap` |
|
|
305
|
+
| `align` | `display: flex` + `alignItems justifyContent` (space-separated) |
|
|
306
|
+
| `round` | Alias for `borderRadius` with spacing tokens |
|
|
307
|
+
| `boxSize` | `height width` (space-separated) |
|
|
308
|
+
| `size` | `inlineSize blockSize` (space-separated) |
|
|
309
|
+
| `widthRange` | `minWidth maxWidth` (space-separated) |
|
|
310
|
+
| `heightRange` | `minHeight maxHeight` (space-separated) |
|
|
311
|
+
| `minSize` | `minInlineSize minBlockSize` (space-separated) |
|
|
312
|
+
| `maxSize` | `maxInlineSize maxBlockSize` (space-separated) |
|
|
313
|
+
| `show` | If returns `false`, sets `display: none !important` |
|
|
314
|
+
| `hide` | If truthy, sets `display: none !important` |
|
|
315
|
+
| `shadow` | Resolves shadow token from designSystem, outputs `boxShadow` |
|
|
316
|
+
| `verticalInset` | `top bottom` (space-separated) |
|
|
317
|
+
| `horizontalInset` | `left right` (space-separated) |
|
|
318
|
+
| `paddingBlock` | `paddingBlockStart paddingBlockEnd` |
|
|
319
|
+
| `paddingInline` | `paddingInlineStart paddingInlineEnd` |
|
|
320
|
+
| `marginBlock` | `marginBlockStart marginBlockEnd` |
|
|
321
|
+
| `marginInline` | `marginInlineStart marginInlineEnd` |
|
|
322
|
+
|
|
323
|
+
### Grid
|
|
324
|
+
|
|
325
|
+
| Prop | CSS Output |
|
|
326
|
+
|---|---|
|
|
327
|
+
| `area` | `gridArea` |
|
|
328
|
+
| `template` | `gridTemplate` |
|
|
329
|
+
| `templateAreas` | `gridTemplateAreas` |
|
|
330
|
+
| `column` | `gridColumn` |
|
|
331
|
+
| `columns` | `gridTemplateColumns` |
|
|
332
|
+
| `templateColumns` | `gridTemplateColumns` |
|
|
333
|
+
| `autoColumns` | `gridAutoColumns` |
|
|
334
|
+
| `columnStart` | `gridColumnStart` |
|
|
335
|
+
| `row` | `gridRow` |
|
|
336
|
+
| `rows` | `gridTemplateRows` |
|
|
337
|
+
| `templateRows` | `gridTemplateRows` |
|
|
338
|
+
| `autoRows` | `gridAutoRows` |
|
|
339
|
+
| `rowStart` | `gridRowStart` |
|
|
340
|
+
| `autoFlow` | `gridAutoFlow` |
|
|
341
|
+
|
|
342
|
+
### Color/Border/Shadow
|
|
343
|
+
|
|
344
|
+
| Prop | Behavior |
|
|
345
|
+
|---|---|
|
|
346
|
+
| `color` | Resolves color token (theme-aware) |
|
|
347
|
+
| `background` | Resolves color or gradient token (theme-aware) |
|
|
348
|
+
| `backgroundColor` | Resolves color token (theme-aware) |
|
|
349
|
+
| `backgroundImage` | Resolves gradient with color tokens; supports file lookup |
|
|
350
|
+
| `borderColor` | Resolves color token (theme-aware) |
|
|
351
|
+
| `borderTopColor` | Resolves color token (theme-aware) |
|
|
352
|
+
| `borderBottomColor` | Resolves color token (theme-aware) |
|
|
353
|
+
| `borderLeftColor` | Resolves color token (theme-aware) |
|
|
354
|
+
| `borderRightColor` | Resolves color token (theme-aware) |
|
|
355
|
+
| `border` | Parses `width style color` with token resolution |
|
|
356
|
+
| `borderTop/Bottom/Left/Right` | Same parsing as `border` |
|
|
357
|
+
| `outline` | Same parsing as `border` |
|
|
358
|
+
| `textStroke` | Sets `WebkitTextStroke` with color resolution |
|
|
359
|
+
| `shadow` | Resolves named shadow from designSystem |
|
|
360
|
+
| `boxShadow` | Parses shadow with color token resolution |
|
|
361
|
+
| `textShadow` | Parses shadow with color token resolution |
|
|
362
|
+
| `columnRule` | Same parsing as `border` |
|
|
363
|
+
|
|
364
|
+
### Misc
|
|
365
|
+
|
|
366
|
+
| Prop | Behavior |
|
|
367
|
+
|---|---|
|
|
368
|
+
| `overflow` | Also sets `scrollBehavior: 'smooth'` |
|
|
369
|
+
| `cursor` | Supports file lookup for custom cursor images |
|
|
370
|
+
| `transitionProperty` | Also sets `willChange` to same value |
|
|
371
|
+
|
|
217
372
|
---
|
|
218
373
|
|
|
219
|
-
## TIMING
|
|
374
|
+
## TIMING
|
|
220
375
|
|
|
221
|
-
| Token
|
|
222
|
-
|
|
223
|
-
| `defaultBezier` | `cubic-bezier(.29, .67, .51, .97)` | Smooth ease-out
|
|
376
|
+
| Token | Value | Use |
|
|
377
|
+
|---|---|---|
|
|
378
|
+
| `defaultBezier` | `cubic-bezier(.29, .67, .51, .97)` | Smooth ease-out |
|
|
379
|
+
|
|
380
|
+
Scale: `base: 150, ratio: 1.333` (perfect-fourth). Duration tokens use the same letter sequence (A, B, C...) in milliseconds.
|
|
224
381
|
|
|
225
382
|
```js
|
|
226
383
|
Box: { transition: 'B defaultBezier', transitionProperty: 'opacity, transform' }
|
|
227
384
|
```
|
|
228
385
|
|
|
229
|
-
Timing scale (in ms): `base: 150, ratio: 1.333`
|
|
230
|
-
|
|
231
386
|
---
|
|
232
387
|
|
|
233
388
|
## ANIMATION
|
|
234
389
|
|
|
235
|
-
|
|
390
|
+
Built-in:
|
|
391
|
+
|
|
392
|
+
| Name | Effect |
|
|
393
|
+
|---|---|
|
|
394
|
+
| `fadeIn` | Opacity 0 -> 1 |
|
|
236
395
|
|
|
237
|
-
|
|
238
|
-
| ------------- | ------------------------------- | ---------------- |
|
|
239
|
-
| `fadeInUp` | Fade in + slide up from 12.5% | Entrance |
|
|
240
|
-
| `fadeOutDown` | Fade out + slide down to 12.5% | Exit |
|
|
241
|
-
| `marquee` | Scroll left by 50% | Ticker |
|
|
396
|
+
### CSS shorthand syntax
|
|
242
397
|
|
|
243
398
|
```js
|
|
244
|
-
Modal: { animation: '
|
|
399
|
+
Modal: { animation: 'fadeIn 2s ease-in-out' }
|
|
245
400
|
Ticker: { animation: 'marquee 8s linear infinite' }
|
|
401
|
+
Spinner: { animation: 'spin 1s linear infinite alternate' }
|
|
246
402
|
```
|
|
247
403
|
|
|
248
|
-
|
|
404
|
+
Parser token identification:
|
|
405
|
+
- **Name**: looked up in `ANIMATION` registry
|
|
406
|
+
- **Duration**: `Xs`, `Xms` (first = duration, second = delay)
|
|
407
|
+
- **Timing**: `ease`, `linear`, `ease-in-out`, `cubic-bezier(...)`, `steps(...)`
|
|
408
|
+
- **Iteration**: `infinite` or number
|
|
409
|
+
- **Direction**: `normal`, `reverse`, `alternate`, `alternate-reverse`
|
|
410
|
+
- **Fill mode**: `none`, `forwards`, `backwards`, `both` (default: `both`)
|
|
411
|
+
- **Play state**: `running`, `paused`
|
|
249
412
|
|
|
250
|
-
|
|
413
|
+
### Individual animation properties
|
|
251
414
|
|
|
252
|
-
|
|
415
|
+
```js
|
|
416
|
+
Box: {
|
|
417
|
+
animationName: 'fadeIn',
|
|
418
|
+
animationDuration: 'B',
|
|
419
|
+
animationDelay: 'A',
|
|
420
|
+
animationTimingFunction: 'ease-in-out',
|
|
421
|
+
animationIterationCount: 'infinite',
|
|
422
|
+
animationFillMode: 'both',
|
|
423
|
+
animationDirection: 'alternate',
|
|
424
|
+
animationPlayState: 'running'
|
|
425
|
+
}
|
|
426
|
+
```
|
|
253
427
|
|
|
254
|
-
|
|
255
|
-
| ---------- | ------------------------ | ------------ |
|
|
256
|
-
| `tv` | `min-width: 2780px` | up |
|
|
257
|
-
| `screenL` | `max-width: 1920px` | down |
|
|
258
|
-
| `tabletL` | `max-width: 1366px` | down |
|
|
259
|
-
| `tabletS` | `max-width: 1024px` | down |
|
|
260
|
-
| `mobileL` | `max-width: 768px` | down |
|
|
261
|
-
| `mobileM` | `max-width: 560px` | down |
|
|
262
|
-
| `mobileS` | `max-width: 480px` | down |
|
|
263
|
-
| `light` | `prefers-color-scheme: light` | — |
|
|
264
|
-
| `dark` | `prefers-color-scheme: dark` | — |
|
|
428
|
+
### Inline keyframes
|
|
265
429
|
|
|
266
|
-
|
|
430
|
+
```js
|
|
431
|
+
Box: {
|
|
432
|
+
animation: {
|
|
433
|
+
from: { opacity: 0, transform: 'translateY(20px)' },
|
|
434
|
+
to: { opacity: 1, transform: 'translateY(0)' }
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### Custom animation in designSystem
|
|
440
|
+
|
|
441
|
+
```js
|
|
442
|
+
animation: {
|
|
443
|
+
fadeInUp: {
|
|
444
|
+
from: { opacity: 0, transform: 'translateY(12.5%)' },
|
|
445
|
+
to: { opacity: 1, transform: 'translateY(0)' }
|
|
446
|
+
},
|
|
447
|
+
marquee: {
|
|
448
|
+
from: { transform: 'translateX(0)' },
|
|
449
|
+
to: { transform: 'translateX(-50%)' }
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## media
|
|
457
|
+
|
|
458
|
+
| Token | Query | Direction |
|
|
459
|
+
|---|---|---|
|
|
460
|
+
| `tv` | `min-width: 2780px` | up |
|
|
461
|
+
| `screenL` | `max-width: 1920px` | down |
|
|
462
|
+
| `screenM` | `max-width: 1680px` | down |
|
|
463
|
+
| `screenS` | `max-width: 1440px` | down |
|
|
464
|
+
| `tabletL` | `max-width: 1366px` | down |
|
|
465
|
+
| `tabletM` | `max-width: 1280px` | down |
|
|
466
|
+
| `tabletS` | `max-width: 1024px` | down |
|
|
467
|
+
| `mobileL` | `max-width: 768px` | down |
|
|
468
|
+
| `mobileM` | `max-width: 560px` | down |
|
|
469
|
+
| `mobileS` | `max-width: 480px` | down |
|
|
470
|
+
| `mobileXS` | `max-width: 375px` | down |
|
|
471
|
+
| `light` | `prefers-color-scheme: light` | -- |
|
|
472
|
+
| `dark` | `prefers-color-scheme: dark` | -- |
|
|
473
|
+
| `print` | `print` | -- |
|
|
474
|
+
|
|
475
|
+
`<` suffix = min-width (upward): `tabletL<` = `min-width: 1366px`. All breakpoints have both `max-width` and `min-width` (`<`) variants.
|
|
267
476
|
|
|
268
477
|
```js
|
|
269
478
|
Grid: {
|
|
270
479
|
columns: 'repeat(4, 1fr)',
|
|
271
|
-
'@
|
|
480
|
+
'@tabletS': { columns: 'repeat(2, 1fr)' },
|
|
272
481
|
'@mobileL': { columns: '1fr' }
|
|
273
482
|
}
|
|
274
483
|
Box: {
|
|
@@ -279,11 +488,11 @@ Box: {
|
|
|
279
488
|
|
|
280
489
|
---
|
|
281
490
|
|
|
282
|
-
## CASES
|
|
491
|
+
## CASES
|
|
283
492
|
|
|
284
|
-
| Case
|
|
285
|
-
|
|
286
|
-
| `isSafari` | `true` when browser is Safari
|
|
493
|
+
| Case | Condition |
|
|
494
|
+
|---|---|
|
|
495
|
+
| `isSafari` | `true` when browser is Safari |
|
|
287
496
|
|
|
288
497
|
```js
|
|
289
498
|
Element: { $isSafari: { top: 'Z2', right: 'Z2' } }
|
|
@@ -293,25 +502,31 @@ Element: { $isSafari: { top: 'Z2', right: 'Z2' } }
|
|
|
293
502
|
|
|
294
503
|
## Design System Configuration
|
|
295
504
|
|
|
296
|
-
|
|
505
|
+
Full config example:
|
|
297
506
|
|
|
298
507
|
```js
|
|
299
508
|
const designSystemConfig = {
|
|
300
509
|
color: {
|
|
301
510
|
primary: '#1f6feb',
|
|
302
511
|
text: ['#0b0b0b', '#f5f5f5'], // [dark, light] adaptive
|
|
303
|
-
accent: {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
512
|
+
accent: { '@light': '#ff7a18', '@dark': '#ffb347' }
|
|
513
|
+
},
|
|
514
|
+
gradient: {
|
|
515
|
+
'my-gradient': 'linear-gradient(to right, #ff7a18, #ffb347)'
|
|
307
516
|
},
|
|
308
517
|
theme: {
|
|
309
518
|
document: { color: 'text', background: 'primary.02' },
|
|
310
|
-
button: {
|
|
519
|
+
button: {
|
|
520
|
+
color: 'text',
|
|
521
|
+
background: 'primary',
|
|
522
|
+
':hover': { background: 'primary.85' },
|
|
523
|
+
'@dark': { background: 'primary.6' },
|
|
524
|
+
'.active': { background: 'primary' }
|
|
525
|
+
}
|
|
311
526
|
},
|
|
312
527
|
typography: { base: 16, ratio: 1.25, subSequence: true },
|
|
313
|
-
spacing: {
|
|
314
|
-
timing: { base: 150, ratio: 1.333, unit: 'ms' },
|
|
528
|
+
spacing: { ratio: 1.618, subSequence: true },
|
|
529
|
+
timing: { base: 150, ratio: 1.333, unit: 'ms', subSequence: true },
|
|
315
530
|
font: {
|
|
316
531
|
Inter: {
|
|
317
532
|
url: '/fonts/Inter-Variable.woff2',
|
|
@@ -320,7 +535,8 @@ const designSystemConfig = {
|
|
|
320
535
|
}
|
|
321
536
|
},
|
|
322
537
|
font_family: {
|
|
323
|
-
primary: { value: ['Inter'], type: 'sans', isDefault: true }
|
|
538
|
+
primary: { value: ['Inter'], type: 'sans', isDefault: true },
|
|
539
|
+
system: { value: ['"Helvetica Neue"', 'Helvetica', 'Arial'], type: 'sans-serif' }
|
|
324
540
|
},
|
|
325
541
|
icons: { search: '<svg>...</svg>' },
|
|
326
542
|
svg: { logo: '<svg>...</svg>' },
|
|
@@ -328,19 +544,20 @@ const designSystemConfig = {
|
|
|
328
544
|
soft: 'black.15 0px 10px 30px 0px',
|
|
329
545
|
hard: ['black.25 0px 8px 16px 0px', 'black.35 0px 10px 24px 0px'] // [light, dark]
|
|
330
546
|
},
|
|
547
|
+
animation: {
|
|
548
|
+
fadeIn: { from: { opacity: 0 }, to: { opacity: 1 } }
|
|
549
|
+
},
|
|
331
550
|
media: {
|
|
332
551
|
mobile: '(max-width: 768px)',
|
|
333
552
|
desktop: '(min-width: 1024px)'
|
|
334
553
|
},
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
useDefaultConfig: true, // merge smbls default design system
|
|
343
|
-
globalTheme: 'dark', // force dark/light mode globally
|
|
554
|
+
useVariable: true,
|
|
555
|
+
useReset: true,
|
|
556
|
+
useFontImport: true,
|
|
557
|
+
useIconSprite: true,
|
|
558
|
+
useDocumentTheme: true,
|
|
559
|
+
useDefaultConfig: true,
|
|
560
|
+
globalTheme: 'dark', // 'dark', 'light', or 'auto'
|
|
344
561
|
}
|
|
345
562
|
```
|
|
346
563
|
|
|
@@ -352,13 +569,14 @@ font, font_family, icons, semantic_icons, svg, svg_data,
|
|
|
352
569
|
shadow, media, grid, class, reset, unit, animation, cases
|
|
353
570
|
```
|
|
354
571
|
|
|
355
|
-
|
|
572
|
+
Do NOT wrap these under `props` or other wrappers.
|
|
356
573
|
|
|
357
574
|
---
|
|
358
575
|
|
|
359
576
|
## Fonts
|
|
360
577
|
|
|
361
578
|
### Variable font (Google Fonts)
|
|
579
|
+
|
|
362
580
|
```js
|
|
363
581
|
font: {
|
|
364
582
|
Inter: {
|
|
@@ -370,6 +588,7 @@ font: {
|
|
|
370
588
|
```
|
|
371
589
|
|
|
372
590
|
### Variable font (self-hosted)
|
|
591
|
+
|
|
373
592
|
```js
|
|
374
593
|
font: {
|
|
375
594
|
Inter: { url: '/fonts/Inter-Variable.woff2', isVariable: true, fontWeight: '100 900' }
|
|
@@ -377,6 +596,7 @@ font: {
|
|
|
377
596
|
```
|
|
378
597
|
|
|
379
598
|
### Traditional per-weight files
|
|
599
|
+
|
|
380
600
|
```js
|
|
381
601
|
font: {
|
|
382
602
|
inter: {
|
|
@@ -402,29 +622,101 @@ svg: {
|
|
|
402
622
|
}
|
|
403
623
|
```
|
|
404
624
|
|
|
405
|
-
Default icon set
|
|
625
|
+
Default icon set: `symbols`, `logo`, arrow variants, `check`, `checkCircle`, chevron variants, `copy`, `eye`, `eyeOff`, `info`, `lock`, `minus`, `plus`, `search`, `send`, `smile`, `star`, `sun`, `moon`, `upload`, `video`, `x`, `moreHorizontal`, `moreVertical`
|
|
626
|
+
|
|
627
|
+
---
|
|
628
|
+
|
|
629
|
+
## Transition Properties
|
|
630
|
+
|
|
631
|
+
```js
|
|
632
|
+
Box: {
|
|
633
|
+
transition: 'B defaultBezier',
|
|
634
|
+
transitionProperty: 'opacity, transform', // also sets willChange
|
|
635
|
+
transitionDuration: 'A',
|
|
636
|
+
transitionDelay: 'Z',
|
|
637
|
+
transitionTimingFunction: 'ease-in-out'
|
|
638
|
+
}
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
`transition` supports comma-separated multi-transition values via smart splitting.
|
|
406
642
|
|
|
407
643
|
---
|
|
408
644
|
|
|
409
645
|
## Design System Flags
|
|
410
646
|
|
|
411
|
-
| Flag
|
|
412
|
-
|
|
413
|
-
| `useReset`
|
|
414
|
-
| `useVariable`
|
|
415
|
-
| `useFontImport`
|
|
416
|
-
| `useIconSprite`
|
|
417
|
-
| `useSvgSprite`
|
|
418
|
-
| `useDefaultConfig` | `true`
|
|
419
|
-
| `useDocumentTheme` | `true`
|
|
420
|
-
| `
|
|
647
|
+
| Flag | Default | Effect |
|
|
648
|
+
|---|---|---|
|
|
649
|
+
| `useReset` | `true` | Apply CSS reset |
|
|
650
|
+
| `useVariable` | `true` | Emit CSS custom properties for all tokens |
|
|
651
|
+
| `useFontImport` | `true` | Load font entries via @font-face |
|
|
652
|
+
| `useIconSprite` | `true` | Inline the icons SVG sprite into the DOM |
|
|
653
|
+
| `useSvgSprite` | `true` | Inline SVG sprite definitions |
|
|
654
|
+
| `useDefaultConfig` | `true` | Merge smbls default design system config |
|
|
655
|
+
| `useDocumentTheme` | `true` | Apply document theme to `<html>` |
|
|
656
|
+
| `useDefaultIcons` | `true` | Include default icon set |
|
|
657
|
+
| `verbose` | `false` | Suppress design system debug output |
|
|
658
|
+
|
|
659
|
+
---
|
|
660
|
+
|
|
661
|
+
## Pseudo-selectors & States in Props
|
|
662
|
+
|
|
663
|
+
```js
|
|
664
|
+
Button: {
|
|
665
|
+
theme: 'primary',
|
|
666
|
+
':hover': { opacity: '0.85' },
|
|
667
|
+
':active': { opacity: '0.75' },
|
|
668
|
+
':focus': { outline: '2px solid blue' },
|
|
669
|
+
'::placeholder': { color: 'gray+68' },
|
|
670
|
+
'.isActive': { theme: 'primary', background: 'blue' },
|
|
671
|
+
'.disabled': { opacity: '0.5', pointerEvents: 'none' },
|
|
672
|
+
'@dark': { background: 'darkBlue' },
|
|
673
|
+
'@mobileL': { fontSize: 'Z' }
|
|
674
|
+
}
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
### CSS combinator selectors in props
|
|
678
|
+
|
|
679
|
+
```js
|
|
680
|
+
Container: {
|
|
681
|
+
'> *:not(:first-child)': { marginTop: 'A' },
|
|
682
|
+
'+ div': { paddingTop: 'B' }
|
|
683
|
+
}
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
---
|
|
687
|
+
|
|
688
|
+
## Runtime APIs
|
|
689
|
+
|
|
690
|
+
### init / reinit
|
|
691
|
+
|
|
692
|
+
```js
|
|
693
|
+
import { init, reinit } from 'smbls'
|
|
694
|
+
|
|
695
|
+
init(designSystemConfig) // Setup design system (called once)
|
|
696
|
+
reinit(updatedConfig) // Update design system at runtime
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
### applyCSS / updateVars
|
|
700
|
+
|
|
701
|
+
```js
|
|
702
|
+
import { applyCSS, updateVars } from 'smbls'
|
|
703
|
+
|
|
704
|
+
applyCSS('.my-class { color: red }') // Inject raw CSS
|
|
705
|
+
updateVars({ color: { primary: '#ff0000' } }) // Update CSS variables only
|
|
706
|
+
```
|
|
421
707
|
|
|
422
708
|
---
|
|
423
709
|
|
|
424
710
|
## Common Mistakes
|
|
425
711
|
|
|
426
|
-
- Do
|
|
427
|
-
- Use `font_family`
|
|
712
|
+
- Do NOT nest config under `props` or other wrappers
|
|
713
|
+
- Use `font_family` not `fontFamily` in config
|
|
428
714
|
- Define `typography` and `spacing` if you use tokens like `A`, `B2`, or `C+Z`
|
|
429
715
|
- Use named color tokens, not raw hex, for all interactive/semantic colors
|
|
430
|
-
-
|
|
716
|
+
- Dot-notation for opacity: `color: 'white.7'` (not `'white .7'`)
|
|
717
|
+
- `flow: 'x'` or `flow: 'y'` (not `flow: 'row'` or `flow: 'column'` -- though both work)
|
|
718
|
+
- `align: 'center center'` (space-separated: alignItems justifyContent)
|
|
719
|
+
- `round` is the shorthand for `borderRadius` with spacing token support
|
|
720
|
+
- `shadow` resolves from designSystem; `boxShadow` takes raw shadow syntax with color tokens
|
|
721
|
+
- `backdropFilter` must use `style: { backdropFilter: 'blur(10px)' }` to avoid text leak
|
|
722
|
+
- Colors in `border` syntax: `border: '1px solid gray.5'` -- the color token is resolved
|