create-huenei-template 0.2.2 → 0.2.4

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/dist/config/templates.js +3 -3
  2. package/dist/templates/frontend/angular-base/.cursor/skills/angular-component/SKILL.md +288 -0
  3. package/dist/templates/frontend/angular-base/.cursor/skills/angular-component/references/component-patterns.md +358 -0
  4. package/dist/templates/frontend/angular-base/.cursor/skills/angular-di/SKILL.md +387 -0
  5. package/dist/templates/frontend/angular-base/.cursor/skills/angular-di/references/di-patterns.md +519 -0
  6. package/dist/templates/frontend/angular-base/.cursor/skills/angular-directives/SKILL.md +437 -0
  7. package/dist/templates/frontend/angular-base/.cursor/skills/angular-directives/references/directive-patterns.md +570 -0
  8. package/dist/templates/frontend/angular-base/.cursor/skills/angular-forms/SKILL.md +434 -0
  9. package/dist/templates/frontend/angular-base/.cursor/skills/angular-forms/references/form-patterns.md +398 -0
  10. package/dist/templates/frontend/angular-base/.cursor/skills/angular-http/SKILL.md +366 -0
  11. package/dist/templates/frontend/angular-base/.cursor/skills/angular-http/references/http-patterns.md +448 -0
  12. package/dist/templates/frontend/angular-base/.cursor/skills/angular-routing/SKILL.md +395 -0
  13. package/dist/templates/frontend/angular-base/.cursor/skills/angular-routing/references/routing-patterns.md +472 -0
  14. package/dist/templates/frontend/angular-base/.cursor/skills/angular-signals/SKILL.md +302 -0
  15. package/dist/templates/frontend/angular-base/.cursor/skills/angular-signals/references/signal-patterns.md +404 -0
  16. package/dist/templates/frontend/angular-base/.cursor/skills/angular-ssr/SKILL.md +435 -0
  17. package/dist/templates/frontend/angular-base/.cursor/skills/angular-ssr/references/ssr-patterns.md +497 -0
  18. package/dist/templates/frontend/angular-base/.cursor/skills/angular-testing/SKILL.md +660 -0
  19. package/dist/templates/frontend/angular-base/.cursor/skills/angular-testing/references/testing-patterns.md +707 -0
  20. package/dist/templates/frontend/angular-base/.cursor/skills/angular-tooling/SKILL.md +352 -0
  21. package/dist/templates/frontend/angular-base/.cursor/skills/angular-tooling/references/tooling-patterns.md +448 -0
  22. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-accessibility/SKILL.md +780 -0
  23. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-components/SKILL.md +718 -0
  24. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-design-systems/SKILL.md +612 -0
  25. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-layouts/SKILL.md +594 -0
  26. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/SKILL.md +432 -0
  27. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/references/animation-patterns.md +427 -0
  28. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/SKILL.md +354 -0
  29. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/references/troubleshooting-guide.md +306 -0
  30. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/SKILL.md +578 -0
  31. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/references/react-patterns.md +353 -0
  32. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/SKILL.md +608 -0
  33. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/advanced-theme-patterns.md +215 -0
  34. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/custom-utilities-guide.md +281 -0
  35. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-mobile-first/SKILL.md +768 -0
  36. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/SKILL.md +374 -0
  37. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/references/bundle-optimization.md +244 -0
  38. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-plugins/SKILL.md +505 -0
  39. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/SKILL.md +601 -0
  40. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/references/advanced-responsive-patterns.md +485 -0
  41. package/dist/templates/frontend/angular-base/.cursor/skills/web-design-guidelines/SKILL.md +39 -0
  42. package/dist/templates/frontend/angular-base/package.json +0 -1
  43. package/dist/templates/frontend/angular-base/pnpm-lock.yaml +8183 -0
  44. package/package.json +1 -1
  45. package/templates/frontend/angular-base/.cursor/skills/angular-component/SKILL.md +288 -0
  46. package/templates/frontend/angular-base/.cursor/skills/angular-component/references/component-patterns.md +358 -0
  47. package/templates/frontend/angular-base/.cursor/skills/angular-di/SKILL.md +387 -0
  48. package/templates/frontend/angular-base/.cursor/skills/angular-di/references/di-patterns.md +519 -0
  49. package/templates/frontend/angular-base/.cursor/skills/angular-directives/SKILL.md +437 -0
  50. package/templates/frontend/angular-base/.cursor/skills/angular-directives/references/directive-patterns.md +570 -0
  51. package/templates/frontend/angular-base/.cursor/skills/angular-forms/SKILL.md +434 -0
  52. package/templates/frontend/angular-base/.cursor/skills/angular-forms/references/form-patterns.md +398 -0
  53. package/templates/frontend/angular-base/.cursor/skills/angular-http/SKILL.md +366 -0
  54. package/templates/frontend/angular-base/.cursor/skills/angular-http/references/http-patterns.md +448 -0
  55. package/templates/frontend/angular-base/.cursor/skills/angular-routing/SKILL.md +395 -0
  56. package/templates/frontend/angular-base/.cursor/skills/angular-routing/references/routing-patterns.md +472 -0
  57. package/templates/frontend/angular-base/.cursor/skills/angular-signals/SKILL.md +302 -0
  58. package/templates/frontend/angular-base/.cursor/skills/angular-signals/references/signal-patterns.md +404 -0
  59. package/templates/frontend/angular-base/.cursor/skills/angular-ssr/SKILL.md +435 -0
  60. package/templates/frontend/angular-base/.cursor/skills/angular-ssr/references/ssr-patterns.md +497 -0
  61. package/templates/frontend/angular-base/.cursor/skills/angular-testing/SKILL.md +660 -0
  62. package/templates/frontend/angular-base/.cursor/skills/angular-testing/references/testing-patterns.md +707 -0
  63. package/templates/frontend/angular-base/.cursor/skills/angular-tooling/SKILL.md +352 -0
  64. package/templates/frontend/angular-base/.cursor/skills/angular-tooling/references/tooling-patterns.md +448 -0
  65. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-accessibility/SKILL.md +780 -0
  66. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-components/SKILL.md +718 -0
  67. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-design-systems/SKILL.md +612 -0
  68. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-layouts/SKILL.md +594 -0
  69. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/SKILL.md +432 -0
  70. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/references/animation-patterns.md +427 -0
  71. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/SKILL.md +354 -0
  72. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/references/troubleshooting-guide.md +306 -0
  73. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/SKILL.md +578 -0
  74. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/references/react-patterns.md +353 -0
  75. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/SKILL.md +608 -0
  76. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/advanced-theme-patterns.md +215 -0
  77. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/custom-utilities-guide.md +281 -0
  78. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-mobile-first/SKILL.md +768 -0
  79. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/SKILL.md +374 -0
  80. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/references/bundle-optimization.md +244 -0
  81. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-plugins/SKILL.md +505 -0
  82. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/SKILL.md +601 -0
  83. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/references/advanced-responsive-patterns.md +485 -0
  84. package/templates/frontend/angular-base/.cursor/skills/web-design-guidelines/SKILL.md +39 -0
  85. package/templates/frontend/angular-base/package.json +0 -1
  86. package/templates/frontend/angular-base/pnpm-lock.yaml +8183 -0
  87. package/templates/frontend/angular-base/package-lock.json +0 -13321
