executable-stories-demo 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.
@@ -0,0 +1,588 @@
1
+ /*
2
+ * Shared structural styles for every theme. Theme files override the
3
+ * --demo-* tokens; this file only defines the scale, landing-page layout,
4
+ * and Starlight hooks that are safe to share.
5
+ */
6
+
7
+ :root {
8
+ --sl-content-width: 76rem;
9
+
10
+ --demo-space-1: 0.25rem;
11
+ --demo-space-2: 0.5rem;
12
+ --demo-space-3: 0.75rem;
13
+ --demo-space-4: 1rem;
14
+ --demo-space-6: 1.5rem;
15
+ --demo-space-8: 2rem;
16
+ --demo-space-12: 3rem;
17
+ --demo-space-16: 4rem;
18
+ --demo-space-24: 6rem;
19
+
20
+ --demo-radius-xs: 2px;
21
+ --demo-radius-sm: 4px;
22
+ --demo-radius-md: 8px;
23
+ --demo-radius-lg: 14px;
24
+ --demo-radius-pill: 999px;
25
+
26
+ --demo-max-prose: 68ch;
27
+
28
+ /* Status colours — themes override for fidelity to the palette. */
29
+ --demo-pass: oklch(0.62 0.14 150);
30
+ --demo-fail: oklch(0.58 0.19 25);
31
+ --demo-skip: oklch(0.68 0.10 80);
32
+ --demo-pending: oklch(0.58 0.02 260);
33
+ }
34
+
35
+ /* Keep long passages readable. */
36
+ .sl-markdown-content p,
37
+ .sl-markdown-content li {
38
+ max-width: var(--demo-max-prose);
39
+ }
40
+
41
+ /* ---- Landing page composition ------------------------------------------ */
42
+
43
+ .demo-landing {
44
+ display: grid;
45
+ gap: clamp(2.5rem, 4vw, 4rem);
46
+ padding-block: clamp(1rem, 2vw, 2rem);
47
+ max-width: none;
48
+ }
49
+
50
+ .demo-hero {
51
+ display: grid;
52
+ gap: var(--demo-space-6);
53
+ max-width: 52ch;
54
+ }
55
+
56
+ .demo-hero__eyebrow {
57
+ font-size: 0.75rem;
58
+ letter-spacing: 0.22em;
59
+ text-transform: uppercase;
60
+ font-weight: 600;
61
+ color: var(--demo-ink-muted, currentColor);
62
+ }
63
+
64
+ .demo-hero__title {
65
+ font-family: var(--demo-font-display, inherit);
66
+ font-size: clamp(2.25rem, 5.2vw, 4.5rem);
67
+ line-height: 1.02;
68
+ letter-spacing: -0.02em;
69
+ font-weight: 700;
70
+ margin: 0;
71
+ color: var(--demo-ink, inherit);
72
+ }
73
+
74
+ .demo-hero__tagline {
75
+ font-family: var(--demo-font-body, inherit);
76
+ font-size: clamp(1.1rem, 1.6vw, 1.35rem);
77
+ line-height: 1.45;
78
+ color: var(--demo-ink-muted, inherit);
79
+ margin: 0;
80
+ max-width: 42ch;
81
+ }
82
+
83
+ .demo-hero__cta {
84
+ display: inline-flex;
85
+ align-items: center;
86
+ gap: var(--demo-space-2);
87
+ padding: var(--demo-space-3) var(--demo-space-6);
88
+ background: var(--demo-accent, currentColor);
89
+ color: var(--demo-accent-ink, white);
90
+ font-family: var(--demo-font-body, inherit);
91
+ font-weight: 600;
92
+ font-size: 1rem;
93
+ text-decoration: none;
94
+ border-radius: var(--demo-radius-md);
95
+ border: 1px solid var(--demo-accent, currentColor);
96
+ width: max-content;
97
+ transition: transform 120ms ease-out;
98
+ }
99
+
100
+ .demo-hero__cta:hover {
101
+ transform: translateY(-1px);
102
+ }
103
+
104
+ .demo-hero__cta::after {
105
+ content: "→";
106
+ font-weight: 400;
107
+ }
108
+
109
+ /* ---- Stats strip ------------------------------------------------------- */
110
+
111
+ .demo-stats {
112
+ display: grid;
113
+ grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
114
+ gap: var(--demo-space-4);
115
+ padding: 0;
116
+ list-style: none;
117
+ }
118
+
119
+ .demo-stat {
120
+ display: grid;
121
+ gap: var(--demo-space-1);
122
+ padding: var(--demo-space-4) var(--demo-space-6);
123
+ background: var(--demo-surface, transparent);
124
+ border: 1px solid var(--demo-border, currentColor);
125
+ border-radius: var(--demo-radius-md);
126
+ }
127
+
128
+ .demo-stat__value {
129
+ font-family: var(--demo-font-mono, inherit);
130
+ font-size: clamp(1.75rem, 3vw, 2.5rem);
131
+ font-weight: 600;
132
+ line-height: 1;
133
+ font-variant-numeric: tabular-nums;
134
+ color: var(--demo-ink, inherit);
135
+ }
136
+
137
+ .demo-stat__label {
138
+ font-size: 0.72rem;
139
+ letter-spacing: 0.18em;
140
+ text-transform: uppercase;
141
+ color: var(--demo-ink-muted, inherit);
142
+ }
143
+
144
+ .demo-stat[data-tone="pass"] .demo-stat__value { color: var(--demo-pass); }
145
+ .demo-stat[data-tone="fail"] .demo-stat__value { color: var(--demo-fail); }
146
+ .demo-stat[data-tone="skip"] .demo-stat__value { color: var(--demo-skip); }
147
+
148
+ /* ---- Story list -------------------------------------------------------- */
149
+
150
+ .demo-section-heading {
151
+ font-family: var(--demo-font-display, inherit);
152
+ font-size: clamp(1.5rem, 2.4vw, 2rem);
153
+ font-weight: 700;
154
+ letter-spacing: -0.01em;
155
+ margin: 0 0 var(--demo-space-6);
156
+ color: var(--demo-ink, inherit);
157
+ }
158
+
159
+ .demo-stories {
160
+ list-style: none;
161
+ padding: 0;
162
+ margin: 0;
163
+ display: grid;
164
+ gap: var(--demo-space-2);
165
+ border-top: 1px solid var(--demo-border, currentColor);
166
+ }
167
+
168
+ .demo-stories li {
169
+ max-width: none;
170
+ margin: 0;
171
+ }
172
+
173
+ .demo-story {
174
+ display: grid;
175
+ grid-template-columns: 3rem 1fr auto;
176
+ align-items: baseline;
177
+ gap: var(--demo-space-4);
178
+ padding: var(--demo-space-4) var(--demo-space-2);
179
+ color: var(--demo-ink, inherit);
180
+ text-decoration: none;
181
+ border-bottom: 1px solid var(--demo-border, currentColor);
182
+ font-family: var(--demo-font-body, inherit);
183
+ transition: background 120ms ease-out;
184
+ }
185
+
186
+ .demo-story:hover {
187
+ background: var(--demo-surface, transparent);
188
+ }
189
+
190
+ .demo-story__index {
191
+ font-family: var(--demo-font-mono, inherit);
192
+ font-variant-numeric: tabular-nums;
193
+ font-size: 0.85rem;
194
+ color: var(--demo-ink-muted, inherit);
195
+ letter-spacing: 0.04em;
196
+ }
197
+
198
+ .demo-story__title {
199
+ font-size: 1.1rem;
200
+ font-weight: 500;
201
+ line-height: 1.3;
202
+ color: var(--demo-ink, inherit);
203
+ }
204
+
205
+ .demo-story__status {
206
+ font-family: var(--demo-font-mono, inherit);
207
+ font-size: 0.72rem;
208
+ letter-spacing: 0.18em;
209
+ text-transform: uppercase;
210
+ color: var(--demo-ink-muted, inherit);
211
+ }
212
+
213
+ .demo-empty {
214
+ padding: var(--demo-space-12);
215
+ border: 1px dashed var(--demo-border, currentColor);
216
+ border-radius: var(--demo-radius-md);
217
+ color: var(--demo-ink-muted, inherit);
218
+ font-family: var(--demo-font-body, inherit);
219
+ text-align: center;
220
+ max-width: none;
221
+ }
222
+
223
+ .demo-empty code {
224
+ font-family: var(--demo-font-mono, inherit);
225
+ }
226
+
227
+ /* ---- Splash sections (landing page) ----------------------------------- */
228
+
229
+ /* Sections are vertical rhythm units. Themes can opt into different
230
+ surface treatments by overriding .demo-section background/padding. */
231
+ .demo-section {
232
+ display: block;
233
+ }
234
+
235
+ /* Featured scenario block — hero media slot beneath the headline. */
236
+ .demo-featured {
237
+ display: grid;
238
+ gap: var(--demo-space-4);
239
+ padding-block: var(--demo-space-6);
240
+ border-top: 1px solid var(--demo-border, currentColor);
241
+ border-bottom: 1px solid var(--demo-border, currentColor);
242
+ }
243
+
244
+ .demo-featured__eyebrow {
245
+ font-family: var(--demo-font-mono, inherit);
246
+ font-size: 0.72rem;
247
+ letter-spacing: 0.18em;
248
+ text-transform: uppercase;
249
+ color: var(--demo-accent, currentColor);
250
+ font-weight: 600;
251
+ }
252
+
253
+ .demo-featured__title {
254
+ font-family: var(--demo-font-display, inherit);
255
+ font-size: clamp(1.5rem, 2.6vw, 2.25rem);
256
+ font-weight: 600;
257
+ letter-spacing: -0.015em;
258
+ margin: 0;
259
+ color: var(--demo-ink, inherit);
260
+ }
261
+
262
+ .demo-featured__media {
263
+ margin: 0;
264
+ border-radius: var(--demo-radius-md);
265
+ overflow: hidden;
266
+ border: 1px solid var(--demo-border, currentColor);
267
+ background: color-mix(in oklch, var(--demo-surface, currentColor) 60%, transparent);
268
+ }
269
+
270
+ .demo-featured__video,
271
+ .demo-featured__image {
272
+ display: block;
273
+ width: 100%;
274
+ height: auto;
275
+ }
276
+
277
+ .demo-featured__link {
278
+ font-family: var(--demo-font-body, inherit);
279
+ font-weight: 600;
280
+ color: var(--demo-accent, currentColor);
281
+ text-decoration: none;
282
+ align-self: start;
283
+ }
284
+
285
+ .demo-featured__link:hover,
286
+ .demo-featured__link:focus-visible {
287
+ text-decoration: underline;
288
+ text-underline-offset: 0.2em;
289
+ }
290
+
291
+ /* Feature grid — three-column "what's in this product" tile strip. */
292
+ .demo-feature-grid {
293
+ display: grid;
294
+ grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
295
+ gap: var(--demo-space-6);
296
+ padding: 0;
297
+ list-style: none;
298
+ max-width: none;
299
+ }
300
+
301
+ .demo-feature-grid li {
302
+ max-width: none;
303
+ margin: 0;
304
+ }
305
+
306
+ .demo-feature {
307
+ display: grid;
308
+ gap: var(--demo-space-2);
309
+ padding: var(--demo-space-6);
310
+ border: 1px solid var(--demo-border, currentColor);
311
+ border-radius: var(--demo-radius-md);
312
+ background: color-mix(in oklch, var(--demo-surface, currentColor) 70%, transparent);
313
+ }
314
+
315
+ .demo-feature__title {
316
+ font-family: var(--demo-font-display, inherit);
317
+ font-size: 1.15rem;
318
+ font-weight: 600;
319
+ letter-spacing: -0.01em;
320
+ margin: 0;
321
+ color: var(--demo-ink, inherit);
322
+ }
323
+
324
+ .demo-feature__body {
325
+ margin: 0;
326
+ font-family: var(--demo-font-body, inherit);
327
+ color: var(--demo-ink-muted, inherit);
328
+ line-height: 1.5;
329
+ }
330
+
331
+ /* Narrative section — copy block + optional media on the right. */
332
+ .demo-narrative {
333
+ display: grid;
334
+ gap: var(--demo-space-8);
335
+ align-items: center;
336
+ padding-block: var(--demo-space-12);
337
+ }
338
+
339
+ @media (min-width: 56rem) {
340
+ .demo-narrative:has(.demo-narrative__media) {
341
+ grid-template-columns: 1fr 1fr;
342
+ }
343
+ }
344
+
345
+ .demo-narrative__copy {
346
+ display: grid;
347
+ gap: var(--demo-space-3);
348
+ max-width: 48ch;
349
+ }
350
+
351
+ .demo-narrative__eyebrow {
352
+ font-family: var(--demo-font-mono, inherit);
353
+ font-size: 0.72rem;
354
+ letter-spacing: 0.18em;
355
+ text-transform: uppercase;
356
+ color: var(--demo-accent, currentColor);
357
+ font-weight: 600;
358
+ }
359
+
360
+ .demo-narrative__heading {
361
+ font-family: var(--demo-font-display, inherit);
362
+ font-size: clamp(1.75rem, 3vw, 2.5rem);
363
+ font-weight: 700;
364
+ letter-spacing: -0.02em;
365
+ margin: 0;
366
+ color: var(--demo-ink, inherit);
367
+ }
368
+
369
+ .demo-narrative__body {
370
+ margin: 0;
371
+ font-family: var(--demo-font-body, inherit);
372
+ font-size: 1.1rem;
373
+ line-height: 1.55;
374
+ color: var(--demo-ink-muted, inherit);
375
+ }
376
+
377
+ .demo-narrative__media img {
378
+ width: 100%;
379
+ height: auto;
380
+ border-radius: var(--demo-radius-md);
381
+ border: 1px solid var(--demo-border, currentColor);
382
+ }
383
+
384
+ /* Quote — pull quote with attribution, no card chrome by default. */
385
+ .demo-quote {
386
+ margin: 0;
387
+ padding-block: var(--demo-space-12);
388
+ display: grid;
389
+ gap: var(--demo-space-3);
390
+ text-align: left;
391
+ }
392
+
393
+ .demo-quote__body {
394
+ margin: 0;
395
+ font-family: var(--demo-font-display, inherit);
396
+ font-size: clamp(1.5rem, 3vw, 2.25rem);
397
+ font-weight: 500;
398
+ line-height: 1.25;
399
+ letter-spacing: -0.015em;
400
+ color: var(--demo-ink, inherit);
401
+ max-width: 28ch;
402
+ }
403
+
404
+ .demo-quote__attribution {
405
+ font-family: var(--demo-font-body, inherit);
406
+ font-size: 0.85rem;
407
+ letter-spacing: 0.04em;
408
+ color: var(--demo-ink-muted, inherit);
409
+ }
410
+
411
+ /* Optional logo above the hero. Sized to read at glance, never dominate. */
412
+ .demo-hero__logo {
413
+ height: 2.25rem;
414
+ width: auto;
415
+ margin-bottom: var(--demo-space-2);
416
+ }
417
+
418
+ /* Branding accent override — set on .demo-landing[style] when config.branding.accent is provided. */
419
+ .demo-landing[style*="--demo-accent-override"] {
420
+ --demo-accent: var(--demo-accent-override);
421
+ }
422
+
423
+ /* ---- Media blocks inside story pages ---------------------------------- */
424
+
425
+ .sl-markdown-content video,
426
+ .sl-markdown-content img {
427
+ border-radius: var(--demo-radius-md);
428
+ border: 1px solid var(--demo-border, transparent);
429
+ max-width: 100%;
430
+ }
431
+
432
+ /* ---- Story pages ------------------------------------------------------ */
433
+
434
+ /* Step paragraphs are emitted as `<p><strong>Given</strong> text</p>`.
435
+ A step-paragraph selector lets themes target the keyword and the line. */
436
+ .sl-markdown-content p:has(> strong:first-child) {
437
+ display: flex;
438
+ flex-wrap: wrap;
439
+ align-items: baseline;
440
+ gap: 0 0.6ch;
441
+ margin-block: var(--demo-space-3);
442
+ max-width: var(--demo-max-prose);
443
+ line-height: 1.5;
444
+ }
445
+
446
+ .sl-markdown-content p > strong:first-child {
447
+ font-family: var(--demo-font-mono, inherit);
448
+ font-weight: 600;
449
+ color: var(--demo-accent, currentColor);
450
+ letter-spacing: 0.04em;
451
+ flex: 0 0 auto;
452
+ }
453
+
454
+ /* Source-file path (first h2 on the page) is technical noise — diminish it. */
455
+ .sl-markdown-content > h2:first-of-type {
456
+ font-family: var(--demo-font-mono, inherit);
457
+ font-size: 0.78rem;
458
+ font-weight: 500;
459
+ letter-spacing: 0.06em;
460
+ color: var(--demo-ink-muted, currentColor);
461
+ margin-bottom: var(--demo-space-8);
462
+ padding-bottom: var(--demo-space-3);
463
+ border-bottom: 1px solid var(--demo-border, currentColor);
464
+ text-transform: none;
465
+ max-width: none;
466
+ }
467
+
468
+ /* Later h2s (Media, Failure, etc.) act as content dividers. */
469
+ .sl-markdown-content > h2:not(:first-of-type) {
470
+ font-family: var(--demo-font-display, inherit);
471
+ font-size: 0.85rem;
472
+ font-weight: 600;
473
+ letter-spacing: 0.2em;
474
+ text-transform: uppercase;
475
+ color: var(--demo-ink-muted, currentColor);
476
+ margin-top: var(--demo-space-16);
477
+ padding-top: var(--demo-space-4);
478
+ border-top: 1px solid var(--demo-border, currentColor);
479
+ max-width: none;
480
+ }
481
+
482
+ /* Scenario + suite + media-item headings — the real content markers. */
483
+ .sl-markdown-content h3 {
484
+ font-family: var(--demo-font-display, inherit);
485
+ font-size: clamp(1.5rem, 2.5vw, 2rem);
486
+ line-height: 1.15;
487
+ letter-spacing: -0.015em;
488
+ margin-block: var(--demo-space-12) var(--demo-space-4);
489
+ color: var(--demo-ink, inherit);
490
+ max-width: none;
491
+ }
492
+
493
+ /* Data tables inside story pages. */
494
+ .sl-markdown-content table {
495
+ width: 100%;
496
+ border-collapse: collapse;
497
+ font-family: var(--demo-font-body, inherit);
498
+ font-size: 0.95rem;
499
+ margin-block: var(--demo-space-4);
500
+ }
501
+
502
+ .sl-markdown-content th {
503
+ font-size: 0.72rem;
504
+ letter-spacing: 0.14em;
505
+ text-transform: uppercase;
506
+ font-weight: 600;
507
+ color: var(--demo-ink-muted, currentColor);
508
+ text-align: left;
509
+ padding: var(--demo-space-3) var(--demo-space-4);
510
+ border-bottom: 1px solid var(--demo-border, currentColor);
511
+ }
512
+
513
+ .sl-markdown-content td {
514
+ padding: var(--demo-space-3) var(--demo-space-4);
515
+ border-bottom: 1px solid var(--demo-border, currentColor);
516
+ vertical-align: top;
517
+ }
518
+
519
+ /* Media attachments sit prominently in the flow. */
520
+ .sl-markdown-content video {
521
+ width: 100%;
522
+ max-width: 960px;
523
+ height: auto;
524
+ display: block;
525
+ margin-block: var(--demo-space-4) var(--demo-space-8);
526
+ }
527
+
528
+ .sl-markdown-content img {
529
+ display: block;
530
+ margin-block: var(--demo-space-4);
531
+ }
532
+
533
+ /* Inline doc-entry bullets (e.g. `- **Label:** value`). Keep the label calm. */
534
+ .sl-markdown-content li > strong:first-child {
535
+ color: var(--demo-ink, currentColor);
536
+ font-weight: 600;
537
+ }
538
+
539
+ /* Code fences pick up theme surface + border. */
540
+ .sl-markdown-content pre {
541
+ background: var(--demo-surface, transparent);
542
+ border: 1px solid var(--demo-border, currentColor);
543
+ border-radius: var(--demo-radius-sm);
544
+ padding: var(--demo-space-4);
545
+ margin-block: var(--demo-space-4);
546
+ overflow-x: auto;
547
+ }
548
+
549
+ .sl-markdown-content :not(pre) > code {
550
+ font-family: var(--demo-font-mono, inherit);
551
+ font-size: 0.88em;
552
+ padding: 0.1em 0.35em;
553
+ border-radius: var(--demo-radius-xs);
554
+ background: color-mix(in oklch, var(--demo-surface, currentColor) 80%, transparent);
555
+ border: 1px solid color-mix(in oklch, var(--demo-border, currentColor) 60%, transparent);
556
+ }
557
+
558
+ /* ---- Keyboard focus ---------------------------------------------------- */
559
+
560
+ /* A single, theme-tinted focus ring for every interactive demo surface.
561
+ Each theme can override --demo-focus-ring if it wants something distinct. */
562
+ :root {
563
+ --demo-focus-ring: 2px solid var(--demo-accent, currentColor);
564
+ --demo-focus-offset: 3px;
565
+ }
566
+
567
+ .demo-hero__cta:focus-visible,
568
+ .demo-story:focus-visible,
569
+ .demo-featured__link:focus-visible,
570
+ .demo-feature:focus-within {
571
+ outline: var(--demo-focus-ring);
572
+ outline-offset: var(--demo-focus-offset);
573
+ border-radius: var(--demo-radius-sm);
574
+ }
575
+
576
+ /* Match hover affordance on focus so keyboard users see the same intent. */
577
+ .demo-story:focus-visible {
578
+ background: var(--demo-surface, transparent);
579
+ }
580
+
581
+ /* ---- Motion honouring preference -------------------------------------- */
582
+
583
+ @media (prefers-reduced-motion: reduce) {
584
+ * {
585
+ animation-duration: 0ms !important;
586
+ transition-duration: 0ms !important;
587
+ }
588
+ }