@mr.dj2u/knowledge 0.1.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 (83) hide show
  1. package/dist/content/checklists/ship-test-loop.md +16 -0
  2. package/dist/content/checklists/unified-agent-bundle-validation.md +8 -0
  3. package/dist/content/examples/ship-test-loop.md +13 -0
  4. package/dist/content/examples/unified-agent-bundle-bootstrap.md +8 -0
  5. package/dist/content/guides/animation-performance.md +30 -0
  6. package/dist/content/guides/post-create-onboarding.md +113 -0
  7. package/dist/content/patterns/api/api-routes.md +314 -0
  8. package/dist/content/patterns/api/error-handling.md +311 -0
  9. package/dist/content/patterns/database/drizzle-schema.md +280 -0
  10. package/dist/content/patterns/database/migrations.md +365 -0
  11. package/dist/content/patterns/database/query-organization.md +537 -0
  12. package/dist/content/patterns/database/relations.md +450 -0
  13. package/dist/content/patterns/deployment/build-configuration.md +452 -0
  14. package/dist/content/patterns/deployment/ci-cd-patterns.md +448 -0
  15. package/dist/content/patterns/deployment/environment-config.md +380 -0
  16. package/dist/content/patterns/deployment/hosting-setup.md +425 -0
  17. package/dist/content/patterns/project/configuration-patterns.md +459 -0
  18. package/dist/content/patterns/project/documentation-org.md +506 -0
  19. package/dist/content/patterns/project/folder-structure.md +398 -0
  20. package/dist/content/patterns/project/library-exports.md +465 -0
  21. package/dist/content/patterns/project/monorepo-structure.md +500 -0
  22. package/dist/content/patterns/routing/dynamic-routes.md +221 -0
  23. package/dist/content/patterns/routing/file-based-routing.md +186 -0
  24. package/dist/content/patterns/routing/route-groups.md +429 -0
  25. package/dist/content/patterns/state/persistence-middleware.md +521 -0
  26. package/dist/content/patterns/state/selector-hooks.md +538 -0
  27. package/dist/content/patterns/state/store-organization.md +539 -0
  28. package/dist/content/patterns/state/zustand-patterns.md +348 -0
  29. package/dist/content/patterns/styling/component-styling.md +468 -0
  30. package/dist/content/patterns/styling/responsive-patterns.md +398 -0
  31. package/dist/content/patterns/styling/theme-configuration.md +426 -0
  32. package/dist/content/patterns/styling/uniwind-setup.md +412 -0
  33. package/dist/content/prompts/continue-development.md +27 -0
  34. package/dist/content/prompts/create-expo-super-stack.md +29 -0
  35. package/dist/content/prompts/fix-seo.md +29 -0
  36. package/dist/content/prompts/onboard-new-expo-app.md +11 -0
  37. package/dist/content/prompts/prepare-deploy.md +29 -0
  38. package/dist/content/prompts/project-research-plan.md +29 -0
  39. package/dist/content/prompts/review-expo-project.md +29 -0
  40. package/dist/content/prompts/run-doctor.md +30 -0
  41. package/dist/content/prompts/ship-test-loop.md +24 -0
  42. package/dist/content/reference/create-expo-stack-uniwind.md +29 -0
  43. package/dist/content/reference/doctor-dogfood.md +42 -0
  44. package/dist/content/reference/mcp-sdk-transport.md +30 -0
  45. package/dist/content/reference/package-ci-patterns.md +24 -0
  46. package/dist/content/reference/reference-repo-evacuation.md +31 -0
  47. package/dist/content/resource-index.json +67 -0
  48. package/dist/content/rules/app-folder-architecture.md +13 -0
  49. package/dist/content/rules/env-hygiene.md +9 -0
  50. package/dist/content/rules/seo-metadata.md +7 -0
  51. package/dist/content/rules/ssr-safety.md +9 -0
  52. package/dist/content/skills/api-routes.md +33 -0
  53. package/dist/content/skills/continue-development.md +31 -0
  54. package/dist/content/skills/debugging.md +31 -0
  55. package/dist/content/skills/deployment.md +32 -0
  56. package/dist/content/skills/dev-server-management.md +31 -0
  57. package/dist/content/skills/env-vars.md +32 -0
  58. package/dist/content/skills/expo-router-architecture.md +33 -0
  59. package/dist/content/skills/expo-ssr-safety.md +32 -0
  60. package/dist/content/skills/plugin-creation.md +41 -0
  61. package/dist/content/skills/production-server-patterns.md +31 -0
  62. package/dist/content/skills/project-onboarding.md +31 -0
  63. package/dist/content/skills/research-plan-intake.md +31 -0
  64. package/dist/content/skills/seo-metadata.md +31 -0
  65. package/dist/content/skills/super-stack-startup.md +31 -0
  66. package/dist/content/skills/uniwind-theming.md +32 -0
  67. package/dist/index.d.ts +46 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +369 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/patterns/index.d.ts +78 -0
  72. package/dist/patterns/index.d.ts.map +1 -0
  73. package/dist/patterns/index.js +264 -0
  74. package/dist/patterns/index.js.map +1 -0
  75. package/dist/prompts/index.d.ts +35 -0
  76. package/dist/prompts/index.d.ts.map +1 -0
  77. package/dist/prompts/index.js +270 -0
  78. package/dist/prompts/index.js.map +1 -0
  79. package/dist/skills/index.d.ts +3 -0
  80. package/dist/skills/index.d.ts.map +1 -0
  81. package/dist/skills/index.js +2 -0
  82. package/dist/skills/index.js.map +1 -0
  83. package/package.json +50 -0
