fractalstyler2 0.4.0 → 0.7.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.
Files changed (87) hide show
  1. package/README.md +114 -95
  2. package/dist/cli.js +105 -25
  3. package/dist/components/Accordion.svelte +44 -0
  4. package/dist/components/Accordion.svelte.d.ts +23 -0
  5. package/dist/components/AccordionItem.svelte +44 -0
  6. package/dist/components/AccordionItem.svelte.d.ts +21 -0
  7. package/dist/components/AppShell.svelte +86 -0
  8. package/dist/components/AppShell.svelte.d.ts +39 -0
  9. package/dist/components/ColorPicker.svelte +38 -0
  10. package/dist/components/ColorPicker.svelte.d.ts +6 -0
  11. package/dist/components/Hero.svelte +14 -0
  12. package/dist/components/Hero.svelte.d.ts +9 -0
  13. package/dist/components/LayoutPicker.svelte +34 -0
  14. package/dist/components/LayoutPicker.svelte.d.ts +6 -0
  15. package/dist/components/MotionPicker.svelte +34 -0
  16. package/dist/components/MotionPicker.svelte.d.ts +6 -0
  17. package/dist/components/PageShell.svelte +14 -0
  18. package/dist/components/PageShell.svelte.d.ts +9 -0
  19. package/dist/components/PageSplit.svelte +26 -0
  20. package/dist/components/PageSplit.svelte.d.ts +18 -0
  21. package/dist/components/ShapePicker.svelte +37 -0
  22. package/dist/components/ShapePicker.svelte.d.ts +6 -0
  23. package/dist/css/fractalstyler.css +10643 -0
  24. package/dist/css/fractalstyler.min.css +2 -0
  25. package/dist/index.d.ts +18 -6
  26. package/dist/index.js +30 -12
  27. package/dist/mcp/schemas/compile_fractals.json +3 -3
  28. package/dist/mcp/schemas/css_to_fractals.json +1 -1
  29. package/dist/mcp/schemas/generate_component.json +2 -2
  30. package/dist/mcp/schemas/instructions.md +41 -14
  31. package/dist/mcp/schemas/list_fractals.json +9 -7
  32. package/dist/mcp/schemas/validate_recipe.json +2 -2
  33. package/dist/mcp/server.d.ts +1 -1
  34. package/dist/mcp/server.js +334 -237
  35. package/dist/presets.core.d.ts +42 -0
  36. package/dist/presets.core.js +190 -0
  37. package/dist/presets.svelte.d.ts +6 -0
  38. package/dist/presets.svelte.js +21 -0
  39. package/dist/styles/_00_presets.sass +111 -0
  40. package/dist/styles/_00_themes.sass +1061 -0
  41. package/dist/styles/_00_tokens.sass +57 -17
  42. package/dist/styles/_01_config.sass +77 -70
  43. package/dist/styles/_02_dimensions.sass +174 -0
  44. package/dist/styles/_03_containers.sass +105 -0
  45. package/dist/styles/_04_layouts.sass +100 -0
  46. package/dist/styles/_05_shells.sass +374 -0
  47. package/dist/styles/_06_visuals.sass +236 -0
  48. package/dist/styles/_07_interactions.sass +112 -0
  49. package/dist/styles/_08_own.sass +4 -0
  50. package/dist/styles/canonical-markups.md +160 -0
  51. package/dist/styles/index.sass +11 -18
  52. package/dist/themes.d.ts +7 -0
  53. package/dist/themes.js +45 -0
  54. package/dist/version.d.ts +1 -0
  55. package/dist/version.js +2 -0
  56. package/package.json +26 -15
  57. package/plugin.json +11 -10
  58. package/registry.json +2002 -0
  59. package/skills/fractal-styler/SKILL.md +137 -50
  60. package/skills/fractal-styler/references/fractals.md +416 -28
  61. package/skills/fractal-styler/references/tokens.md +110 -36
  62. package/dist/styles/_02_fonts.sass +0 -13
  63. package/dist/styles/_03_responsive.sass +0 -31
  64. package/dist/styles/_04_atoms.sass +0 -155
  65. package/dist/styles/_05_molecules.sass +0 -97
  66. package/dist/styles/_06_recipes.sass +0 -189
  67. package/dist/styles/_07_base.sass +0 -44
  68. package/dist/styles/_08_blocks.sass +0 -433
  69. package/dist/styles/_09_utilities.sass +0 -208
  70. package/dist/styles/_10_layouts.sass +0 -373
  71. package/dist/styles/_11_own.sass +0 -21
  72. package/dist/styles/_fractals.sass +0 -14
  73. package/skills/style-migration/SKILL.md +0 -45
  74. package/templates/_00_tokens.sass +0 -136
  75. package/templates/_01_config.sass +0 -66
  76. package/templates/_02_fonts.sass +0 -13
  77. package/templates/_03_responsive.sass +0 -31
  78. package/templates/_04_atoms.sass +0 -155
  79. package/templates/_05_molecules.sass +0 -97
  80. package/templates/_06_recipes.sass +0 -189
  81. package/templates/_07_base.sass +0 -44
  82. package/templates/_08_blocks.sass +0 -433
  83. package/templates/_09_utilities.sass +0 -207
  84. package/templates/_10_layouts.sass +0 -373
  85. package/templates/_11_own.sass +0 -21
  86. package/templates/_fractals.sass +0 -14
  87. package/templates/index.sass +0 -18
