@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.
@@ -1,39 +1,33 @@
1
- # Symbols Design System Tokens, Themes & Configuration
1
+ # Symbols Design System -- Token Reference
2
2
 
3
- The design system lives in `designSystem/` and controls all visual tokens consumed by DOMQL props.
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 | Purpose |
10
- | ---------------- | ------------------------------------------------------------ |
11
- | `COLOR.js` | Named color palette |
12
- | `GRADIENT.js` | Gradient definitions |
13
- | `THEME.js` | Semantic surface themes (document, dialog, field, primary…) |
14
- | `FONT.js` | Custom font faces |
15
- | `FONT_FAMILY.js` | Font family stacks |
16
- | `TYPOGRAPHY.js` | Type scale (ratio + range) |
17
- | `SPACING.js` | Spacing scale (ratio + range) |
18
- | `TIMING.js` | Named easing curves |
19
- | `CLASS.js` | Utility CSS class overrides |
20
- | `ANIMATION.js` | Named keyframe animations |
21
- | `MEDIA.js` | Custom media query breakpoints |
22
- | `CASES.js` | Conditional environment flags |
23
- | `RESET.js` | Global CSS reset overrides |
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
- ## COLOR
38
+ ## color
45
39
 
46
40
  ### Static colors
47
41
 
48
- | Token | Value | Use |
49
- | ------------ | --------------- | ------------------------ |
50
- | `green` | `#389d34` | Success states |
51
- | `red` | `#e15c55` | Warning/error states |
52
- | `yellow` | `#EDCB38` | Attention states |
53
- | `orange` | `#e97c16` | Accent states |
54
- | `blue` | `#0474f2` | Primary interactive |
55
- | `black` | `black` | Pure black |
56
- | `white` | `#ffffff` | Pure white |
57
- | `gray` | `#4e4e50` | Neutral mid-tone |
58
- | `codGray` | `#171717` | Near-black page bg |
59
- | `transparent`| `rgba(0,0,0,0)` | Fully transparent |
60
-
61
- ### Adaptive semantic colors (dark/light aware)
62
-
63
- | Token | Dark value | Light value | Use |
64
- | ----------- | ------------------ | ------------------ | ------------------ |
65
- | `title` | near-white | near-black | Primary text |
66
- | `caption` | mid-gray | mid-gray | Secondary/meta |
67
- | `paragraph` | lighter-gray | darker-gray | Body copy |
68
- | `disabled` | dimmer-gray | dimmer-gray | Disabled state |
69
- | `line` | subtle-gray | subtle-gray | Borders/dividers |
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
- Color tokens use dot-notation for opacity and `+`/`-` for relative tone shifts, `=` for absolute lightness:
68
+ Dot = opacity. `+`/`-` = relative tone shift. `=` = absolute lightness.
74
69
 
75
- ```js
76
- 'gray.95-68' // gray at 95% opacity, darkened 68 steps
77
- 'gray+168' // gray at full opacity, lightened 168 steps
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' // gray at absolute 90% lightness
82
- 'gray.5+15' // 50% opacity + 15 shade lighter
76
+ 'gray=90' // absolute 90% lightness
77
+ 'gray.5+15' // 50% opacity + 15 lighter
83
78
  ```
84
79
 
85
80
  Opacity rules:
86
- - `.XX` always means `0.XX` e.g., `.1` = 0.1, `.35` = 0.35, `.0` = 0.0
87
- - Full opacity (1.0) = no modifier needed (just the color name)
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 in components
86
+ ### Usage
91
87
 