@@ -0,0 +1,426 @@
1
+ # Theme Configuration & CSS Variables
2
+
3
+ ## Description
4
+
5
+ Theme configuration manages design tokens (colors, spacing, typography) through CSS variables in global.css with light/dark mode variants. Components reference tokens via `var(--color-primary)` syntax, enabling runtime theme switching without provider components or prop drilling.
6
+
7
+ ## When to Use
8
+
9
+ **Use CSS variable theming** for:
10
+ - ✅ Dynamic light/dark mode support
11
+ - ✅ Brand color customization
12
+ - ✅ Consistent spacing scales
13
+ - ✅ Typography system with multiple styles
14
+ - ✅ Cross-platform (iOS, Android, Web) theme support
15
+
16
+ ## Code Example
17
+
18
+ ### Complete Theme System
19
+
20
+ ```css
21
+ /* File: src/global.css */
22
+ @import 'tailwindcss';
23
+ @import 'uniwind';
24
+
25
+ @layer theme {
26
+ :root {
27
+ /* ===== LIGHT MODE (DEFAULT) ===== */
28
+ @variant light {
29
+ /* Primary color palette (Red - brand color) */
30
+ --color-primary: #ef5350;
31
+ --color-primary-50: #ffebee;
32
+ --color-primary-100: #ffcdd2;
33
+ --color-primary-200: #ef9a9a;
34
+ --color-primary-300: #e57373;
35
+ --color-primary-400: #ef5350;
36
+ --color-primary-500: #ef5350;
37
+ --color-primary-600: #e53935;
38
+ --color-primary-700: #c62828;
39
+ --color-primary-800: #b71c1c;
40
+ --color-primary-900: #b71c1c;
41
+
42
+ /* Secondary color palette (Blue - accent) */
43
+ --color-secondary: #29b6f6;
44
+ --color-secondary-50: #e1f5fe;
45
+ --color-secondary-100: #b3e5fc;
46
+ --color-secondary-500: #29b6f6;
47
+ --color-secondary-700: #0277bd;
48
+ --color-secondary-900: #01579b;
49
+
50
+ /* Background surfaces */
51
+ --color-background: #fafafa; /* Main background */
52
+ --color-surface: #ffffff; /* Card/surface background */
53
+ --color-surface-2: #f5f5f5; /* Secondary surface */
54
+ --color-surface-3: #eeeeee; /* Tertiary surface */
55
+
56
+ /* Text colors */
57
+ --color-typography: #212121; /* Primary text */
58
+ --color-typography-60: #666666; /* Secondary text (60% opacity) */
59
+ --color-typography-38: #9e9e9e; /* Tertiary text (38% opacity) */
60
+
61
+ /* UI elements */
62
+ --color-border: #e0e0e0; /* Border color */
63
+ --color-divider: #bdbdbd; /* Divider lines */
64
+ --color-disabled: #bdbdbd; /* Disabled state */
65
+ --color-focus-ring: #2196f3; /* Focus indicator */
66
+
67
+ /* Status colors */
68
+ --color-success: #4caf50;
69
+ --color-warning: #ff9800;
70
+ --color-error: #f44336;
71
+ --color-info: #2196f3;
72
+
73
+ /* Semantic colors */
74
+ --color-link: #1976d2;
75
+ --color-link-visited: #7b1fa2;
76
+ }
77
+
78
+ /* ===== DARK MODE ===== */
79
+ @variant dark {
80
+ /* Primary color palette (adjusted for dark) */
81
+ --color-primary: #ef5350;
82
+ --color-primary-50: #ffebee;
83
+ --color-primary-100: #ffcdd2;
84
+ --color-primary-200: #ef9a9a;
85
+ --color-primary-300: #e57373;
86
+ --color-primary-400: #ef5350;
87
+ --color-primary-500: #ef5350;
88
+ --color-primary-600: #e53935;
89
+ --color-primary-700: #d32f2f;
90
+ --color-primary-800: #c62828;
91
+ --color-primary-900: #b71c1c;
92
+
93
+ /* Secondary color palette (lighter for dark) */
94
+ --color-secondary: #4fc3f7;
95
+ --color-secondary-50: #e0f2f1;
96
+ --color-secondary-100: #b2dfdb;
97
+ --color-secondary-500: #4fc3f7;
98
+ --color-secondary-700: #0288d1;
99
+ --color-secondary-900: #01579b;
100
+
101
+ /* Background surfaces (dark) */
102
+ --color-background: #121212; /* Main dark background */
103
+ --color-surface: #1e1e1e; /* Card/surface in dark */
104
+ --color-surface-2: #272727; /* Secondary surface */
105
+ --color-surface-3: #303030; /* Tertiary surface */
106
+
107
+ /* Text colors (light for dark mode) */
108
+ --color-typography: #ffffff; /* Primary text */
109
+ --color-typography-60: #b3b3b3; /* Secondary text (60% opacity) */
110
+ --color-typography-38: #808080; /* Tertiary text (38% opacity) */
111
+
112
+ /* UI elements (dark mode) */
113
+ --color-border: #424242;
114
+ --color-divider: #616161;
115
+ --color-disabled: #616161;
116
+ --color-focus-ring: #42a5f5;
117
+
118
+ /* Status colors (dark mode) */
119
+ --color-success: #66bb6a;
120
+ --color-warning: #ffb74d;
121
+ --color-error: #ef5350;
122
+ --color-info: #64b5f6;
123
+
124
+ /* Semantic colors */
125
+ --color-link: #64b5f6;
126
+ --color-link-visited: #ce93d8;
127
+ }
128
+
129
+ /* ===== SPACING SCALE ===== */
130
+ --spacing-0: 0px;
131
+ --spacing-1: 4px;
132
+ --spacing-2: 8px;
133
+ --spacing-3: 12px;
134
+ --spacing-4: 16px;
135
+ --spacing-5: 20px;
136
+ --spacing-6: 24px;
137
+ --spacing-8: 32px;
138
+ --spacing-10: 40px;
139
+ --spacing-12: 48px;
140
+ --spacing-16: 64px;
141
+
142
+ /* ===== TYPOGRAPHY ===== */
143
+ --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
144
+ --font-mono: 'RobotoMono', 'Monaco', monospace;
145
+ --font-display: 'Modak', 'Georgia', serif;
146
+
147
+ /* Font sizes */
148
+ --text-xs: 12px;
149
+ --text-sm: 14px;
150
+ --text-base: 16px;
151
+ --text-lg: 18px;
152
+ --text-xl: 20px;
153
+ --text-2xl: 24px;
154
+ --text-3xl: 30px;
155
+ --text-4xl: 36px;
156
+
157
+ /* Line heights */
158
+ --line-height-tight: 1.2;
159
+ --line-height-normal: 1.5;
160
+ --line-height-relaxed: 1.75;
161
+
162
+ /* Letter spacing */
163
+ --tracking-tighter: -0.05em;
164
+ --tracking-tight: -0.025em;
165
+ --tracking-normal: 0em;
166
+ --tracking-wide: 0.025em;
167
+ --tracking-wider: 0.05em;
168
+
169
+ /* ===== SHADOWS ===== */
170
+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
171
+ --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
172
+ --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
173
+ --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.2);
174
+
175
+ /* ===== BORDER RADIUS ===== */
176
+ --radius-none: 0px;
177
+ --radius-sm: 4px;
178
+ --radius-md: 8px;
179
+ --radius-lg: 12px;
180
+ --radius-xl: 16px;
181
+ --radius-2xl: 24px;
182
+ --radius-full: 9999px;
183
+
184
+ /* ===== BREAKPOINTS ===== */
185
+ --breakpoint-xs: 320px;
186
+ --breakpoint-sm: 640px;
187
+ --breakpoint-md: 768px;
188
+ --breakpoint-lg: 1024px;
189
+ --breakpoint-xl: 1280px;
190
+ --breakpoint-2xl: 1536px;
191
+ }
192
+ }
193
+
194
+ /* ===== TYPOGRAPHY UTILITIES ===== */
195
+ @layer utilities {
196
+ /* Header styles */
197
+ .typography-header {
198
+ @apply text-4xl font-bold;
199
+ font-family: var(--font-display);
200
+ letter-spacing: var(--tracking-wide);
201
+ line-height: var(--line-height-tight);
202
+ }
203
+
204
+ .typography-subheader {
205
+ @apply text-2xl font-bold;
206
+ font-family: var(--font-sans);
207
+ line-height: var(--line-height-tight);
208
+ }
209
+
210
+ .typography-title {
211
+ @apply text-xl font-semibold;
212
+ font-family: var(--font-sans);
213
+ }
214
+
215
+ /* Body text styles */
216
+ .typography-body {
217
+ @apply text-base;
218
+ font-family: var(--font-sans);
219
+ line-height: var(--line-height-normal);
220
+ color: var(--color-typography);
221
+ }
222
+
223
+ .typography-body-small {
224
+ @apply text-sm;
225
+ font-family: var(--font-sans);
226
+ line-height: var(--line-height-normal);
227
+ }
228
+
229
+ .typography-caption {
230
+ @apply text-xs;
231
+ font-family: var(--font-sans);
232
+ color: var(--color-typography-60);
233
+ line-height: var(--line-height-normal);
234
+ }
235
+
236
+ .typography-overline {
237
+ @apply text-xs font-semibold uppercase;
238
+ font-family: var(--font-sans);
239
+ letter-spacing: var(--tracking-wide);
240
+ }
241
+
242
+ /* Monospace styles */
243
+ .typography-code {
244
+ font-family: var(--font-mono);
245
+ @apply text-sm;
246
+ background-color: var(--color-surface-2);
247
+ color: var(--color-primary);
248
+ }
249
+
250
+ /* Text utilities */
251
+ .text-primary { color: var(--color-primary); }
252
+ .text-secondary { color: var(--color-secondary); }
253
+ .text-typography { color: var(--color-typography); }
254
+ .text-typography-60 { color: var(--color-typography-60); }
255
+ .text-typography-38 { color: var(--color-typography-38); }
256
+
257
+ /* Background utilities */
258
+ .bg-primary { background-color: var(--color-primary); }
259
+ .bg-secondary { background-color: var(--color-secondary); }
260
+ .bg-surface { background-color: var(--color-surface); }
261
+ .bg-surface-2 { background-color: var(--color-surface-2); }
262
+
263
+ /* Border utilities */
264
+ .border-primary { border-color: var(--color-primary); }
265
+ .border-secondary { border-color: var(--color-secondary); }
266
+ .border-default { border-color: var(--color-border); }
267
+
268
+ /* Spacing utilities */
269
+ .p-safe { padding-bottom: env(safe-area-inset-bottom); }
270
+ }
271
+
272
+ /* ===== GLOBAL RESET ===== */
273
+ @layer base {
274
+ * {
275
+ @apply margin-0 padding-0;
276
+ box-sizing: border-box;
277
+ }
278
+
279
+ body {
280
+ @apply bg-[var(--color-background)] text-[var(--color-typography)];
281
+ font-family: var(--font-sans);
282
+ -webkit-font-smoothing: antialiased;
283
+ -moz-osx-font-smoothing: grayscale;
284
+ }
285
+ }
286
+ ```
287
+
288
+ **From:** DJsPortfolio/global.css, expo-super-template/global.css
289
+
290
+ ### Component Theme Usage
291
+
292
+ ```typescript
293
+ // File: src/components/Card.tsx
294
+ import { View, Text } from 'react-native';
295
+
296
+ interface CardProps {
297
+ title: string;
298
+ description: string;
299
+ }
300
+
301
+ export function Card({ title, description }: CardProps) {
302
+ return (
303
+ <View className="bg-[var(--color-surface)] rounded-[var(--radius-lg)] p-4 border border-[var(--color-border)]">
304
+ <Text className="typography-title text-[var(--color-typography)]">
305
+ {title}
306
+ </Text>
307
+ <Text className="typography-body text-[var(--color-typography-60)] mt-2">
308
+ {description}
309
+ </Text>
310
+ </View>
311
+ );
312
+ }
313
+ ```
314
+
315
+ ## Configuration
316
+
317
+ ### Tailwind Config Integration
318
+
319
+ ```javascript
320
+ // File: tailwind.config.js
321
+ module.exports = {
322
+ content: ['./src/**/*.{ts,tsx}'],
323
+ theme: {
324
+ colors: {
325
+ transparent: 'transparent',
326
+ current: 'currentColor',
327
+ inherit: 'inherit',
328
+
329
+ // Use CSS variables
330
+ primary: 'var(--color-primary)',
331
+ secondary: 'var(--color-secondary)',
332
+ background: 'var(--color-background)',
333
+ surface: 'var(--color-surface)',
334
+ typography: 'var(--color-typography)',
335
+ border: 'var(--color-border)',
336
+
337
+ success: 'var(--color-success)',
338
+ warning: 'var(--color-warning)',
339
+ error: 'var(--color-error)',
340
+ info: 'var(--color-info)',
341
+ },
342
+ spacing: {
343
+ 0: 'var(--spacing-0)',
344
+ 1: 'var(--spacing-1)',
345
+ 2: 'var(--spacing-2)',
346
+ 3: 'var(--spacing-3)',
347
+ 4: 'var(--spacing-4)',
348
+ 6: 'var(--spacing-6)',
349
+ 8: 'var(--spacing-8)',
350
+ },
351
+ fontSize: {
352
+ xs: 'var(--text-xs)',
353
+ sm: 'var(--text-sm)',
354
+ base: 'var(--text-base)',
355
+ lg: 'var(--text-lg)',
356
+ xl: 'var(--text-xl)',
357
+ },
358
+ },
359
+ };
360
+ ```
361
+
362
+ ## Best Practices
363
+
364
+ ### ✅ DO
365
+
366
+ 1. **Organize tokens by semantic purpose**
367
+ ```css
368
+ --color-primary: /* Brand color */
369
+ --color-success: /* Action success */
370
+ --color-error: /* Action error */
371
+ --color-typography: /* Primary text */
372
+ ```
373
+
374
+ 2. **Use `@variant dark`** for dark mode support
375
+ ```css
376
+ @variant dark {
377
+ --color-background: #121212;
378
+ --color-typography: #ffffff;
379
+ }
380
+ ```
381
+
382
+ 3. **Include multiple shades** for each color
383
+ ```css
384
+ --color-primary-50: #ffebee;
385
+ --color-primary-100: #ffcdd2;
386
+ --color-primary-500: #ef5350;
387
+ --color-primary-900: #b71c1c;
388
+ ```
389
+
390
+ 4. **Reference variables in components**
391
+ ```tsx
392
+ <View className="bg-[var(--color-primary)]" />
393
+ ```
394
+
395
+ ### ❌ DON'T
396
+
397
+ 1. **Don't hardcode colors** in components
398
+ ```tsx
399
+ // ❌ BAD
400
+ <View className="bg-red-500" />
401
+
402
+ // ✅ GOOD
403
+ <View className="bg-[var(--color-primary)]" />
404
+ ```
405
+
406
+ 2. **Don't duplicate theme values**
407
+ ```css
408
+ /* ❌ BAD - define once */
409
+ --color-error: #f44336;
410
+ --alert-background: #f44336; /* duplicate */
411
+
412
+ /* ✅ GOOD - reference */
413
+ --color-error: #f44336;
414
+ --alert-background: var(--color-error);
415
+ ```
416
+
417
+ ## Related Patterns
418
+
419
+ - [Uniwind Setup](./uniwind-setup.md) — Basic Uniwind configuration
420
+ - [Responsive Patterns](./responsive-patterns.md) — Mobile-first responsive design
421
+ - [Component Styling](./component-styling.md) — Component-specific styling
422
+
423
+ ---
424
+
425
+ *Pattern extracted from production repositories: DJsPortfolio, expo-super-template, PokePages*
426
+ *Files: DJsPortfolio/global.css, expo-super-template/global.css*