@brett_lamy/docstream-editor 0.1.0 → 0.3.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.
package/src/styles.css CHANGED
@@ -1 +1,658 @@
1
- /* Editor styles are currently provided by the host app's GitBook theme CSS. */
1
+ /*
2
+ * Editor chrome for the GitBook node views (.gb-* classes emitted by
3
+ * nodes.tsx, Editor.tsx, and slash-menu.tsx).
4
+ *
5
+ * Visual parity contract: every block here mirrors its read-only twin in
6
+ * @brett_lamy/docstream/styles.css (.docs-*) — same radii, spacing, hint
7
+ * palette, and typography — so what authors see in the editor is what
8
+ * readers get from DocsRenderer.
9
+ *
10
+ * Theming: tokens derive from the host's shadcn-style variables when
11
+ * present (--card, --muted, --border, ...) and fall back to neutral hex
12
+ * values, so the editor adapts to light/dark hosts with zero setup.
13
+ * Only broadly-supported CSS is used (no oklch()/color-mix()) so the
14
+ * chrome renders correctly in older Chromium forks too.
15
+ */
16
+
17
+ .gb {
18
+ --gb-panel: var(--card, #ffffff);
19
+ --gb-muted: var(--muted, #f4f4f5);
20
+ --gb-muted-foreground: var(--muted-foreground, #6b7280);
21
+ --gb-border: var(--border, #e5e7eb);
22
+ --gb-accent: var(--accent, #f4f4f5);
23
+ --gb-accent-foreground: var(--accent-foreground, #18181b);
24
+ --gb-primary: var(--primary, #2563eb);
25
+ --gb-text: var(--foreground, #111827);
26
+ --gb-bg: var(--background, #ffffff);
27
+ --gb-code-bg: rgba(128, 128, 128, 0.13);
28
+ --gb-code-fg: var(--foreground, #111827);
29
+ --gb-radius: 12px;
30
+
31
+ /* Semantic hint palette — solid color plus precomputed tints. */
32
+ --gb-info: #3b82f6;
33
+ --gb-info-border: rgba(59, 130, 246, 0.45);
34
+ --gb-info-bg: rgba(59, 130, 246, 0.1);
35
+ --gb-success: #22c55e;
36
+ --gb-success-border: rgba(34, 197, 94, 0.45);
37
+ --gb-success-bg: rgba(34, 197, 94, 0.1);
38
+ --gb-warning: #f59e0b;
39
+ --gb-warning-border: rgba(245, 158, 11, 0.5);
40
+ --gb-warning-bg: rgba(245, 158, 11, 0.12);
41
+ --gb-danger: #ef4444;
42
+ --gb-danger-border: rgba(239, 68, 68, 0.45);
43
+ --gb-danger-bg: rgba(239, 68, 68, 0.1);
44
+
45
+ max-width: 860px;
46
+ margin: 0 auto;
47
+ padding: 16px 24px 120px;
48
+ color: var(--gb-text);
49
+ }
50
+
51
+ /* lucide icon sizing (the node views use size-* utility classes) */
52
+ .gb .size-3 { width: 12px; height: 12px; }
53
+ .gb .size-3\.5 { width: 14px; height: 14px; }
54
+ .gb .size-4 { width: 16px; height: 16px; }
55
+
56
+ /* ── Toolbar ────────────────────────────────────────────── */
57
+ .gb-toolbar {
58
+ position: sticky;
59
+ top: 0;
60
+ z-index: 20;
61
+ display: flex;
62
+ flex-wrap: wrap;
63
+ gap: 2px;
64
+ align-items: center;
65
+ padding: 6px;
66
+ margin-bottom: 18px;
67
+ border: 1px solid var(--gb-border);
68
+ border-radius: var(--gb-radius);
69
+ background: var(--gb-bg);
70
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
71
+ }
72
+
73
+ .gb-tool {
74
+ display: inline-flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ width: 30px;
78
+ height: 30px;
79
+ border: none;
80
+ background: transparent;
81
+ border-radius: 8px;
82
+ color: var(--gb-muted-foreground);
83
+ cursor: pointer;
84
+ }
85
+ .gb-tool:hover { background: var(--gb-accent); color: var(--gb-accent-foreground); }
86
+ .gb-tool-active { background: var(--gb-accent); color: var(--gb-accent-foreground); }
87
+
88
+ .gb-toolbar-sep { width: 1px; height: 18px; background: var(--gb-border); margin: 0 6px; }
89
+
90
+ .gb-toolbar-hint {
91
+ display: inline-flex;
92
+ align-items: center;
93
+ gap: 5px;
94
+ margin-left: auto;
95
+ font-size: 12px;
96
+ color: var(--gb-muted-foreground);
97
+ padding-right: 6px;
98
+ }
99
+ .gb-toolbar-hint kbd {
100
+ border: 1px solid var(--gb-border);
101
+ border-radius: 4px;
102
+ padding: 0 5px;
103
+ font-size: 11px;
104
+ background: var(--gb-muted);
105
+ }
106
+
107
+ /* ── Editing surface typography (mirrors .docs-article) ─── */
108
+ .gb .ProseMirror {
109
+ outline: none;
110
+ min-height: 50vh;
111
+ white-space: pre-wrap;
112
+ word-wrap: break-word;
113
+ line-height: 1.65;
114
+ font-size: 15.5px;
115
+ }
116
+ .gb .ProseMirror > :first-child { margin-top: 0; }
117
+ .gb .ProseMirror > * + * { margin-top: 0.85em; }
118
+ .gb .ProseMirror h1 { font-size: 2.2em; font-weight: 700; margin-top: 0.6em; }
119
+ .gb .ProseMirror h2 {
120
+ font-size: 1.5em;
121
+ font-weight: 650;
122
+ margin-top: 1.4em;
123
+ padding-bottom: 0.2em;
124
+ border-bottom: 1px solid var(--gb-border);
125
+ }
126
+ .gb .ProseMirror h3 { font-size: 1.2em; font-weight: 600; margin-top: 1.1em; }
127
+ .gb .ProseMirror h4,
128
+ .gb .ProseMirror h5,
129
+ .gb .ProseMirror h6 { font-weight: 600; }
130
+ .gb .ProseMirror a { color: var(--gb-primary); text-decoration: underline; }
131
+ .gb .ProseMirror :not(pre) > code {
132
+ background: var(--gb-muted);
133
+ border-radius: 4px;
134
+ padding: 0.15em 0.35em;
135
+ font-size: 0.875em;
136
+ font-family: ui-monospace, Menlo, monospace;
137
+ }
138
+ .gb .ProseMirror ul:not([data-type="taskList"]) { list-style: disc; padding-left: 1.5em; }
139
+ .gb .ProseMirror ol { list-style: decimal; padding-left: 1.5em; }
140
+ .gb .ProseMirror li > p { margin: 0; }
141
+ .gb .ProseMirror ul[data-type="taskList"] { list-style: none; padding-left: 0.2em; }
142
+ .gb .ProseMirror ul[data-type="taskList"] li { display: flex; gap: 8px; }
143
+ .gb .ProseMirror ul[data-type="taskList"] li > label { flex-shrink: 0; margin-top: 3px; user-select: none; }
144
+ .gb .ProseMirror ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
145
+ .gb .ProseMirror ul[data-type="taskList"] li > div > p { margin: 0; }
146
+ .gb .ProseMirror blockquote {
147
+ border-left: 3px solid var(--gb-border);
148
+ padding-left: 1em;
149
+ color: var(--gb-muted-foreground);
150
+ }
151
+ .gb .ProseMirror hr { border: none; border-top: 1px solid var(--gb-border); margin: 2em 0; }
152
+ .gb .ProseMirror p.is-empty:first-child::before {
153
+ content: attr(data-placeholder);
154
+ float: left;
155
+ color: var(--gb-muted-foreground);
156
+ pointer-events: none;
157
+ height: 0;
158
+ }
159
+ .gb .ProseMirror table { border-collapse: collapse; width: 100%; }
160
+ .gb .ProseMirror th,
161
+ .gb .ProseMirror td {
162
+ border: 1px solid var(--gb-border);
163
+ padding: 8px 12px;
164
+ text-align: left;
165
+ vertical-align: top;
166
+ }
167
+ .gb .ProseMirror th { background: var(--gb-muted); font-weight: 600; }
168
+
169
+ /* ── Inline editable fields shared across node views ────── */
170
+ .gb-inline-input {
171
+ background: transparent;
172
+ border: none;
173
+ outline: none;
174
+ font: inherit;
175
+ color: inherit;
176
+ width: auto;
177
+ min-width: 60px;
178
+ }
179
+ .gb-inline-input::placeholder { color: var(--gb-muted-foreground); }
180
+
181
+ .gb-icon-btn {
182
+ display: inline-flex;
183
+ align-items: center;
184
+ justify-content: center;
185
+ border: none;
186
+ background: transparent;
187
+ color: var(--gb-muted-foreground);
188
+ border-radius: 6px;
189
+ padding: 2px;
190
+ cursor: pointer;
191
+ }
192
+ .gb-icon-btn:hover { background: var(--gb-accent); color: var(--gb-accent-foreground); }
193
+
194
+ /* ── Hint / callout (mirrors .docs-hint) ────────────────── */
195
+ .gb-hint {
196
+ display: flex;
197
+ gap: 12px;
198
+ padding: 14px 16px;
199
+ border-radius: var(--gb-radius);
200
+ border: 1px solid var(--gb-border);
201
+ margin: 0.85em 0;
202
+ }
203
+ .gb-hint-gutter {
204
+ display: flex;
205
+ flex-direction: column;
206
+ gap: 4px;
207
+ align-items: center;
208
+ padding-top: 2px;
209
+ flex-shrink: 0;
210
+ }
211
+ .gb-hint-style {
212
+ appearance: none;
213
+ font-size: 10px;
214
+ background: transparent;
215
+ border: 1px solid var(--gb-border);
216
+ border-radius: 4px;
217
+ color: var(--gb-muted-foreground);
218
+ }
219
+ .gb-hint-body { flex: 1; min-width: 0; }
220
+ .gb-hint-body > :first-child { margin-top: 0; }
221
+ .gb-hint-body > :last-child { margin-bottom: 0; }
222
+
223
+ .gb-hint-info { border-color: var(--gb-info-border); background: var(--gb-info-bg); }
224
+ .gb-hint-info .gb-hint-gutter { color: var(--gb-info); }
225
+ .gb-hint-success { border-color: var(--gb-success-border); background: var(--gb-success-bg); }
226
+ .gb-hint-success .gb-hint-gutter { color: var(--gb-success); }
227
+ .gb-hint-warning { border-color: var(--gb-warning-border); background: var(--gb-warning-bg); }
228
+ .gb-hint-warning .gb-hint-gutter { color: var(--gb-warning); }
229
+ .gb-hint-danger { border-color: var(--gb-danger-border); background: var(--gb-danger-bg); }
230
+ .gb-hint-danger .gb-hint-gutter { color: var(--gb-danger); }
231
+
232
+ /* ── Tabs (mirrors .docs-tabs) ──────────────────────────── */
233
+ .gb-tabs {
234
+ border: 1px solid var(--gb-border);
235
+ border-radius: var(--gb-radius);
236
+ margin: 0.85em 0;
237
+ overflow: hidden;
238
+ }
239
+ .gb-tabs-header {
240
+ display: flex;
241
+ gap: 2px;
242
+ padding: 6px 8px 0;
243
+ background: var(--gb-muted);
244
+ border-bottom: 1px solid var(--gb-border);
245
+ }
246
+ .gb-tabs-tab {
247
+ display: inline-flex;
248
+ align-items: center;
249
+ gap: 4px;
250
+ padding: 7px 14px;
251
+ border: none;
252
+ background: transparent;
253
+ border-radius: 8px 8px 0 0;
254
+ font-size: 13.5px;
255
+ cursor: pointer;
256
+ color: var(--gb-muted-foreground);
257
+ }
258
+ .gb-tabs-tab-active {
259
+ background: var(--gb-bg);
260
+ color: var(--gb-text);
261
+ font-weight: 500;
262
+ }
263
+ .gb-tabs-title-input { width: 7ch; font-size: 13px; background: transparent; border: none; outline: none; color: inherit; }
264
+ .gb-tabs-content { padding: 14px 16px; }
265
+
266
+ /* Show only the active tab panel (data-active is the active index). The .gb-tab
267
+ panels sit inside a NodeViewContent wrapper, so use a descendant combinator. */
268
+ .gb-tabs-content .gb-tab { display: none; }
269
+ .gb-tabs-content[data-active="0"] .gb-tab:nth-child(1),
270
+ .gb-tabs-content[data-active="1"] .gb-tab:nth-child(2),
271
+ .gb-tabs-content[data-active="2"] .gb-tab:nth-child(3),
272
+ .gb-tabs-content[data-active="3"] .gb-tab:nth-child(4),
273
+ .gb-tabs-content[data-active="4"] .gb-tab:nth-child(5),
274
+ .gb-tabs-content[data-active="5"] .gb-tab:nth-child(6),
275
+ .gb-tabs-content[data-active="6"] .gb-tab:nth-child(7),
276
+ .gb-tabs-content[data-active="7"] .gb-tab:nth-child(8),
277
+ .gb-tabs-content[data-active="8"] .gb-tab:nth-child(9),
278
+ .gb-tabs-content[data-active="9"] .gb-tab:nth-child(10),
279
+ .gb-tabs-content[data-active="10"] .gb-tab:nth-child(11),
280
+ .gb-tabs-content[data-active="11"] .gb-tab:nth-child(12) {
281
+ display: block;
282
+ }
283
+ .gb-tabs-content .gb-tab > :first-child { margin-top: 0; }
284
+ .gb-tabs-content .gb-tab > :last-child { margin-bottom: 0; }
285
+
286
+ /* ── Expandable (mirrors .docs-expandable) ──────────────── */
287
+ .gb-expandable {
288
+ border: 1px solid var(--gb-border);
289
+ border-radius: var(--gb-radius);
290
+ margin: 0.85em 0;
291
+ overflow: hidden;
292
+ }
293
+ .gb-expandable-summary {
294
+ display: flex;
295
+ align-items: center;
296
+ gap: 8px;
297
+ padding: 12px 16px;
298
+ font-weight: 500;
299
+ }
300
+ .gb-expandable-summary > svg { color: var(--gb-muted-foreground); flex-shrink: 0; }
301
+ .gb-expandable-summary .gb-inline-input { flex: 1; }
302
+ .gb-expandable-body { padding: 0 16px 14px; }
303
+ .gb-expandable-body > :first-child { margin-top: 0; }
304
+ .gb-expandable-body > :last-child { margin-bottom: 0; }
305
+
306
+ /* ── Stepper (mirrors .docs-stepper) ────────────────────── */
307
+ .gb-stepper { margin: 0.85em 0; }
308
+ .gb-step { display: flex; gap: 14px; }
309
+ .gb-step-rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
310
+ .gb-step-badge {
311
+ display: flex;
312
+ align-items: center;
313
+ justify-content: center;
314
+ width: 28px;
315
+ height: 28px;
316
+ border-radius: 999px;
317
+ background: var(--gb-muted);
318
+ border: 1px solid var(--gb-border);
319
+ font-size: 13px;
320
+ font-weight: 600;
321
+ flex-shrink: 0;
322
+ }
323
+ .gb-step-line { width: 1px; flex: 1; background: var(--gb-border); margin: 4px 0; }
324
+ .gb-step-main { flex: 1; min-width: 0; padding-bottom: 20px; }
325
+ .gb-step-title { font-weight: 600; font-size: 15px; width: 100%; margin: 4px 0 6px; }
326
+ .gb-step-body > :first-child { margin-top: 0; }
327
+
328
+ /* ── Embed / content-ref (mirrors .docs-embed/.docs-content-ref) ── */
329
+ .gb-embed { display: flex; flex-direction: column; gap: 6px; margin: 0.85em 0; }
330
+ .gb-embed-frame {
331
+ width: 100%;
332
+ aspect-ratio: 16 / 9;
333
+ border: 1px solid var(--gb-border);
334
+ border-radius: var(--gb-radius);
335
+ }
336
+ .gb-embed .replay-preview {
337
+ width: 100%;
338
+ }
339
+ .gb-embed-link {
340
+ display: flex;
341
+ align-items: center;
342
+ gap: 8px;
343
+ padding: 13px 16px;
344
+ border: 1px solid var(--gb-border);
345
+ border-radius: var(--gb-radius);
346
+ color: var(--gb-primary);
347
+ text-decoration: none;
348
+ }
349
+ .gb-embed-input { font-size: 12px; color: var(--gb-muted-foreground); width: 100%; }
350
+ .gb-content-ref {
351
+ display: flex;
352
+ align-items: center;
353
+ gap: 10px;
354
+ padding: 13px 16px;
355
+ border: 1px solid var(--gb-border);
356
+ border-radius: var(--gb-radius);
357
+ margin: 0.85em 0;
358
+ font-weight: 500;
359
+ }
360
+ .gb-content-ref:hover { background: var(--gb-accent); }
361
+ .gb-content-ref-url {
362
+ font-size: 12px;
363
+ color: var(--gb-muted-foreground);
364
+ font-weight: 400;
365
+ flex: 1;
366
+ }
367
+
368
+ /* ── Columns (mirrors .docs-columns) ────────────────────── */
369
+ .gb-columns { display: flex; gap: 20px; margin: 0.85em 0; }
370
+ .gb-columns > .gb-column,
371
+ .gb-column {
372
+ flex: 1;
373
+ min-width: 0;
374
+ border: 1px dashed var(--gb-border);
375
+ border-radius: var(--gb-radius);
376
+ padding: 10px 14px;
377
+ }
378
+
379
+ /* ── Figure (mirrors .docs-article figure) ──────────────── */
380
+ .gb-figure { margin: 0.85em 0; }
381
+ .gb-figure-img { border-radius: var(--gb-radius); max-width: 100%; }
382
+ .gb-figure-placeholder {
383
+ display: flex;
384
+ align-items: center;
385
+ justify-content: center;
386
+ min-height: 96px;
387
+ border: 1px dashed var(--gb-border);
388
+ border-radius: var(--gb-radius);
389
+ color: var(--gb-muted-foreground);
390
+ }
391
+ .gb-figure-fields { display: flex; gap: 12px; margin-top: 6px; }
392
+ .gb-figure-fields .gb-inline-input { font-size: 12px; color: var(--gb-muted-foreground); flex: 1; }
393
+ .gb-figure-caption {
394
+ text-align: center;
395
+ font-size: 13px;
396
+ color: var(--gb-muted-foreground);
397
+ margin-top: 8px;
398
+ }
399
+ .gb-inline-img-wrap { display: inline-block; vertical-align: middle; }
400
+ .gb-inline-img { display: inline-block; vertical-align: middle; border-radius: 4px; }
401
+
402
+ /* ── Math (mirrors .docs-math) ──────────────────────────── */
403
+ .gb-math {
404
+ display: flex;
405
+ gap: 10px;
406
+ align-items: flex-start;
407
+ border: 1px solid var(--gb-border);
408
+ border-radius: var(--gb-radius);
409
+ padding: 14px 16px;
410
+ margin: 0.85em 0;
411
+ background: var(--gb-muted);
412
+ }
413
+ .gb-math-label {
414
+ font-size: 10px;
415
+ font-weight: 700;
416
+ color: var(--gb-muted-foreground);
417
+ border: 1px solid var(--gb-border);
418
+ border-radius: 4px;
419
+ padding: 1px 5px;
420
+ margin-top: 3px;
421
+ text-transform: uppercase;
422
+ }
423
+ .gb-math-input {
424
+ flex: 1;
425
+ background: transparent;
426
+ border: none;
427
+ outline: none;
428
+ resize: vertical;
429
+ font-family: ui-monospace, Menlo, monospace;
430
+ font-size: 13.5px;
431
+ }
432
+ .gb-math-formula {
433
+ flex: 1;
434
+ font-family: ui-monospace, Menlo, monospace;
435
+ font-size: 13.5px;
436
+ white-space: pre-wrap;
437
+ }
438
+
439
+ /* ── Code block (mirrors .docs-code) ────────────────────── */
440
+ .gb-code {
441
+ border: 1px solid var(--gb-border);
442
+ border-radius: var(--gb-radius);
443
+ margin: 0.85em 0;
444
+ overflow: hidden;
445
+ }
446
+ .gb-code-header {
447
+ display: flex;
448
+ align-items: center;
449
+ gap: 10px;
450
+ padding: 7px 14px;
451
+ background: var(--gb-muted);
452
+ border-bottom: 1px solid var(--gb-border);
453
+ font-size: 12.5px;
454
+ }
455
+ .gb-code-title { font-weight: 500; }
456
+ .gb-code-lang {
457
+ margin-left: auto;
458
+ color: var(--gb-muted-foreground);
459
+ width: 70px;
460
+ text-align: right;
461
+ font-weight: 400;
462
+ }
463
+ .gb-code-linenos {
464
+ display: flex;
465
+ gap: 4px;
466
+ align-items: center;
467
+ color: var(--gb-muted-foreground);
468
+ font-size: 11px;
469
+ }
470
+ .gb-code pre {
471
+ margin: 0;
472
+ padding: 13px 15px;
473
+ overflow-x: auto;
474
+ font-family: ui-monospace, Menlo, monospace;
475
+ font-size: 13px;
476
+ line-height: 1.55;
477
+ background: var(--gb-code-bg);
478
+ color: var(--gb-code-fg);
479
+ }
480
+ .gb-code pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
481
+ .gb-code pre code .hljs-comment { font-style: italic; }
482
+
483
+ /* ── Updates / changelog (mirrors .docs-updates) ────────── */
484
+ .gb-updates { margin: 0.85em 0; border-top: 1px solid var(--gb-border); }
485
+ .gb-update { display: flex; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--gb-border); }
486
+ .gb-update-date {
487
+ width: 130px;
488
+ flex-shrink: 0;
489
+ font-size: 13px;
490
+ color: var(--gb-muted-foreground);
491
+ padding-top: 6px;
492
+ }
493
+ .gb-update-body { flex: 1; min-width: 0; }
494
+ .gb-update-body > :first-child { margin-top: 0; }
495
+
496
+ /* ── OpenAPI operation ──────────────────────────────────── */
497
+ .gb-openapi { margin: 0.85em 0; }
498
+ .gb-openapi-fields {
499
+ display: flex;
500
+ gap: 10px;
501
+ padding: 8px 12px;
502
+ border: 1px dashed var(--gb-border);
503
+ border-radius: 8px 8px 0 0;
504
+ font-size: 12px;
505
+ }
506
+ .gb-openapi-fields .gb-inline-input { color: var(--gb-muted-foreground); }
507
+ .gb-openapi-path { min-width: 110px; font-family: ui-monospace, Menlo, monospace; }
508
+ .gb-openapi-url { flex: 1; }
509
+
510
+ /* ── Slash menu ─────────────────────────────────────────── */
511
+ .slash-menu {
512
+ z-index: 100;
513
+ min-width: 230px;
514
+ max-height: 320px;
515
+ overflow-y: auto;
516
+ background: var(--popover, #ffffff);
517
+ color: var(--popover-foreground, #111827);
518
+ border: 1px solid var(--border, #e5e7eb);
519
+ border-radius: 12px;
520
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
521
+ padding: 5px;
522
+ }
523
+ .slash-item {
524
+ display: flex;
525
+ align-items: center;
526
+ gap: 10px;
527
+ width: 100%;
528
+ padding: 7px 10px;
529
+ border: none;
530
+ background: transparent;
531
+ border-radius: 7px;
532
+ font-size: 13.5px;
533
+ text-align: left;
534
+ cursor: pointer;
535
+ color: inherit;
536
+ }
537
+ .slash-item:hover,
538
+ .slash-item-active { background: var(--accent, #f4f4f5); }
539
+ .slash-item svg { color: var(--muted-foreground, #6b7280); }
540
+ .slash-empty { padding: 8px 10px; font-size: 13px; color: var(--muted-foreground, #6b7280); }
541
+
542
+ .gb-code-live {
543
+ display: flex;
544
+ align-items: center;
545
+ gap: 4px;
546
+ color: var(--gb-muted-foreground);
547
+ font-size: 11px;
548
+ }
549
+ .gb-code-entry { flex: 1; min-width: 130px; }
550
+ .gb-code-live-badge {
551
+ border: 1px solid var(--gb-success-border, rgba(34, 197, 94, 0.45));
552
+ border-radius: 999px;
553
+ padding: 2px 6px;
554
+ color: var(--gb-success, #22c55e);
555
+ font-size: 10px;
556
+ text-transform: uppercase;
557
+ letter-spacing: 0.06em;
558
+ }
559
+
560
+ .gb-react-demo-editor {
561
+ overflow: hidden;
562
+ border: 1px solid var(--gb-border, var(--border));
563
+ border-radius: 12px;
564
+ background: var(--gb-panel, var(--card));
565
+ }
566
+ .gb-react-demo-editor-source {
567
+ display: grid;
568
+ grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr);
569
+ min-height: 260px;
570
+ }
571
+ .gb-react-demo-files {
572
+ border-right: 1px solid var(--gb-border, var(--border));
573
+ background: var(--gb-muted, var(--muted));
574
+ }
575
+ .gb-react-demo-files-header,
576
+ .gb-react-demo-editor-toolbar {
577
+ display: flex;
578
+ align-items: center;
579
+ gap: 8px;
580
+ min-height: 40px;
581
+ padding: 8px 10px;
582
+ border-bottom: 1px solid var(--gb-border, var(--border));
583
+ font-size: 12px;
584
+ }
585
+ .gb-react-demo-files-header svg {
586
+ margin-left: auto;
587
+ color: var(--gb-muted-foreground, var(--muted-foreground));
588
+ }
589
+ .gb-react-demo-file {
590
+ display: block;
591
+ width: 100%;
592
+ padding: 8px 10px;
593
+ overflow: hidden;
594
+ color: var(--gb-muted-foreground, var(--muted-foreground));
595
+ font-family: ui-monospace, Menlo, monospace;
596
+ font-size: 11px;
597
+ text-align: left;
598
+ text-overflow: ellipsis;
599
+ white-space: nowrap;
600
+ }
601
+ .gb-react-demo-file-active {
602
+ color: var(--gb-panel-foreground, var(--foreground));
603
+ background: var(--gb-panel, var(--card));
604
+ }
605
+ .gb-react-demo-editor-pane {
606
+ display: flex;
607
+ min-width: 0;
608
+ flex-direction: column;
609
+ }
610
+ .gb-react-demo-editor-toolbar code {
611
+ overflow: hidden;
612
+ color: var(--gb-muted-foreground, var(--muted-foreground));
613
+ text-overflow: ellipsis;
614
+ white-space: nowrap;
615
+ }
616
+ .gb-react-demo-preview-button {
617
+ display: inline-flex;
618
+ align-items: center;
619
+ gap: 5px;
620
+ margin-left: auto;
621
+ border: 1px solid var(--gb-border, var(--border));
622
+ border-radius: 6px;
623
+ padding: 4px 8px;
624
+ color: var(--gb-panel-foreground, var(--foreground));
625
+ font-size: 11px;
626
+ }
627
+ .gb-react-demo-preview-button:disabled { opacity: 0.5; }
628
+ .gb-react-demo-textarea {
629
+ flex: 1;
630
+ width: 100%;
631
+ min-height: 220px;
632
+ resize: vertical;
633
+ border: 0;
634
+ padding: 14px;
635
+ outline: none;
636
+ color: var(--gb-panel-foreground, var(--foreground));
637
+ background: var(--gb-panel, var(--card));
638
+ font-family: ui-monospace, Menlo, monospace;
639
+ font-size: 12px;
640
+ line-height: 1.6;
641
+ }
642
+ .gb-react-demo-editor-empty {
643
+ padding: 18px;
644
+ color: var(--gb-muted-foreground, var(--muted-foreground));
645
+ font-size: 12px;
646
+ text-align: center;
647
+ }
648
+ @media (max-width: 640px) {
649
+ .gb-react-demo-editor-source { grid-template-columns: 1fr; }
650
+ .gb-react-demo-files {
651
+ display: flex;
652
+ overflow-x: auto;
653
+ border-right: 0;
654
+ border-bottom: 1px solid var(--gb-border, var(--border));
655
+ }
656
+ .gb-react-demo-files-header { flex: 0 0 auto; border-bottom: 0; }
657
+ .gb-react-demo-file { width: auto; flex: 0 0 auto; }
658
+ }