92
88
  ```js
93
- // Static
94
- Text: { color: 'blue' }
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
- // Adaptive semantic
97
- Caption: { color: 'caption' }
97
+ ## gradient
98
98
 
99
- // Inline tint
100
- Box: { background: 'gray.1' }
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
- // With tone modifier
103
- Card: { background: 'gray.92+8' }
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
- ## THEME
118
+ ## theme
119
+
120
+ Apply with `theme: 'name'`. Themes define `background` + `color` pairs per dark/light mode.
121
+
122
+ ### Surface themes
109
123
 
110
- Apply with `theme: 'name'` on any element. Themes define `background` + `color` pairs per dark/light mode.
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
- ### Available themes
134
+ ### Priority themes
113
135
 
114
- | Theme | Use |
115
- | ----------------- | ------------------------------------------------- |
116
- | `document` | Page root surface |
117
- | `dialog` | Elevated card/panel with glass blur |
118
- | `dialog-elevated` | Higher elevation (selected tabs) |
119
- | `field` | Input control surface |
120
- | `field-dialog` | Slightly elevated input inside dialog |
121
- | `primary` | CTA: blue background, white text |
122
- | `warning` | Destructive/alert: red background, white text |
123
- | `success` | Positive: green background, white text |
124
- | `transparent` | No background, inherits text color |
125
- | `bordered` | Transparent + 1px border |
126
- | `none` | Resets both color and background to `none` |
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: { extends: 'Flex', theme: 'document', minHeight: '100dvh' }
130
- Card: { extends: 'Flex', theme: 'dialog', round: 'A', padding: 'A' }
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: 'warning', text: 'Error' }
134
- Tab: { '.isActive': { theme: 'dialog-elevated' } }
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
- ## TYPOGRAPHY — Type Scale
195
+ ## typography
154
196
 
155
- Scale is generated using a ratio (Major Third = 1.25 by default). Tokens map to the sequence:
197
+ Scale generated from ratio (Major Third = 1.25 default).
156
198
 
157
- | Token range | Approx size | Common use |
158
- | ------------- | ----------- | --------------------------- |
159
- | `W`–`W2` | ~810 px | Micro text |
160
- | `Z`–`Z2` | ~1012 px | Caption, footnote |
161
- | `Y`–`A` | ~1216 px | Body text, small headings |
162
- | `A1`–`B` | ~1824 px | Headings, large body |
163
- | `B1`–`C` | ~2840 px | Display headings |
164
- | `C1`–`C2` | ~4864 px | Hero headlines |
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
- base: 16, // root font size
176
- ratio: 1.25, // Major Third scale
177
- range: [-5, 12],
178
- subSequence: true // enables B2, C1 etc.
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
- ## SPACING — Layout Scale
249
+ ## spacing
185
250
 
186
- Golden Ratio scale (1.618 by default). Used for `padding`, `margin`, `gap`, `width`, `height`, `boxSize`, `borderRadius`, etc.
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 | Approx value | Common use |
189
- | -------- | ------------ | ------------------------------- |
190
- | `W`–`W2` | 24 px | Micro gaps, offsets |
191
- | `X`–`X2` | 46 px | Icon padding, tight gaps |
192
- | `Z`–`Z2` | 1016 px | Compact padding |
193
- | `A`–`A2` | 1626 px | Default padding, gutters |
194
- | `B`–`B2` | 2642 px | Section padding |
195
- | `C`–`C2` | 4268 px | Container padding, avatar sizes |
196
- | `D`–`D2` | 68110 px | Large sections |
197
- | `E`–`F` | 110178 px | Hero padding, max-widths |
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
- > **Sub-sequence rules:** Small sequences like `W` and `X` only have `W`, `W1`, `W2` and `X`, `X1`, `X2`. Sub-tokens like `W4`, `X4` do **not** exist. The `3` and `4` sub-steps (e.g. `A3`, `A4`, `B3`, `B4`) only appear in larger sequences starting from `A` and above where the jump between base tokens is big enough to warrant them.
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 — Easing Curves
374
+ ## TIMING
220
375
 
221
- | Token | Value | Use |
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
- Named keyframe animations:
390
+ Built-in:
391
+
392
+ | Name | Effect |
393
+ |---|---|
394
+ | `fadeIn` | Opacity 0 -> 1 |
236
395
 
237
- | Name | Effect | Use |
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: 'fadeInUp B defaultBezier' }
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
- ## MEDIA Breakpoints
413
+ ### Individual animation properties
251
414
 
252
- Built-in breakpoints:
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
- | Token | Query | Direction |
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
- Add `<` suffix for min-width (upward): `tabletL<` = `min-width: 1366px`
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
- '@tabletSm': { columns: 'repeat(2, 1fr)' },
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 — Conditional Environment Flags
491
+ ## CASES
283
492
 
284
- | Case | Condition |
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
- Define a single config object. Keys map directly to design system categories:
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
- '@light': '#ff7a18',
305
- '@dark': '#ffb347'
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: { color: 'text', background: 'primary' }
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: { base: 16, ratio: 1.618, subSequence: true },
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
- // Configuration flags
337
- useVariable: true, // emit CSS custom properties
338
- useReset: true, // apply CSS reset
339
- useFontImport: true, // load fonts via @font-face
340
- useIconSprite: true, // inline SVG sprite
341
- useDocumentTheme: true, // apply document theme to <html>
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
- **Do NOT** wrap these under `props` or other wrappers.
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 includes: `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`
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 | Default | Effect |
412
- | ------------------ | ------- | ----------------------------------------- |
413
- | `useReset` | `true` | Apply CSS reset |
414
- | `useVariable` | `true` | Emit CSS custom properties for all tokens |
415
- | `useFontImport` | `true` | Load FONT entries via @font-face |
416
- | `useIconSprite` | `true` | Inline the ICONS SVG sprite into the DOM |
417
- | `useSvgSprite` | `true` | Inline SVG sprite definitions |
418
- | `useDefaultConfig` | `true` | Merge smbls default design system config |
419
- | `useDocumentTheme` | `true` | Apply document theme to `<html>` |
420
- | `verbose` | `false` | Suppress design system debug output |
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 not nest config under `props` or other wrappers
427
- - Use `font_family` instead of `fontFamily`
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
- - Use dot-notation for color opacity: `color: 'white.7'` (not `'white .7'`)
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