@brainfish-ai/devdoc 0.1.36 → 0.1.38

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.
@@ -0,0 +1,301 @@
1
+ ---
2
+ description: Analyze repository branding and generate custom theme for documentation
3
+ globs: ["**/theme.json", "**/custom.css", "**/tailwind.config.*", "**/*.css", "**/*.scss"]
4
+ ---
5
+
6
+ # Whisk Theme - Brand Analysis & Theme Generation
7
+
8
+ When asked to "whisk theme", "generate theme", "customize branding", or "match brand":
9
+
10
+ ## Step 1: Scan for Brand Colors
11
+
12
+ Search these sources in order of priority:
13
+
14
+ ### 1a. Tailwind Config (highest priority)
15
+ ```javascript
16
+ // tailwind.config.js or tailwind.config.ts
17
+ theme: {
18
+ colors: {
19
+ primary: '#xxx', // → primary
20
+ secondary: '#xxx', // → accent
21
+ brand: '#xxx', // → primary
22
+ }
23
+ }
24
+ ```
25
+
26
+ ### 1b. CSS Variables
27
+ ```css
28
+ /* Look in: globals.css, variables.css, theme.css, app.css */
29
+ :root {
30
+ --primary: #xxx;
31
+ --brand-color: #xxx;
32
+ --accent: #xxx;
33
+ --color-primary: #xxx;
34
+ }
35
+ ```
36
+
37
+ ### 1c. SCSS Variables
38
+ ```scss
39
+ /* Look in: _variables.scss, _colors.scss */
40
+ $primary: #xxx;
41
+ $brand-color: #xxx;
42
+ $accent-color: #xxx;
43
+ ```
44
+
45
+ ### 1d. UI Framework Themes
46
+ ```javascript
47
+ // Chakra UI: theme.js
48
+ colors: { brand: { 500: '#xxx' } }
49
+
50
+ // MUI: theme.js
51
+ palette: { primary: { main: '#xxx' } }
52
+
53
+ // shadcn: globals.css
54
+ --primary: 220 90% 56%;
55
+ ```
56
+
57
+ ### 1e. Package.json / Brand Files
58
+ ```json
59
+ // package.json (rare but check)
60
+ { "brand": { "color": "#xxx" } }
61
+
62
+ // brand.json, colors.json
63
+ { "primary": "#xxx" }
64
+ ```
65
+
66
+ ## Step 2: Scan for Logo
67
+
68
+ Search for logo files:
69
+ ```
70
+ public/logo.svg, public/logo.png
71
+ assets/logo.*, images/logo.*
72
+ src/assets/logo.*
73
+ favicon.svg, favicon.ico
74
+ ```
75
+
76
+ **If SVG logo found:**
77
+ - Extract fill colors as potential brand colors
78
+ - Note path for docs.json update
79
+
80
+ ## Step 3: Scan for Fonts
81
+
82
+ ```javascript
83
+ // tailwind.config.js
84
+ fontFamily: {
85
+ sans: ['CustomFont', ...],
86
+ }
87
+
88
+ // CSS
89
+ --font-family: 'CustomFont';
90
+ font-family: 'CustomFont', sans-serif;
91
+
92
+ // Next.js fonts
93
+ import { Inter } from 'next/font/google'
94
+ ```
95
+
96
+ ## Step 4: Present Findings
97
+
98
+ Show user what was discovered:
99
+
100
+ ```
101
+ 🎨 Brand Analysis Complete
102
+
103
+ Colors detected:
104
+ Primary: #3B82F6 ████ (from tailwind.config.js)
105
+ Secondary: #10B981 ████ (from tailwind.config.js)
106
+
107
+ Logo found:
108
+ public/logo.svg
109
+
110
+ Font detected:
111
+ Inter (from next/font)
112
+
113
+ Apply these to your docs theme?
114
+ 1. **Yes** - Update theme.json and custom.css
115
+ 2. **Customize** - Let me adjust the colors
116
+ 3. **Cancel** - Keep current theme
117
+ ```
118
+
119
+ ## Step 5: Generate Theme Files
120
+
121
+ ### 5a. Update theme.json
122
+
123
+ ```json
124
+ {
125
+ "$schema": "https://devdoc.sh/theme.json",
126
+ "name": "{Product Name} Docs",
127
+ "description": "Custom theme matching {Product Name} branding",
128
+ "colors": {
129
+ "primary": "{detected_primary}",
130
+ "primaryLight": "{lighten_15%}",
131
+ "primaryDark": "{darken_15%}"
132
+ },
133
+ "typography": {
134
+ "fontFamily": "{detected_font}, system-ui, sans-serif",
135
+ "headingFontFamily": "{detected_font}, system-ui, sans-serif",
136
+ "codeFontFamily": "'JetBrains Mono', 'Fira Code', monospace"
137
+ },
138
+ "header": {
139
+ "showSearch": true,
140
+ "showThemeToggle": true,
141
+ "showAskAI": true
142
+ },
143
+ "layout": {
144
+ "sidebarWidth": 280,
145
+ "contentMaxWidth": 768
146
+ },
147
+ "defaultTheme": "system"
148
+ }
149
+ ```
150
+
151
+ ### 5b. Update custom.css with Branded Components
152
+
153
+ Generate comprehensive component styles based on brand:
154
+
155
+ ```css
156
+ /* {Product Name} Documentation Theme */
157
+ /* Generated by DevDoc whisk-theme */
158
+
159
+ /* === 1. CSS Variables === */
160
+ :root {
161
+ --devdoc-primary: {primary};
162
+ --devdoc-primary-light: {primaryLight};
163
+ --devdoc-primary-dark: {primaryDark};
164
+ --devdoc-primary-rgb: {primaryRGB};
165
+ --devdoc-font-family: '{fontFamily}', system-ui, sans-serif;
166
+ --devdoc-code-font-family: 'JetBrains Mono', monospace;
167
+ }
168
+
169
+ /* === 2. Base === */
170
+ * { transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
171
+ ::selection { background-color: var(--devdoc-primary); color: white; }
172
+
173
+ /* === 3. Links === */
174
+ .docs-content a:not([class]) { color: var(--devdoc-primary); text-decoration: underline; }
175
+ .docs-content a:not([class]):hover { color: var(--devdoc-primary-dark); }
176
+
177
+ /* === 4. Navigation === */
178
+ .nav-link:hover { color: var(--devdoc-primary); }
179
+ .nav-link.active { color: var(--devdoc-primary); font-weight: 500; }
180
+ .nav-tab.active { color: var(--devdoc-primary); border-bottom: 2px solid var(--devdoc-primary); }
181
+ .toc-link:hover, .toc-link.active { color: var(--devdoc-primary); }
182
+ .toc-indicator { background-color: var(--devdoc-primary); }
183
+
184
+ /* === 5. Buttons === */
185
+ .btn-primary { background-color: var(--devdoc-primary); color: white; }
186
+ .btn-primary:hover { background-color: var(--devdoc-primary-dark); }
187
+ .btn-secondary { border: 1px solid var(--devdoc-primary); color: var(--devdoc-primary); }
188
+ .btn-secondary:hover { background-color: var(--devdoc-primary); color: white; }
189
+
190
+ /* === 6. Cards === */
191
+ .card:hover { border-color: var(--devdoc-primary); box-shadow: 0 4px 12px rgba(var(--devdoc-primary-rgb), 0.15); }
192
+ .card-icon { color: var(--devdoc-primary); }
193
+
194
+ /* === 7. Callouts === */
195
+ .callout { border-left: 4px solid var(--devdoc-primary); }
196
+ .callout-info { border-left-color: var(--devdoc-primary); }
197
+ .callout-tip { border-left-color: #10b981; }
198
+ .callout-warning { border-left-color: #f59e0b; }
199
+ .callout-danger { border-left-color: #ef4444; }
200
+
201
+ /* === 8. Tabs === */
202
+ .tabs-trigger[data-state="active"] { color: var(--devdoc-primary); border-bottom-color: var(--devdoc-primary); }
203
+ .tabs-trigger:hover { color: var(--devdoc-primary-dark); }
204
+
205
+ /* === 9. Accordions === */
206
+ .accordion-trigger:hover { color: var(--devdoc-primary); }
207
+ .accordion-trigger[data-state="open"] { color: var(--devdoc-primary); }
208
+ .accordion-trigger[data-state="open"] svg { color: var(--devdoc-primary); }
209
+
210
+ /* === 10. Steps === */
211
+ .step-number { background-color: var(--devdoc-primary); color: white; border-radius: 50%; }
212
+ .step-completed .step-connector { background-color: var(--devdoc-primary); }
213
+
214
+ /* === 11. Code === */
215
+ pre code { font-family: var(--devdoc-code-font-family); font-size: 0.875rem; line-height: 1.7; }
216
+ :not(pre) > code { background-color: var(--muted); padding: 0.125rem 0.375rem; border-radius: 0.25rem; }
217
+ .code-block .copy-button:hover { color: var(--devdoc-primary); }
218
+
219
+ /* === 12. Search === */
220
+ .search-input:focus { border-color: var(--devdoc-primary); box-shadow: 0 0 0 2px rgba(var(--devdoc-primary-rgb), 0.2); }
221
+ .search-result-title mark { background-color: rgba(var(--devdoc-primary-rgb), 0.2); color: var(--devdoc-primary-dark); }
222
+
223
+ /* === 13. API Reference === */
224
+ .api-method-get { background-color: #10b981; }
225
+ .api-method-post { background-color: var(--devdoc-primary); }
226
+ .api-method-put { background-color: #f59e0b; }
227
+ .api-method-delete { background-color: #ef4444; }
228
+ .try-it-button { background-color: var(--devdoc-primary); }
229
+ .try-it-button:hover { background-color: var(--devdoc-primary-dark); }
230
+ .schema-property:hover { border-left-color: var(--devdoc-primary); }
231
+
232
+ /* === 14. Features (Product Docs) === */
233
+ .feature-card:hover { border-color: var(--devdoc-primary); }
234
+ .feature-icon { color: var(--devdoc-primary); }
235
+ ```
236
+
237
+ ### 5c. Copy Logo (if found and not already in docs)
238
+
239
+ ```
240
+ 1. Copy logo to docs/public/logo.svg
241
+ 2. If dark variant exists, copy to docs/public/logo-dark.svg
242
+ 3. Update docs.json:
243
+
244
+ {
245
+ "logo": {
246
+ "light": "/logo.svg",
247
+ "dark": "/logo-dark.svg" // or same as light
248
+ }
249
+ }
250
+ ```
251
+
252
+ ## Step 6: Confirm Changes
253
+
254
+ ```
255
+ ✅ Theme updated!
256
+
257
+ Files modified:
258
+ - theme.json (colors, fonts)
259
+ - custom.css (brand variables, styles)
260
+ - docs.json (logo paths)
261
+ - public/logo.svg (copied from source)
262
+
263
+ Preview your docs with `devdoc dev` to see the changes.
264
+ ```
265
+
266
+ ## Color Utilities
267
+
268
+ When generating lighter/darker variants:
269
+
270
+ ```
271
+ Primary: #3B82F6
272
+ → primaryLight: lighten by 15% → #60A5FA
273
+ → primaryDark: darken by 15% → #2563EB
274
+ ```
275
+
276
+ **HSL method (preferred):**
277
+ - Light: increase L by 10-15%
278
+ - Dark: decrease L by 10-15%
279
+
280
+ ## Common Brand Patterns
281
+
282
+ | Framework | Primary Color Location |
283
+ |-----------|----------------------|
284
+ | Tailwind | `theme.colors.primary` or `theme.extend.colors` |
285
+ | Chakra UI | `theme.colors.brand.500` |
286
+ | MUI | `palette.primary.main` |
287
+ | shadcn/ui | `--primary` in HSL format |
288
+ | Bootstrap | `$primary` SCSS variable |
289
+ | Ant Design | `@primary-color` |
290
+
291
+ ## Fallback Defaults
292
+
293
+ If no brand colors detected:
294
+ ```
295
+ Primary: #10b981 (DevDoc green)
296
+ Font: Inter, system-ui, sans-serif
297
+ ```
298
+
299
+ Ask user: "No brand colors found. Would you like to:
300
+ 1. Enter your brand color (hex)
301
+ 2. Use DevDoc defaults"