@@ -0,0 +1,612 @@
1
+ ---
2
+ name: tailwindcss-advanced-design-systems
3
+ description: Tailwind CSS advanced design systems with design tokens and @theme configuration
4
+ ---
5
+
6
+ # Tailwind CSS Advanced Design Systems
7
+
8
+ ## Building Design Tokens with @theme
9
+
10
+ ### Complete Design Token System
11
+
12
+ ```css
13
+ @import "tailwindcss";
14
+
15
+ @theme {
16
+ /* ===== COLOR SYSTEM ===== */
17
+
18
+ /* Disable all defaults for full control */
19
+ --color-*: initial;
20
+
21
+ /* Semantic color tokens */
22
+ --color-surface-primary: oklch(1 0 0);
23
+ --color-surface-secondary: oklch(0.98 0.002 250);
24
+ --color-surface-tertiary: oklch(0.95 0.004 250);
25
+ --color-surface-inverse: oklch(0.15 0.02 250);
26
+
27
+ --color-text-primary: oklch(0.15 0.02 250);
28
+ --color-text-secondary: oklch(0.4 0.02 250);
29
+ --color-text-tertiary: oklch(0.55 0.015 250);
30
+ --color-text-inverse: oklch(0.98 0 0);
31
+ --color-text-disabled: oklch(0.7 0.01 250);
32
+
33
+ --color-border-default: oklch(0.85 0.01 250);
34
+ --color-border-subtle: oklch(0.92 0.005 250);
35
+ --color-border-strong: oklch(0.7 0.02 250);
36
+
37
+ /* Brand colors with full scale */
38
+ --color-brand-50: oklch(0.97 0.02 250);
39
+ --color-brand-100: oklch(0.93 0.04 250);
40
+ --color-brand-200: oklch(0.87 0.08 250);
41
+ --color-brand-300: oklch(0.78 0.12 250);
42
+ --color-brand-400: oklch(0.68 0.16 250);
43
+ --color-brand-500: oklch(0.58 0.2 250);
44
+ --color-brand-600: oklch(0.5 0.2 250);
45
+ --color-brand-700: oklch(0.42 0.18 250);
46
+ --color-brand-800: oklch(0.35 0.15 250);
47
+ --color-brand-900: oklch(0.28 0.12 250);
48
+ --color-brand-950: oklch(0.2 0.08 250);
49
+
50
+ /* Status colors */
51
+ --color-success: oklch(0.6 0.18 145);
52
+ --color-success-subtle: oklch(0.95 0.04 145);
53
+ --color-warning: oklch(0.75 0.18 85);
54
+ --color-warning-subtle: oklch(0.95 0.06 85);
55
+ --color-error: oklch(0.55 0.22 25);
56
+ --color-error-subtle: oklch(0.95 0.04 25);
57
+ --color-info: oklch(0.6 0.18 250);
58
+ --color-info-subtle: oklch(0.95 0.04 250);
59
+
60
+ /* ===== TYPOGRAPHY SYSTEM ===== */
61
+
62
+ --font-*: initial;
63
+
64
+ --font-display: "Cal Sans", "Inter", system-ui, sans-serif;
65
+ --font-body: "Inter", system-ui, sans-serif;
66
+ --font-mono: "JetBrains Mono", "Fira Code", monospace;
67
+
68
+ /* Type scale (Major Third - 1.25) */
69
+ --text-xs: 0.64rem;
70
+ --text-sm: 0.8rem;
71
+ --text-base: 1rem;
72
+ --text-lg: 1.25rem;
73
+ --text-xl: 1.563rem;
74
+ --text-2xl: 1.953rem;
75
+ --text-3xl: 2.441rem;
76
+ --text-4xl: 3.052rem;
77
+ --text-5xl: 3.815rem;
78
+
79
+ /* Line heights */
80
+ --leading-none: 1;
81
+ --leading-tight: 1.15;
82
+ --leading-snug: 1.3;
83
+ --leading-normal: 1.5;
84
+ --leading-relaxed: 1.625;
85
+ --leading-loose: 2;
86
+
87
+ /* Letter spacing */
88
+ --tracking-tighter: -0.05em;
89
+ --tracking-tight: -0.025em;
90
+ --tracking-normal: 0;
91
+ --tracking-wide: 0.025em;
92
+ --tracking-wider: 0.05em;
93
+ --tracking-widest: 0.1em;
94
+
95
+ /* ===== SPACING SYSTEM ===== */
96
+
97
+ --spacing-*: initial;
98
+
99
+ /* 4px base unit */
100
+ --spacing-0: 0;
101
+ --spacing-px: 1px;
102
+ --spacing-0_5: 0.125rem;
103
+ --spacing-1: 0.25rem;
104
+ --spacing-1_5: 0.375rem;
105
+ --spacing-2: 0.5rem;
106
+ --spacing-2_5: 0.625rem;
107
+ --spacing-3: 0.75rem;
108
+ --spacing-3_5: 0.875rem;
109
+ --spacing-4: 1rem;
110
+ --spacing-5: 1.25rem;
111
+ --spacing-6: 1.5rem;
112
+ --spacing-7: 1.75rem;
113
+ --spacing-8: 2rem;
114
+ --spacing-9: 2.25rem;
115
+ --spacing-10: 2.5rem;
116
+ --spacing-11: 2.75rem;
117
+ --spacing-12: 3rem;
118
+ --spacing-14: 3.5rem;
119
+ --spacing-16: 4rem;
120
+ --spacing-20: 5rem;
121
+ --spacing-24: 6rem;
122
+ --spacing-28: 7rem;
123
+ --spacing-32: 8rem;
124
+ --spacing-36: 9rem;
125
+ --spacing-40: 10rem;
126
+ --spacing-44: 11rem;
127
+ --spacing-48: 12rem;
128
+ --spacing-52: 13rem;
129
+ --spacing-56: 14rem;
130
+ --spacing-60: 15rem;
131
+ --spacing-64: 16rem;
132
+ --spacing-72: 18rem;
133
+ --spacing-80: 20rem;
134
+ --spacing-96: 24rem;
135
+
136
+ /* ===== EFFECTS ===== */
137
+
138
+ --shadow-*: initial;
139
+
140
+ --shadow-xs: 0 1px 2px 0 oklch(0 0 0 / 0.05);
141
+ --shadow-sm: 0 1px 3px 0 oklch(0 0 0 / 0.1), 0 1px 2px -1px oklch(0 0 0 / 0.1);
142
+ --shadow-md: 0 4px 6px -1px oklch(0 0 0 / 0.1), 0 2px 4px -2px oklch(0 0 0 / 0.1);
143
+ --shadow-lg: 0 10px 15px -3px oklch(0 0 0 / 0.1), 0 4px 6px -4px oklch(0 0 0 / 0.1);
144
+ --shadow-xl: 0 20px 25px -5px oklch(0 0 0 / 0.1), 0 8px 10px -6px oklch(0 0 0 / 0.1);
145
+ --shadow-2xl: 0 25px 50px -12px oklch(0 0 0 / 0.25);
146
+ --shadow-inner: inset 0 2px 4px 0 oklch(0 0 0 / 0.05);
147
+
148
+ /* Colored shadows */
149
+ --shadow-brand: 0 4px 14px 0 oklch(0.58 0.2 250 / 0.3);
150
+ --shadow-success: 0 4px 14px 0 oklch(0.6 0.18 145 / 0.3);
151
+ --shadow-error: 0 4px 14px 0 oklch(0.55 0.22 25 / 0.3);
152
+
153
+ --radius-*: initial;
154
+
155
+ --radius-none: 0;
156
+ --radius-sm: 0.125rem;
157
+ --radius-default: 0.25rem;
158
+ --radius-md: 0.375rem;
159
+ --radius-lg: 0.5rem;
160
+ --radius-xl: 0.75rem;
161
+ --radius-2xl: 1rem;
162
+ --radius-3xl: 1.5rem;
163
+ --radius-full: 9999px;
164
+
165
+ /* ===== MOTION ===== */
166
+
167
+ --ease-*: initial;
168
+ --animate-*: initial;
169
+
170
+ --ease-linear: linear;
171
+ --ease-in: cubic-bezier(0.4, 0, 1, 1);
172
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
173
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
174
+ --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
175
+ --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
176
+
177
+ --duration-75: 75ms;
178
+ --duration-100: 100ms;
179
+ --duration-150: 150ms;
180
+ --duration-200: 200ms;
181
+ --duration-300: 300ms;
182
+ --duration-500: 500ms;
183
+ --duration-700: 700ms;
184
+ --duration-1000: 1000ms;
185
+
186
+ /* ===== BREAKPOINTS ===== */
187
+
188
+ --breakpoint-*: initial;
189
+
190
+ --breakpoint-xs: 475px;
191
+ --breakpoint-sm: 640px;
192
+ --breakpoint-md: 768px;
193
+ --breakpoint-lg: 1024px;
194
+ --breakpoint-xl: 1280px;
195
+ --breakpoint-2xl: 1536px;
196
+ --breakpoint-3xl: 1920px;
197
+
198
+ /* ===== Z-INDEX ===== */
199
+
200
+ --z-auto: auto;
201
+ --z-0: 0;
202
+ --z-10: 10;
203
+ --z-20: 20;
204
+ --z-30: 30;
205
+ --z-40: 40;
206
+ --z-50: 50;
207
+ --z-dropdown: 100;
208
+ --z-sticky: 200;
209
+ --z-fixed: 300;
210
+ --z-modal-backdrop: 400;
211
+ --z-modal: 500;
212
+ --z-popover: 600;
213
+ --z-tooltip: 700;
214
+ --z-toast: 800;
215
+ }
216
+ ```
217
+
218
+ ## Dark Mode Design Tokens
219
+
220
+ ### Automatic Dark Mode with CSS Variables
221
+
222
+ ```css
223
+ @import "tailwindcss";
224
+
225
+ @theme {
226
+ /* Light mode tokens (default) */
227
+ --color-surface: oklch(1 0 0);
228
+ --color-surface-raised: oklch(0.98 0 0);
229
+ --color-text: oklch(0.15 0 0);
230
+ --color-text-muted: oklch(0.45 0 0);
231
+ --color-border: oklch(0.9 0 0);
232
+ }
233
+
234
+ /* Dark mode overrides using native CSS */
235
+ @media (prefers-color-scheme: dark) {
236
+ :root {
237
+ --color-surface: oklch(0.12 0.02 260);
238
+ --color-surface-raised: oklch(0.18 0.02 260);
239
+ --color-text: oklch(0.95 0 0);
240
+ --color-text-muted: oklch(0.65 0 0);
241
+ --color-border: oklch(0.28 0.02 260);
242
+ }
243
+ }
244
+
245
+ /* Selector-based dark mode */
246
+ @custom-variant dark (&:where(.dark, .dark *));
247
+
248
+ .dark {
249
+ --color-surface: oklch(0.12 0.02 260);
250
+ --color-surface-raised: oklch(0.18 0.02 260);
251
+ --color-text: oklch(0.95 0 0);
252
+ --color-text-muted: oklch(0.65 0 0);
253
+ --color-border: oklch(0.28 0.02 260);
254
+ }
255
+ ```
256
+
257
+ ### Usage
258
+
259
+ ```html
260
+ <!-- These classes work in both light and dark automatically -->
261
+ <div class="bg-[var(--color-surface)] text-[var(--color-text)]">
262
+ <p class="text-[var(--color-text-muted)]">Muted text</p>
263
+ <div class="border border-[var(--color-border)]">Bordered</div>
264
+ </div>
265
+
266
+ <!-- Or create semantic utility classes -->
267
+ ```
268
+
269
+ ```css
270
+ @utility bg-surface {
271
+ background-color: var(--color-surface);
272
+ }
273
+
274
+ @utility bg-surface-raised {
275
+ background-color: var(--color-surface-raised);
276
+ }
277
+
278
+ @utility text-default {
279
+ color: var(--color-text);
280
+ }
281
+
282
+ @utility text-muted {
283
+ color: var(--color-text-muted);
284
+ }
285
+
286
+ @utility border-default {
287
+ border-color: var(--color-border);
288
+ }
289
+ ```
290
+
291
+ ## Multi-Theme Systems
292
+
293
+ ### Theme Switching with Data Attributes
294
+
295
+ ```css
296
+ @import "tailwindcss";
297
+
298
+ @custom-variant theme-ocean (&:where([data-theme="ocean"], [data-theme="ocean"] *));
299
+ @custom-variant theme-forest (&:where([data-theme="forest"], [data-theme="forest"] *));
300
+ @custom-variant theme-sunset (&:where([data-theme="sunset"], [data-theme="sunset"] *));
301
+
302
+ @theme {
303
+ /* Default theme */
304
+ --color-primary: oklch(0.6 0.2 250);
305
+ --color-secondary: oklch(0.7 0.15 200);
306
+ --color-accent: oklch(0.75 0.18 30);
307
+ }
308
+
309
+ [data-theme="ocean"] {
310
+ --color-primary: oklch(0.55 0.2 220);
311
+ --color-secondary: oklch(0.65 0.15 200);
312
+ --color-accent: oklch(0.7 0.18 180);
313
+ }
314
+
315
+ [data-theme="forest"] {
316
+ --color-primary: oklch(0.5 0.18 145);
317
+ --color-secondary: oklch(0.6 0.12 120);
318
+ --color-accent: oklch(0.75 0.15 85);
319
+ }
320
+
321
+ [data-theme="sunset"] {
322
+ --color-primary: oklch(0.6 0.22 25);
323
+ --color-secondary: oklch(0.7 0.2 45);
324
+ --color-accent: oklch(0.8 0.18 65);
325
+ }
326
+ ```
327
+
328
+ ```html
329
+ <html data-theme="ocean">
330
+ <body>
331
+ <button class="bg-primary theme-forest:bg-primary">
332
+ Uses ocean primary, unless explicitly overridden
333
+ </button>
334
+ </body>
335
+ </html>
336
+ ```
337
+
338
+ ### JavaScript Theme Switcher
339
+
340
+ ```javascript
341
+ const themes = ['default', 'ocean', 'forest', 'sunset'];
342
+
343
+ function setTheme(theme) {
344
+ if (theme === 'default') {
345
+ document.documentElement.removeAttribute('data-theme');
346
+ } else {
347
+ document.documentElement.setAttribute('data-theme', theme);
348
+ }
349
+ localStorage.setItem('theme', theme);
350
+ }
351
+
352
+ function initTheme() {
353
+ const saved = localStorage.getItem('theme') || 'default';
354
+ setTheme(saved);
355
+ }
356
+
357
+ // Theme picker component
358
+ function ThemePicker() {
359
+ return `
360
+ <select onchange="setTheme(this.value)">
361
+ ${themes.map(t => `<option value="${t}">${t}</option>`).join('')}
362
+ </select>
363
+ `;
364
+ }
365
+
366
+ initTheme();
367
+ ```
368
+
369
+ ## Component Token System
370
+
371
+ ### Design Tokens for Components
372
+
373
+ ```css
374
+ @theme {
375
+ /* Button tokens */
376
+ --button-padding-x: var(--spacing-4);
377
+ --button-padding-y: var(--spacing-2);
378
+ --button-radius: var(--radius-lg);
379
+ --button-font-weight: 500;
380
+ --button-transition: all 150ms ease;
381
+
382
+ /* Input tokens */
383
+ --input-padding-x: var(--spacing-3);
384
+ --input-padding-y: var(--spacing-2);
385
+ --input-radius: var(--radius-md);
386
+ --input-border-width: 1px;
387
+ --input-focus-ring-width: 2px;
388
+ --input-focus-ring-offset: 2px;
389
+
390
+ /* Card tokens */
391
+ --card-padding: var(--spacing-6);
392
+ --card-radius: var(--radius-xl);
393
+ --card-shadow: var(--shadow-md);
394
+ --card-border-width: 1px;
395
+
396
+ /* Modal tokens */
397
+ --modal-padding: var(--spacing-6);
398
+ --modal-radius: var(--radius-2xl);
399
+ --modal-max-width: 32rem;
400
+ --modal-backdrop-opacity: 0.5;
401
+ }
402
+ ```
403
+
404
+ ```css
405
+ @layer components {
406
+ .btn {
407
+ padding: var(--button-padding-y) var(--button-padding-x);
408
+ border-radius: var(--button-radius);
409
+ font-weight: var(--button-font-weight);
410
+ transition: var(--button-transition);
411
+ }
412
+
413
+ .input {
414
+ padding: var(--input-padding-y) var(--input-padding-x);
415
+ border-radius: var(--input-radius);
416
+ border-width: var(--input-border-width);
417
+ }
418
+
419
+ .input:focus {
420
+ outline: none;
421
+ ring-width: var(--input-focus-ring-width);
422
+ ring-offset: var(--input-focus-ring-offset);
423
+ }
424
+
425
+ .card {
426
+ padding: var(--card-padding);
427
+ border-radius: var(--card-radius);
428
+ box-shadow: var(--card-shadow);
429
+ border-width: var(--card-border-width);
430
+ }
431
+ }
432
+ ```
433
+
434
+ ## Responsive Design Tokens
435
+
436
+ ### Fluid Typography
437
+
438
+ ```css
439
+ @theme {
440
+ /* Fluid type scale using clamp() */
441
+ --text-fluid-xs: clamp(0.64rem, 0.5rem + 0.5vw, 0.75rem);
442
+ --text-fluid-sm: clamp(0.8rem, 0.7rem + 0.5vw, 0.875rem);
443
+ --text-fluid-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
444
+ --text-fluid-lg: clamp(1.25rem, 1rem + 1vw, 1.5rem);
445
+ --text-fluid-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
446
+ --text-fluid-2xl: clamp(2rem, 1.5rem + 2vw, 3rem);
447
+ --text-fluid-3xl: clamp(2.5rem, 1.8rem + 3vw, 4rem);
448
+ --text-fluid-4xl: clamp(3rem, 2rem + 4vw, 5rem);
449
+ }
450
+
451
+ @utility text-fluid-xs { font-size: var(--text-fluid-xs); }
452
+ @utility text-fluid-sm { font-size: var(--text-fluid-sm); }
453
+ @utility text-fluid-base { font-size: var(--text-fluid-base); }
454
+ @utility text-fluid-lg { font-size: var(--text-fluid-lg); }
455
+ @utility text-fluid-xl { font-size: var(--text-fluid-xl); }
456
+ @utility text-fluid-2xl { font-size: var(--text-fluid-2xl); }
457
+ @utility text-fluid-3xl { font-size: var(--text-fluid-3xl); }
458
+ @utility text-fluid-4xl { font-size: var(--text-fluid-4xl); }
459
+ ```
460
+
461
+ ### Fluid Spacing
462
+
463
+ ```css
464
+ @theme {
465
+ /* Fluid spacing using clamp() */
466
+ --space-fluid-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
467
+ --space-fluid-sm: clamp(0.5rem, 0.4rem + 0.5vw, 1rem);
468
+ --space-fluid-md: clamp(1rem, 0.8rem + 1vw, 2rem);
469
+ --space-fluid-lg: clamp(2rem, 1.5rem + 2vw, 4rem);
470
+ --space-fluid-xl: clamp(4rem, 3rem + 4vw, 8rem);
471
+ --space-fluid-2xl: clamp(6rem, 4rem + 6vw, 12rem);
472
+ }
473
+
474
+ @utility p-fluid-xs { padding: var(--space-fluid-xs); }
475
+ @utility p-fluid-sm { padding: var(--space-fluid-sm); }
476
+ @utility p-fluid-md { padding: var(--space-fluid-md); }
477
+ @utility p-fluid-lg { padding: var(--space-fluid-lg); }
478
+ @utility p-fluid-xl { padding: var(--space-fluid-xl); }
479
+
480
+ @utility gap-fluid-xs { gap: var(--space-fluid-xs); }
481
+ @utility gap-fluid-sm { gap: var(--space-fluid-sm); }
482
+ @utility gap-fluid-md { gap: var(--space-fluid-md); }
483
+ @utility gap-fluid-lg { gap: var(--space-fluid-lg); }
484
+ ```
485
+
486
+ ## Brand Color Generation
487
+
488
+ ### Generating Color Scales from Brand Color
489
+
490
+ ```css
491
+ @theme {
492
+ /* Start with your brand color */
493
+ --brand-hue: 250;
494
+ --brand-chroma: 0.2;
495
+
496
+ /* Generate full scale */
497
+ --color-brand-50: oklch(0.97 calc(var(--brand-chroma) * 0.1) var(--brand-hue));
498
+ --color-brand-100: oklch(0.93 calc(var(--brand-chroma) * 0.2) var(--brand-hue));
499
+ --color-brand-200: oklch(0.87 calc(var(--brand-chroma) * 0.4) var(--brand-hue));
500
+ --color-brand-300: oklch(0.78 calc(var(--brand-chroma) * 0.6) var(--brand-hue));
501
+ --color-brand-400: oklch(0.68 calc(var(--brand-chroma) * 0.8) var(--brand-hue));
502
+ --color-brand-500: oklch(0.58 var(--brand-chroma) var(--brand-hue));
503
+ --color-brand-600: oklch(0.5 var(--brand-chroma) var(--brand-hue));
504
+ --color-brand-700: oklch(0.42 calc(var(--brand-chroma) * 0.9) var(--brand-hue));
505
+ --color-brand-800: oklch(0.35 calc(var(--brand-chroma) * 0.75) var(--brand-hue));
506
+ --color-brand-900: oklch(0.28 calc(var(--brand-chroma) * 0.6) var(--brand-hue));
507
+ --color-brand-950: oklch(0.2 calc(var(--brand-chroma) * 0.4) var(--brand-hue));
508
+ }
509
+ ```
510
+
511
+ ## Monorepo Design System
512
+
513
+ ### Shared Design Tokens Package
514
+
515
+ ```
516
+ packages/
517
+ design-tokens/
518
+ tokens.css
519
+ package.json
520
+ ui-components/
521
+ src/
522
+ package.json
523
+ apps/
524
+ web/
525
+ mobile/
526
+ ```
527
+
528
+ **packages/design-tokens/tokens.css:**
529
+ ```css
530
+ /* Exportable design tokens */
531
+ @theme {
532
+ /* All your design tokens here */
533
+ --color-brand-500: oklch(0.58 0.2 250);
534
+ /* ... */
535
+ }
536
+ ```
537
+
538
+ **packages/design-tokens/package.json:**
539
+ ```json
540
+ {
541
+ "name": "@mycompany/design-tokens",
542
+ "version": "1.0.0",
543
+ "exports": {
544
+ ".": "./tokens.css"
545
+ }
546
+ }
547
+ ```
548
+
549
+ **apps/web/app.css:**
550
+ ```css
551
+ @import "tailwindcss";
552
+ @import "@mycompany/design-tokens";
553
+ ```
554
+
555
+ ## Best Practices
556
+
557
+ ### 1. Use Semantic Naming
558
+
559
+ ```css
560
+ /* Good - Semantic names */
561
+ --color-text-primary
562
+ --color-surface-elevated
563
+ --color-action-primary
564
+
565
+ /* Avoid - Raw values */
566
+ --color-gray-900
567
+ --color-white
568
+ --color-blue-500
569
+ ```
570
+
571
+ ### 2. Document Token Purpose
572
+
573
+ ```css
574
+ @theme {
575
+ /*
576
+ * Surface colors for backgrounds
577
+ * primary: Main page background
578
+ * raised: Cards and elevated elements
579
+ * sunken: Inset areas like inputs
580
+ */
581
+ --color-surface-primary: oklch(1 0 0);
582
+ --color-surface-raised: oklch(0.98 0 0);
583
+ --color-surface-sunken: oklch(0.96 0 0);
584
+ }
585
+ ```
586
+
587
+ ### 3. Create Token Aliases
588
+
589
+ ```css
590
+ @theme {
591
+ /* Base tokens */
592
+ --color-blue-500: oklch(0.58 0.2 250);
593
+
594
+ /* Semantic aliases */
595
+ --color-primary: var(--color-blue-500);
596
+ --color-link: var(--color-blue-500);
597
+ --color-focus-ring: var(--color-blue-500);
598
+ }
599
+ ```
600
+
601
+ ### 4. Version Your Design System
602
+
603
+ Keep design tokens in version control and document changes:
604
+
605
+ ```css
606
+ /*
607
+ * Design System v2.0.0
608
+ * Breaking changes:
609
+ * - Renamed --color-gray-* to --color-neutral-*
610
+ * - Updated primary color to new brand guidelines
611
+ */
612
+ ```