@@ -1,373 +0,0 @@
1
- // =============================================================================
2
- // 10_LAYOUTS — the largest fractals. Same recipe move, page scale.
3
- // -----------------------------------------------------------------------------
4
- // Layouts compose molecule and atom fractals into structural arrangements.
5
- // State and responsive reflow are handled with +cols, +auto-grid, +cover.
6
- // =============================================================================
7
-
8
- @use 'fractals' as *
9
-
10
- // Column grid presets
11
- .grid-1
12
- +cols((base: 1), s)
13
-
14
- .grid-2
15
- +cols((base: 1, md: 2), m)
16
-
17
- .grid-3
18
- +cols((base: 1, sm: 2, lg: 3), s)
19
-
20
- .grid-4
21
- +cols((base: 1, sm: 2, lg: 4), s)
22
-
23
- .grid-6
24
- +cols((base: 2, sm: 3, md: 4, lg: 6), xs)
25
-
26
- // A grid that never needs breakpoints: it fits as many columns as will hold
27
- // the min track. Reach for this when column count is negotiable.
28
- .card-grid
29
- +auto-grid(16rem, s)
30
-
31
- // Hero — full-viewport cover with a centered, measured message.
32
- .hero
33
- +cover(80vh, xl)
34
- > .center
35
- +stack(m, center)
36
- text-align: center
37
- max-width: 45ch
38
-
39
- // Holy grail — header / (nav · main · aside) / footer.
40
- .holy-grail
41
- display: grid
42
- min-height: 100vh
43
- grid-template-rows: auto 1fr auto
44
- grid-template-areas: 'header' 'main' 'footer'
45
- > .hg-header
46
- grid-area: header
47
- > .hg-footer
48
- grid-area: footer
49
- > .hg-body
50
- grid-area: main
51
- display: grid
52
- grid-template-columns: 1fr
53
- +gap(m)
54
- +pad(m)
55
- +at(lg)
56
- > .hg-body
57
- grid-template-columns: var(--nav-w, 220px) minmax(0, 1fr) var(--aside-w, 260px)
58
- > .hg-nav
59
- +sticky(var(--space-m))
60
- align-self: start
61
- > .hg-aside
62
- +sticky(var(--space-m))
63
- align-self: start
64
-
65
- // Docs layout — responsive 3-column frame (nav · main · TOC).
66
- .docs
67
- position: relative
68
- display: grid
69
- grid-template-columns: 1fr
70
- min-height: calc(100vh - var(--header-height, 48px))
71
-
72
- // Left Nav Rail (off-canvas drawer on mobile, sticky rail on desktop)
73
- > .docs-nav
74
- position: fixed
75
- top: var(--header-height, 48px)
76
- left: 0
77
- z-index: var(--z-modal, 200)
78
- width: min(85vw, 280px)
79
- height: calc(100dvh - var(--header-height, 48px))
80
- padding: var(--space-s)
81
- overflow-y: auto
82
- background: var(--bg)
83
- +border(right)
84
- transform: translateX(-105%)
85
- transition: transform 200ms ease-out
86
-
87
- &[data-drawer-open='true'] > .docs-nav
88
- transform: translateX(0)
89
-
90
- // Backdrop for mobile drawer
91
- > .docs-backdrop
92
- position: fixed
93
- inset: var(--header-height, 48px) 0 0 0
94
- z-index: calc(var(--z-modal, 200) - 1)
95
- background: rgba(0, 0, 0, 0.5)
96
- backdrop-filter: blur(2px)
97
- border: none
98
- cursor: pointer
99
-
100
- // Center Reading Column
101
- > .docs-main
102
- +min0
103
- +box
104
- padding-block: var(--space-l)
105
- padding-inline: var(--space-s)
106
- > *
107
- width: 100%
108
- max-width: clamp(600px, 58vw, 760px)
109
- margin-inline: auto
110
-
111
- // Right TOC Rail (desktop only)
112
- > .docs-toc
113
- display: none
114
-
115
- // Desktop Breakpoint (>= 1024px)
116
- +at(lg)
117
- --docs-nav-w: clamp(220px, 20vw, 270px)
118
- --docs-toc-w: clamp(200px, 18vw, 240px)
119
- grid-template-columns: var(--docs-nav-w) minmax(0, 1fr) var(--docs-toc-w)
120
-
121
- > .docs-nav
122
- position: sticky
123
- top: var(--header-height, 48px)
124
- width: auto
125
- height: calc(100vh - var(--header-height, 48px))
126
- transform: none
127
- z-index: 10
128
- padding: var(--space-m) var(--space-s)
129
-
130
- > .docs-toc
131
- display: block
132
- position: sticky
133
- top: var(--header-height, 48px)
134
- height: calc(100vh - var(--header-height, 48px))
135
- overflow-y: auto
136
- padding: var(--space-m) var(--space-s)
137
- +border(left)
138
-
139
- > .docs-backdrop
140
- display: none
141
-
142
- // NavTree styling
143
- .navtree
144
- +box
145
- +gap(m)
146
-
147
- .navtree-group
148
- +box
149
- +gap(3xs)
150
-
151
- .navtree-title
152
- font-size: var(--text-xs)
153
- font-weight: 600
154
- text-transform: uppercase
155
- letter-spacing: 0.06em
156
- color: var(--text-muted)
157
- padding: 6px 8px
158
-
159
- .navtree-link
160
- +row(between, center)
161
- padding: 6px 10px
162
- font-size: var(--text-sm)
163
- color: var(--text-secondary)
164
- border-radius: var(--radius-4)
165
- text-decoration: none
166
- transition: all 120ms ease
167
- &:hover
168
- +bg(raised)
169
- +ink(primary)
170
- &[aria-current='page'], &[data-active='true']
171
- +bg(surface)
172
- color: var(--theme)
173
- font-weight: 500
174
- +border
175
-
176
- .navtree-sub
177
- +box
178
- +gap(3xs)
179
- margin-left: 12px
180
- padding-left: 8px
181
- +border(left)
182
-
183
- // TOC styling
184
- .toc
185
- +box
186
- +gap(m)
187
- height: 100%
188
-
189
- .toc-title
190
- font-size: var(--text-xs)
191
- font-weight: 600
192
- text-transform: uppercase
193
- letter-spacing: 0.06em
194
- color: var(--text-muted)
195
-
196
- .toc-list
197
- list-style: none
198
- margin: 0
199
- padding: 0
200
- +box
201
- +gap(2xs)
202
-
203
- .toc-link
204
- display: block
205
- font-size: var(--text-xs)
206
- color: var(--text-muted)
207
- text-decoration: none
208
- padding: 3px 0
209
- transition: color 120ms ease
210
- &:hover
211
- +ink(primary)
212
- &[aria-current='true']
213
- color: var(--theme)
214
- font-weight: 500
215
- &[data-depth='3']
216
- padding-left: 10px
217
-
218
- .toc-footer
219
- +partition(top, s)
220
- +box
221
- +gap(2xs)
222
-
223
- // Mobile TOC Disclosure
224
- .docs-mobile-toc
225
- +box
226
- +gap(xs)
227
- +pad(xs)
228
- +radius(6)
229
- +bg(surface)
230
- +border(all, var(--border))
231
- summary
232
- +row(between, center)
233
- +weight(500)
234
- +type(sm)
235
- +ink(primary)
236
- cursor: pointer
237
- user-select: none
238
- list-style: none
239
- &::-webkit-details-marker
240
- display: none
241
- &[open]
242
- +bg(raised)
243
- summary
244
- margin-bottom: var(--space-xs)
245
- padding-bottom: var(--space-2xs)
246
- +border(bottom, var(--border))
247
-
248
- // Prose Typography Container
249
- .prose
250
- font-size: var(--text-sm)
251
- line-height: 1.65
252
- color: var(--text-secondary)
253
-
254
- > * + *
255
- margin-top: 1rem
256
-
257
- h1
258
- font-size: var(--text-3xl)
259
- font-weight: 700
260
- color: var(--text-primary)
261
- line-height: 1.2
262
- margin-top: 0
263
- margin-bottom: 0.5rem
264
-
265
- h2
266
- font-size: var(--text-xl)
267
- font-weight: 600
268
- color: var(--text-primary)
269
- line-height: 1.3
270
- margin-top: 2rem
271
- margin-bottom: 0.5rem
272
- padding-bottom: 0.25rem
273
- +border(bottom)
274
-
275
- h3
276
- font-size: var(--text-md)
277
- font-weight: 600
278
- color: var(--text-primary)
279
- margin-top: 1.5rem
280
- margin-bottom: 0.25rem
281
-
282
- h4
283
- font-size: var(--text-sm)
284
- font-weight: 600
285
- color: var(--text-primary)
286
-
287
- p
288
- margin-bottom: 1rem
289
-
290
- ul, ol
291
- padding-left: 1.25rem
292
- margin-bottom: 1rem
293
- li
294
- margin-bottom: 0.25rem
295
-
296
- code:not(pre code)
297
- font-family: var(--font-mono)
298
- font-size: 0.85em
299
- padding: 2px 6px
300
- background: var(--bg-raised)
301
- border: 1px solid var(--border)
302
- border-radius: var(--radius-3)
303
- color: var(--text-primary)
304
-
305
- pre
306
- position: relative
307
- background: var(--bg-surface)
308
- border: 1px solid var(--border)
309
- border-radius: var(--radius-6)
310
- padding: var(--space-s)
311
- overflow-x: auto
312
- font-family: var(--font-mono)
313
- font-size: var(--text-xs)
314
- line-height: 1.5
315
- color: var(--text-primary)
316
- code
317
- font-family: inherit
318
- font-size: inherit
319
- background: none
320
- border: none
321
- padding: 0
322
-
323
- table
324
- width: 100%
325
- border-collapse: collapse
326
- margin-block: 1.25rem
327
- font-size: var(--text-sm)
328
- th
329
- text-align: left
330
- padding: 8px 12px
331
- border-bottom: 1px solid var(--border-subtle)
332
- font-size: var(--text-xs)
333
- font-weight: 600
334
- text-transform: uppercase
335
- letter-spacing: 0.04em
336
- color: var(--text-primary)
337
- td
338
- padding: 8px 12px
339
- border-bottom: 1px solid var(--border)
340
- color: var(--text-secondary)
341
-
342
- blockquote
343
- margin: 1.25rem 0
344
- padding: 8px 16px
345
- border-left: 3px solid var(--theme)
346
- background: var(--bg-raised)
347
- border-radius: 0 var(--radius-4) var(--radius-4) 0
348
- p
349
- margin: 0
350
- color: var(--text-primary)
351
-
352
- // App shell — sticky header, fluid body, footer.
353
- .app-shell
354
- +box
355
- +relative
356
- isolation: isolate
357
- min-height: 100vh
358
- > .app-header
359
- +row(null, center)
360
- +sticky(0)
361
- +px(m)
362
- background: var(--bg)
363
- z-index: var(--z-sticky)
364
- height: var(--header-height)
365
- +border(bottom)
366
- > .app-main
367
- +grow
368
- +min0
369
- > .app-footer
370
- +row(null, center)
371
- +px(m)
372
- min-height: var(--footer-height)
373
- +border(top)
@@ -1,21 +0,0 @@
1
- // =============================================================================
2
- // 11_OWN — bespoke project-specific styles and micro-components.
3
- // =============================================================================
4
-
5
- @use 'fractals' as *
6
-
7
- .logomotif
8
- height: 28px
9
- width: 28px
10
- filter: saturate(0)
11
-
12
- .logotype
13
- height: 16px
14
- filter: saturate(0)
15
-
16
- .header-nav
17
- font-size: var(--text-sm)
18
- text-decoration: none
19
- color: var(--text-secondary)
20
- &:hover
21
- color: var(--theme-color)
@@ -1,14 +0,0 @@
1
- // =============================================================================
2
- // FRACTALS — the pure API barrel. Emits NO CSS on its own.
3
- // -----------------------------------------------------------------------------
4
- // In any component partial or Svelte component:
5
- // @use '$lib/styles/fractals' as *
6
- // (or @use './fractals' as *)
7
- // then call fractals freely: +surface(...) +stack(...) +card(...)
8
- // =============================================================================
9
-
10
- @forward '01_config'
11
- @forward '03_responsive'
12
- @forward '04_atoms'
13
- @forward '05_molecules'
14
- @forward '06_recipes'
@@ -1,45 +0,0 @@
1
- ---
2
- name: style-migration
3
- description: Migrate legacy CSS, Tailwind utilities, or fractals-styler (v1) classes into modern fractalstyler2 SASS mixin recipes and token scales. Use when refactoring stylesheets, updating legacy components, or cleaning up utility class soup.
4
- ---
5
-
6
- # Style Migration & Refactoring Skill
7
-
8
- This skill guides the refactoring and migration of existing styles into idiomatic `fractalstyler2`.
9
-
10
- ---
11
-
12
- ## 1. Quick Replacement Matrix
13
-
14
- | Legacy Pattern | Problem | fractalstyler2 Replacement |
15
- | :--- | :--- | :--- |
16
- | `gap8`, `gap16`, `gap24` | Dynamic JIT classes removed in v2 | Markup: `.gap-xs`, `.gap-s`, `.gap-m`<br>SASS: `+gap(8)` or `+gap(s)` |
17
- | `pad8`, `pad16`, `pad24` | Dynamic JIT classes removed in v2 | Markup: `.pad-xs`, `.pad-s`, `.pad-m`<br>SASS: `+pad(16)` or `+pad(m)` |
18
- | `<div class="center">` (as reading text column) | In v2, `.center` dead-centers items in a grid | SASS: `.reading-col { +center-column }` |
19
- | `<div class="stack">` | Markup class `.stack` does not exist | SASS: `.container { +stack(s) }` |
20
- | `<div class="cluster">` | Markup class `.cluster` does not exist | SASS: `.tag-row { +cluster(xs) }` |
21
- | `w100`, `h100` | Removed aliases | `.wfull`, `.hfull` |
22
- | `min-w-0`, `min-h-0` | Removed utilities | `.min0` |
23
- | `[data-variant='quiet']` | Renamed on button | `[data-variant='ghost']` |
24
- | `.appshell` | Renamed layout | `.app-shell` |
25
-
26
- ---
27
-
28
- ## 2. Refactoring Procedure
29
-
30
- 1. **Identify the Container**: Is it a card, panel, button, reading column, or grid?
31
- 2. **Select the Molecule**:
32
- - Vertical list of items → `+stack(s)`
33
- - Tag list / button row → `+cluster(xs)`
34
- - Box with border/radius/padding → `+surface(surface, s, 12)`
35
- - Full height hero → `+cover(80vh, xl)`
36
- 3. **Strip Utility Soup from Markup**: Replace long class strings (`class="box pad16 gap12 w100 min-w-0 radius12 border"`) with a single semantic class (`class="card"` or `class="feed-item"`).
37
- 4. **Move Decisions to `<style lang="sass">`**:
38
- ```sass
39
- @use '$lib/styles/fractals' as *
40
-
41
- .feed-item
42
- +surface(surface, s, 12)
43
- +stack(s)
44
- ```
45
- 5. **Verify**: Use the MCP tool `validate_recipe` or `npx sass src/lib/styles/index.sass /tmp/check.css`.
@@ -1,136 +0,0 @@
1
- // =============================================================================
2
- // 00_TOKENS — the single source of truth for runtime CSS custom properties.
3
- // -----------------------------------------------------------------------------
4
- // Light is the marker-free default so tokens stay defined during SSR and with
5
- // JS disabled; dark comes from prefers-color-scheme and explicit [data-mode='dark'].
6
- // =============================================================================
7
-
8
- =light-theme-tokens
9
- color-scheme: light
10
- --bg: #fdfefe
11
- --bg-surface: #f8f7f7
12
- --bg-raised: #f1f5f9
13
- --bg-panel: #F1F3F5
14
- --bg-footer: #E9ECEF
15
- --bg-popover: #FFFFFF
16
- --bg-dialog: #FFFFFF
17
- --bg-terminal: #0F172A
18
- --bg-input: #FFFFFF
19
- --bg-canvas: #F8F9FA
20
- --text-primary: #0f172a
21
- --text-secondary: #5b6472
22
- --text-muted: #929497
23
- --text-inverse: #ffffff
24
- --state-hover: #E2E8F0
25
- --state-hover-subtle: #F1F5F9
26
- --state-selected: #CBD5E1
27
- --border: #E2E8F0
28
- --border-subtle: #EDF2F7
29
- --theme-color: #04825B
30
- --theme-color-alt: #047857
31
- --theme: var(--theme-color)
32
- --theme-hover: var(--theme-color-alt)
33
- --ring: rgba(0, 127, 78, 0.35)
34
-
35
- =dark-theme-tokens
36
- color-scheme: dark
37
- --bg: #0E1118
38
- --bg-surface: #141824
39
- --bg-raised: #1C2232
40
- --bg-panel: #101420
41
- --bg-footer: #0B0D14
42
- --bg-popover: #20273A
43
- --bg-dialog: #20273A
44
- --bg-terminal: #080A0F
45
- --bg-input: #121622
46
- --bg-canvas: #0E1118
47
- --border: #28324A
48
- --border-subtle: #1E2538
49
- --text-primary: #EDF2F7
50
- --text-secondary: #9BB0C7
51
- --text-muted: #5D7087
52
- --state-hover: #263047
53
- --state-hover-subtle: #1B2233
54
- --state-selected: #32405E
55
- --theme-color: #38BDF8
56
- --theme-color-alt: #0EA5E9
57
- --theme: var(--theme-color)
58
- --theme-hover: var(--theme-color-alt)
59
- --text-inverse: #0E1118
60
- --ring: rgba(16, 185, 129, 0.4)
61
-
62
- :root
63
- color-scheme: light
64
-
65
- // Fonts
66
- --font-sans: "Google Sans Flex", sans-serif
67
- --font-mono: "JetBrains Mono", monospace
68
-
69
- // Fluid type scale (Utopia 360→1240)
70
- --text-xs: 0.75rem
71
- --text-sm: clamp(0.9375rem, 0.9119rem + 0.1136vw, 1rem)
72
- --text-md: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem)
73
- --text-lg: clamp(1.35rem, 1.2631rem + 0.3864vw, 1.5625rem)
74
- --text-xl: clamp(1.62rem, 1.4837rem + 0.6057vw, 1.9531rem)
75
- --text-2xl: clamp(1.944rem, 1.7405rem + 0.9044vw, 2.4414rem)
76
- --text-3xl: clamp(2.3328rem, 2.0387rem + 1.3072vw, 3.0518rem)
77
- --text-4xl: clamp(2.7994rem, 2.384rem + 1.8461vw, 3.8147rem)
78
-
79
- // Fluid space scale
80
- --space-3xs: clamp(0.3125rem, 0.3125rem + 0vw, 0.3125rem)
81
- --space-2xs: clamp(0.5625rem, 0.5369rem + 0.1136vw, 0.625rem)
82
- --space-xs: clamp(0.875rem, 0.8494rem + 0.1136vw, 0.9375rem)
83
- --space-s: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem)
84
- --space-m: clamp(1.6875rem, 1.6108rem + 0.3409vw, 1.875rem)
85
- --space-l: clamp(2.25rem, 2.1477rem + 0.4545vw, 2.5rem)
86
- --space-xl: clamp(3.375rem, 3.2216rem + 0.6818vw, 3.75rem)
87
- --space-2xl: clamp(4.5rem, 4.2955rem + 0.9091vw, 5rem)
88
- --space-3xl: clamp(6.75rem, 6.4432rem + 1.3636vw, 7.5rem)
89
- --space-s-l: clamp(1.125rem, 0.5625rem + 2.5vw, 2.5rem)
90
-
91
- // Radius (Concentric hierarchy)
92
- --radius-0: 0
93
- --radius-2: 2px
94
- --radius-3: 3px
95
- --radius-4: 4px
96
- --radius-6: 6px
97
- --radius-8: 8px
98
- --radius-12: 12px
99
- --radius-16: 16px
100
- --radius-24: 24px
101
- --radius-full: 9999px
102
-
103
- // Control Heights
104
- --control-h-sm: 26px
105
- --control-h-md: 32px
106
- --control-h-lg: 38px
107
-
108
- // Shadow
109
- --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06)
110
- --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08)
111
- --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12)
112
-
113
- // Layering
114
- --z-base: 0
115
- --z-raised: 10
116
- --z-sticky: 100
117
- --z-modal: 200
118
- --z-toast: 300
119
-
120
- // Layout
121
- --header-height: 48px
122
- --footer-height: 56px
123
- --measure: 65ch
124
-
125
- // Default Light Palette
126
- +light-theme-tokens
127
-
128
- @media (prefers-color-scheme: dark)
129
- :root:not([data-mode='light'])
130
- +dark-theme-tokens
131
-
132
- [data-mode='dark']
133
- +dark-theme-tokens
134
-
135
- [data-mode='light']
136
- +light-theme-tokens
@@ -1,66 +0,0 @@
1
- // =============================================================================
2
- // 01_CONFIG — the finite vocabulary every fractal draws from.
3
- // -----------------------------------------------------------------------------
4
- // Scales live here as Sass data; resolvers turn a keyword-or-raw value into the
5
- // right token var() or unit. Fractals never hardcode a px or a token name —
6
- // they route through space(), radius(), etc. so the system speaks one language.
7
- // =============================================================================
8
-
9
- @use 'sass:map'
10
- @use 'sass:math'
11
- @use 'sass:meta'
12
- @use 'sass:list'
13
-
14
- // --- Scales (mirror the custom properties in _00_tokens.sass) ----------------
15
- $breakpoints: (sm: 640px, md: 768px, lg: 1024px, xl: 1240px)
16
-
17
- $space-steps: 3xs 2xs xs s m l xl 2xl 3xl s-l
18
- $radius-steps: 0 2 3 4 6 8 12 16 24 full
19
- $text-steps: xs sm md lg xl 2xl 3xl 4xl
20
- $shadow-steps: sm md lg
21
-
22
- // Surfaces mapped to the 21 theme token contract
23
- $surface-roles: bg surface raised panel footer popover dialog terminal input canvas
24
- $ink-roles: primary secondary muted inverse theme-color theme-color-alt
25
-
26
- $align-map: (start: flex-start, end: flex-end, center: center, between: space-between, around: space-around, evenly: space-evenly, stretch: stretch, baseline: baseline)
27
-
28
- // --- Universal Token Resolver --------------------------------------------------
29
- @function tok($group, $v)
30
- @if $v == null
31
- @return null
32
- @if meta.type-of($v) == number and math.is-unitless($v)
33
- @return #{$v}px
34
- @if meta.type-of($v) == string and not (math.unit($v) != '')
35
- @return var(--#{$group}-#{$v})
36
- @return $v
37
-
38
- // --- Resolvers ----------------------------------------------------------------
39
-
40
- @function space($v)
41
- @return tok(space, $v)
42
-
43
- @function radius($v)
44
- @return tok(radius, $v)
45
-
46
- @function text-size($v)
47
- @return tok(text, $v)
48
-
49
- @function shadow($v)
50
- @return tok(shadow, $v)
51
-
52
- @function surface($role)
53
- @if $role == bg
54
- @return var(--bg)
55
- @return tok(bg, $role)
56
-
57
- @function ink($role)
58
- @if $role == primary
59
- @return var(--text-primary)
60
- @return tok(text, $role)
61
-
62
- @function align($v)
63
- @return map.get($align-map, $v) or $v
64
-
65
- @function bp($name)
66
- @return map.get($breakpoints, $name)
@@ -1,13 +0,0 @@
1
- // =============================================================================
2
- // 02_FONTS — local webfont declarations & font-family fallbacks.
3
- // -----------------------------------------------------------------------------
4
- // Downstream projects customize their font loading here.
5
- // =============================================================================
6
-
7
- // Define custom @font-face rules or load Google / local webfonts as needed:
8
- // @font-face
9
- // font-family: 'YourFont'
10
- // src: url('/fonts/YourFont.woff2') format('woff2')
11
- // font-weight: 100 900
12
- // font-style: normal
13
- // font-display: swap
@@ -1,31 +0,0 @@
1
- // =============================================================================
2
- // 03_RESPONSIVE — the breakpoint mixins. Viewport-aware conditional styling.
3
- // -----------------------------------------------------------------------------
4
- // Mobile-first defaults; use +at($bp) for min-width media queries.
5
- // =============================================================================
6
-
7
- @use '01_config' as *
8
-
9
- =at($bp)
10
- $width: bp($bp)
11
- @if $width
12
- @media (min-width: $width)
13
- @content
14
- @else
15
- @media (min-width: $bp)
16
- @content
17
-
18
- =below($bp)
19
- $width: bp($bp)
20
- @if $width
21
- @media (max-width: ($width - 1px))
22
- @content
23
- @else
24
- @media (max-width: $bp)
25
- @content
26
-
27
- =between($min-bp, $max-bp)
28
- $min: bp($min-bp)
29
- $max: bp($max-bp)
30
- @media (min-width: $min) and (max-width: ($max - 1px))
31
- @content