@inherent.design/brand 0.2.0 → 0.3.1

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 (36) hide show
  1. package/components/button/Button.astro +55 -0
  2. package/components/button/index.ts +7 -0
  3. package/components/image/Image.astro +24 -0
  4. package/components/image/index.ts +9 -0
  5. package/components/prose/Prose.astro +617 -0
  6. package/components/prose/index.ts +9 -0
  7. package/components/separator/Separator.astro +36 -0
  8. package/components/separator/index.ts +7 -0
  9. package/fonts/dist/en/1c6a77e998e54efef01b7caf56bc42a3.woff2 +0 -0
  10. package/fonts/dist/en/50be83d8450ee117be0e081216cb6c61.woff2 +0 -0
  11. package/fonts/dist/en/91424d2ed0640f376b7ab256afefe512.woff2 +0 -0
  12. package/fonts/dist/en/bd7f480f2bcf174edd41ec205c345a62.woff2 +0 -0
  13. package/fonts/dist/en/e5fe10dc949fa944db6496bcd735f594.woff2 +0 -0
  14. package/fonts/dist/en/index.css +9 -9
  15. package/fonts/dist/hi/index.css +3 -3
  16. package/fonts/dist/zh/2e199b543bf018d377b67e99726877ed.woff2 +0 -0
  17. package/fonts/dist/zh/67cdd35800ba1cfd8e98b3943bd77834.woff2 +0 -0
  18. package/fonts/dist/zh/6ee817625aeeadd71f081cc671e0c26e.woff2 +0 -0
  19. package/fonts/dist/zh/734840a02a4bc6d5160fbb0482fd9fab.woff2 +0 -0
  20. package/fonts/dist/zh/7ff3a53513ebbbc16b0f1baf70713e17.woff2 +0 -0
  21. package/fonts/dist/zh/f41ec03cc2ad8e0cb2e04f7ceacc91e4.woff2 +0 -0
  22. package/fonts/dist/zh/index.css +4 -4
  23. package/package.json +15 -11
  24. package/fonts/dist/en/279406bfba1f0020d1fce5ec6fd2a735.woff2 +0 -0
  25. package/fonts/dist/en/6b7f391fd81e697900cda8aff128197e.woff2 +0 -0
  26. package/fonts/dist/en/854fe9c7181becfefb35721fb5b526fd.woff2 +0 -0
  27. package/fonts/dist/en/a4dcca7a30c3fec53f94ea68154075ef.woff2 +0 -0
  28. package/fonts/dist/en/c013350c35e7cb5ba99d7ce8337f6eec.woff2 +0 -0
  29. package/fonts/dist/zh/16144bae757cf69e1303657f4666167b.woff2 +0 -0
  30. package/fonts/dist/zh/6b02f1bb13dd222053d1748cd0e91dec.woff2 +0 -0
  31. package/fonts/dist/zh/94c6b8220e16b579460ca450b7f700f8.woff2 +0 -0
  32. package/fonts/dist/zh/bad3748e751a2f826e2353048d691687.woff2 +0 -0
  33. package/fonts/dist/zh/c0fdf8df0b34608d454afb2c33c466f1.woff2 +0 -0
  34. package/fonts/dist/zh/da5d9643f9cd74d319fb3c3fcf47b73c.woff2 +0 -0
  35. /package/{starwind.css → styles/starwind.css} +0 -0
  36. /package/{styles.css → styles/styles.css} +0 -0
@@ -0,0 +1,617 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { tv } from "tailwind-variants";
4
+
5
+ export const prose = tv({
6
+ base: "sw-prose max-w-[65ch]",
7
+ });
8
+
9
+ type Props = HTMLAttributes<"div">;
10
+
11
+ const { class: className, ...rest } = Astro.props;
12
+ ---
13
+
14
+ <div class:list={[prose({ class: className })]} data-slot="prose" {...rest}><slot /></div>
15
+
16
+ <style is:global>
17
+ /* ==========================================================================
18
+ * Starwind Prose - Typography styles for markdown content
19
+ * Inspired by Tailwind Typography and Astro Starlight
20
+ * ========================================================================== */
21
+
22
+ /* --------------------------------------------------------------------------
23
+ * CSS Custom Properties
24
+ *
25
+ * Sizing is em-based, so it scales with the inherited font-size.
26
+ * Control overall size via Tailwind text utilities: text-sm md:text-base
27
+ *
28
+ * Override specific values using CSS variables (supports responsive):
29
+ * class="[--prose-spacing:1.5em] md:[--prose-spacing:1.25em]"
30
+ *
31
+ * Or set on a parent element:
32
+ * <div style="--prose-h1-size: 3em;"><Prose>...</Prose></div>
33
+ * -------------------------------------------------------------------------- */
34
+
35
+ .sw-prose {
36
+ /* ===================
37
+ * Typography & Spacing
38
+ * =================== */
39
+ --sw-prose-line-height: var(--prose-line-height, 1.6);
40
+ --sw-prose-spacing: var(--prose-spacing, 1.25em);
41
+ --sw-prose-heading-spacing: var(--prose-heading-spacing, 1.5em);
42
+ --sw-prose-code-size: var(--prose-code-size, 0.875em);
43
+ --sw-prose-list-indent: var(--prose-list-indent, 1.625em);
44
+
45
+ /* ===================
46
+ * Colors
47
+ * =================== */
48
+ --sw-prose-color: var(--prose-color, --alpha(var(--color-foreground) / 80%));
49
+ --sw-prose-heading-color: var(--prose-heading-color, var(--color-foreground));
50
+ --sw-prose-list-marker-color: var(--prose-list-marker-color, var(--color-muted-foreground));
51
+
52
+ /* ===================
53
+ * Headings
54
+ * =================== */
55
+ --sw-prose-heading-font: var(--prose-heading-font, var(--font-heading, inherit));
56
+ --sw-prose-heading-weight: var(--prose-heading-weight, 600);
57
+ --sw-prose-heading-line-height: var(--prose-heading-line-height, 1.25);
58
+ --sw-prose-h1-size: var(--prose-h1-size, 2.25em);
59
+ --sw-prose-h1-weight: var(--prose-h1-weight, var(--sw-prose-heading-weight));
60
+ --sw-prose-h2-size: var(--prose-h2-size, 1.5em);
61
+ --sw-prose-h2-weight: var(--prose-h2-weight, var(--sw-prose-heading-weight));
62
+ --sw-prose-h3-size: var(--prose-h3-size, 1.25em);
63
+ --sw-prose-h3-weight: var(--prose-h3-weight, var(--sw-prose-heading-weight));
64
+ --sw-prose-h4-size: var(--prose-h4-size, 1em);
65
+ --sw-prose-h4-weight: var(--prose-h4-weight, var(--sw-prose-heading-weight));
66
+
67
+ /* ===================
68
+ * Links
69
+ * =================== */
70
+ --sw-prose-link-color: var(--prose-link-color, var(--color-foreground));
71
+ --sw-prose-link-decoration-color: var(
72
+ --prose-link-decoration-color,
73
+ var(--color-primary-accent)
74
+ );
75
+ --sw-prose-link-hover-color: var(--prose-link-hover-color, var(--color-primary-accent));
76
+
77
+ /* ===================
78
+ * Strong/Bold
79
+ * =================== */
80
+ --sw-prose-strong-color: var(--prose-strong-color, var(--color-foreground));
81
+ --sw-prose-strong-weight: var(--prose-strong-weight, 600);
82
+
83
+ /* ===================
84
+ * Blockquote
85
+ * =================== */
86
+ --sw-prose-blockquote-color: var(--prose-blockquote-color, var(--color-foreground));
87
+ --sw-prose-blockquote-border-color: var(--prose-blockquote-border-color, var(--color-border));
88
+ --sw-prose-blockquote-border-width: var(--prose-blockquote-border-width, 4px);
89
+
90
+ /* ===================
91
+ * Inline Code
92
+ * =================== */
93
+ --sw-prose-code-bg: var(--prose-code-bg, var(--color-muted));
94
+ --sw-prose-code-color: var(--prose-code-color, var(--color-foreground));
95
+ --sw-prose-code-weight: var(--prose-code-weight, 500);
96
+ --sw-prose-code-radius: var(--prose-code-radius, var(--radius-sm));
97
+
98
+ /* ===================
99
+ * Pre / Code Blocks
100
+ * =================== */
101
+ --sw-prose-pre-border-color: var(--prose-pre-border-color, var(--color-border));
102
+ --sw-prose-pre-border-radius: var(--prose-pre-border-radius, var(--radius-md));
103
+
104
+ /* ===================
105
+ * Tables
106
+ * =================== */
107
+ --sw-prose-table-heading-color: var(--prose-table-heading-color, var(--color-foreground));
108
+ --sw-prose-table-border-color: var(--prose-table-border-color, var(--color-border));
109
+
110
+ /* ===================
111
+ * Media (images, video, etc.)
112
+ * =================== */
113
+ --sw-prose-media-border-width: var(--prose-media-border-width, 0px);
114
+ --sw-prose-media-border-color: var(--prose-media-border-color, var(--color-border));
115
+ --sw-prose-media-border-radius: var(--prose-media-border-radius, 0);
116
+
117
+ /* ===================
118
+ * Mark/Highlight
119
+ * =================== */
120
+ --sw-prose-highlight-color: var(--prose-highlight-color, var(--color-foreground));
121
+ --sw-prose-highlight-bg-color: var(
122
+ --prose-highlight-bg-color,
123
+ --alpha(var(--color-warning) / 30%)
124
+ );
125
+
126
+ /* ===================
127
+ * Base styles
128
+ * =================== */
129
+ line-height: var(--sw-prose-line-height);
130
+ color: var(--sw-prose-color);
131
+ }
132
+
133
+ /* Vertical rhythm - spacing between block elements */
134
+ .sw-prose
135
+ :not(a, strong, em, del, span, input, code, br, kbd)
136
+ + :not(a, strong, em, del, span, input, code, br, kbd, :where(.not-sw-prose *)) {
137
+ margin-top: var(--sw-prose-spacing);
138
+ }
139
+
140
+ /* Headings after non-headings have more spacing */
141
+ .sw-prose
142
+ :not(h1, h2, h3, h4, h5, h6)
143
+ + :is(h1, h2, h3, h4, h5, h6):not(:where(.not-sw-prose *)) {
144
+ margin-top: var(--sw-prose-heading-spacing);
145
+ }
146
+
147
+ /* First/last child margin reset */
148
+ .sw-prose > :first-child:not(:where(.not-sw-prose *)) {
149
+ margin-top: 0;
150
+ }
151
+ .sw-prose > :last-child:not(:where(.not-sw-prose *)) {
152
+ margin-bottom: 0;
153
+ }
154
+
155
+ /* --------------------------------------------------------------------------
156
+ * Headings
157
+ * -------------------------------------------------------------------------- */
158
+
159
+ .sw-prose :is(h1, h2, h3, h4, h5, h6):not(:where(.not-sw-prose *)) {
160
+ color: var(--sw-prose-heading-color);
161
+ font-family: var(--sw-prose-heading-font);
162
+ font-weight: var(--sw-prose-heading-weight);
163
+ line-height: var(--sw-prose-heading-line-height);
164
+ }
165
+
166
+ .sw-prose h1:not(:where(.not-sw-prose *)) {
167
+ font-size: var(--sw-prose-h1-size);
168
+ font-weight: var(--sw-prose-h1-weight);
169
+ margin-bottom: 0.889em;
170
+ }
171
+
172
+ .sw-prose h2:not(:where(.not-sw-prose *)) {
173
+ font-size: var(--sw-prose-h2-size);
174
+ font-weight: var(--sw-prose-h2-weight);
175
+ margin-bottom: 0.667em;
176
+ }
177
+
178
+ .sw-prose h3:not(:where(.not-sw-prose *)) {
179
+ font-size: var(--sw-prose-h3-size);
180
+ font-weight: var(--sw-prose-h3-weight);
181
+ margin-bottom: 0.6em;
182
+ }
183
+
184
+ .sw-prose h4:not(:where(.not-sw-prose *)) {
185
+ font-size: var(--sw-prose-h4-size);
186
+ font-weight: var(--sw-prose-h4-weight);
187
+ margin-bottom: 0.5em;
188
+ }
189
+
190
+ .sw-prose h5:not(:where(.not-sw-prose *)),
191
+ .sw-prose h6:not(:where(.not-sw-prose *)) {
192
+ font-size: inherit;
193
+ font-weight: var(--sw-prose-heading-weight);
194
+ margin-bottom: 0.5em;
195
+ }
196
+
197
+ /* Reset margin-top after headings */
198
+ .sw-prose :is(h1, h2, h3, h4, h5, h6) + *:not(:where(.not-sw-prose *)) {
199
+ margin-top: 0;
200
+ }
201
+
202
+ /* --------------------------------------------------------------------------
203
+ * Paragraphs
204
+ * -------------------------------------------------------------------------- */
205
+
206
+ .sw-prose p:not(:where(.not-sw-prose *)) {
207
+ margin-top: var(--sw-prose-spacing);
208
+ margin-bottom: var(--sw-prose-spacing);
209
+ }
210
+
211
+ /* --------------------------------------------------------------------------
212
+ * Links
213
+ * -------------------------------------------------------------------------- */
214
+
215
+ .sw-prose a:not(:where(.not-sw-prose *)) {
216
+ color: var(--sw-prose-link-color);
217
+ text-decoration: underline;
218
+ text-decoration-color: var(--sw-prose-link-decoration-color);
219
+ text-underline-offset: 0.15em;
220
+ font-weight: 500;
221
+ transition-property: color;
222
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
223
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
224
+ }
225
+
226
+ .sw-prose a:hover:not(:where(.not-sw-prose *)) {
227
+ color: var(--sw-prose-link-hover-color);
228
+ }
229
+
230
+ /* --------------------------------------------------------------------------
231
+ * Strong, Bold, Emphasis
232
+ * -------------------------------------------------------------------------- */
233
+
234
+ .sw-prose strong:not(:where(.not-sw-prose *)) {
235
+ color: var(--sw-prose-strong-color);
236
+ font-weight: var(--sw-prose-strong-weight);
237
+ }
238
+
239
+ .sw-prose :is(a, blockquote, thead th) strong:not(:where(.not-sw-prose *)) {
240
+ color: inherit;
241
+ }
242
+
243
+ /* --------------------------------------------------------------------------
244
+ * Lists
245
+ * -------------------------------------------------------------------------- */
246
+
247
+ .sw-prose :is(ul, ol):not(:where(.not-sw-prose *)) {
248
+ padding-inline-start: var(--sw-prose-list-indent);
249
+ margin-top: var(--sw-prose-spacing);
250
+ margin-bottom: var(--sw-prose-spacing);
251
+ }
252
+
253
+ .sw-prose ul:not(:where(.not-sw-prose *)) {
254
+ list-style-type: disc;
255
+ }
256
+
257
+ .sw-prose ol:not(:where(.not-sw-prose *)) {
258
+ list-style-type: decimal;
259
+ }
260
+
261
+ .sw-prose li:not(:where(.not-sw-prose *)) {
262
+ margin-top: 0.5em;
263
+ margin-bottom: 0.5em;
264
+ padding-inline-start: 0.375em;
265
+ overflow-wrap: anywhere;
266
+ }
267
+
268
+ .sw-prose li + li:not(:where(.not-sw-prose *)) {
269
+ margin-top: 0.25rem;
270
+ }
271
+
272
+ .sw-prose :is(ul, ol) :is(ul, ol):not(:where(.not-sw-prose *)) {
273
+ margin-top: 0.75em;
274
+ margin-bottom: 0.75em;
275
+ }
276
+
277
+ .sw-prose ol > li:not(:where(.not-sw-prose *))::marker {
278
+ font-weight: 400;
279
+ color: var(--sw-prose-list-marker-color);
280
+ }
281
+
282
+ .sw-prose ul > li:not(:where(.not-sw-prose *))::marker {
283
+ color: var(--sw-prose-list-marker-color);
284
+ }
285
+
286
+ /* Definition lists */
287
+ .sw-prose dl:not(:where(.not-sw-prose *)) {
288
+ margin-top: var(--sw-prose-spacing);
289
+ margin-bottom: var(--sw-prose-spacing);
290
+ }
291
+
292
+ .sw-prose dt:not(:where(.not-sw-prose *)) {
293
+ color: var(--color-foreground);
294
+ font-weight: 600;
295
+ margin-top: var(--sw-prose-spacing);
296
+ opacity: 1;
297
+ }
298
+
299
+ .sw-prose dd:not(:where(.not-sw-prose *)) {
300
+ margin-top: 0.25rem;
301
+ padding-inline-start: var(--sw-prose-list-indent);
302
+ }
303
+
304
+ .sw-prose dt + dt:not(:where(.not-sw-prose *)),
305
+ .sw-prose dt + dd:not(:where(.not-sw-prose *)),
306
+ .sw-prose dd + dd:not(:where(.not-sw-prose *)) {
307
+ margin-top: 0.25rem;
308
+ }
309
+
310
+ /* --------------------------------------------------------------------------
311
+ * Blockquotes
312
+ * -------------------------------------------------------------------------- */
313
+
314
+ .sw-prose blockquote:not(:where(.not-sw-prose *)) {
315
+ font-style: italic;
316
+ color: var(--sw-prose-blockquote-color);
317
+ border-inline-start: var(--sw-prose-blockquote-border-width) solid
318
+ var(--sw-prose-blockquote-border-color);
319
+ padding-inline-start: 1rem;
320
+ margin-top: var(--sw-prose-spacing);
321
+ margin-bottom: var(--sw-prose-spacing);
322
+ }
323
+
324
+ .sw-prose blockquote p:first-of-type:not(:where(.not-sw-prose *))::before {
325
+ content: open-quote;
326
+ }
327
+
328
+ .sw-prose blockquote p:last-of-type:not(:where(.not-sw-prose *))::after {
329
+ content: close-quote;
330
+ }
331
+
332
+ /* --------------------------------------------------------------------------
333
+ * Code (inline)
334
+ * -------------------------------------------------------------------------- */
335
+
336
+ .sw-prose code:not(:where(.not-sw-prose *)) {
337
+ background-color: var(--sw-prose-code-bg);
338
+ color: var(--sw-prose-code-color);
339
+ font-size: var(--sw-prose-code-size);
340
+ font-weight: var(--sw-prose-code-weight);
341
+ /* padding: 0.125rem 0.375rem; */
342
+ padding: calc(var(--spacing) / 2) calc(var(--spacing) * 1.25);
343
+ border-radius: var(--sw-prose-code-radius);
344
+ }
345
+
346
+ .sw-prose :is(h1, h2, h3, h4, h5, h6) code:not(:where(.not-sw-prose *)) {
347
+ font-size: inherit;
348
+ }
349
+
350
+ .sw-prose a code:not(:where(.not-sw-prose *)) {
351
+ color: inherit;
352
+ }
353
+
354
+ /* --------------------------------------------------------------------------
355
+ * Pre / Code blocks
356
+ * -------------------------------------------------------------------------- */
357
+
358
+ .sw-prose pre:not(:where(.not-sw-prose *)) {
359
+ border: 1px solid var(--sw-prose-pre-border-color);
360
+ border-radius: var(--sw-prose-pre-border-radius);
361
+ padding: 0.75rem 1rem;
362
+ font-size: var(--sw-prose-code-size);
363
+ line-height: 1.714;
364
+ overflow-x: auto;
365
+ tab-size: 2;
366
+ margin-top: var(--sw-prose-spacing);
367
+ margin-bottom: var(--sw-prose-spacing);
368
+ }
369
+
370
+ .sw-prose pre code:not(:where(.not-sw-prose *)) {
371
+ all: unset;
372
+ font-family: var(--font-mono);
373
+ }
374
+
375
+ /* --------------------------------------------------------------------------
376
+ * Horizontal Rules
377
+ * -------------------------------------------------------------------------- */
378
+
379
+ .sw-prose hr:not(:where(.not-sw-prose *)) {
380
+ border: 0;
381
+ border-top: 1px solid var(--color-border);
382
+ margin-top: 3em;
383
+ margin-bottom: 3em;
384
+ }
385
+
386
+ .sw-prose hr + *:not(:where(.not-sw-prose *)) {
387
+ margin-top: 0;
388
+ }
389
+
390
+ /* --------------------------------------------------------------------------
391
+ * Images and Media
392
+ * -------------------------------------------------------------------------- */
393
+
394
+ .sw-prose :is(img, picture, video, canvas, svg, iframe):not(:where(.not-sw-prose *)) {
395
+ display: block;
396
+ max-width: 100%;
397
+ height: auto;
398
+ border: var(--sw-prose-media-border-width) solid var(--sw-prose-media-border-color);
399
+ border-radius: var(--sw-prose-media-border-radius);
400
+ margin-top: var(--sw-prose-spacing);
401
+ margin-bottom: var(--sw-prose-spacing);
402
+ }
403
+
404
+ .sw-prose picture > img:not(:where(.not-sw-prose *)) {
405
+ margin-top: 0;
406
+ margin-bottom: 0;
407
+ }
408
+
409
+ /* --------------------------------------------------------------------------
410
+ * Figures and Captions
411
+ * -------------------------------------------------------------------------- */
412
+
413
+ .sw-prose figure:not(:where(.not-sw-prose *)) {
414
+ margin-top: var(--sw-prose-spacing);
415
+ margin-bottom: var(--sw-prose-spacing);
416
+ }
417
+
418
+ .sw-prose figure > *:not(:where(.not-sw-prose *)) {
419
+ margin-top: 0;
420
+ margin-bottom: 0;
421
+ }
422
+
423
+ .sw-prose figcaption:not(:where(.not-sw-prose *)) {
424
+ color: var(--color-muted-foreground);
425
+ font-size: var(--sw-prose-code-size);
426
+ margin-top: 0.857em;
427
+ }
428
+
429
+ /* --------------------------------------------------------------------------
430
+ * Tables
431
+ * -------------------------------------------------------------------------- */
432
+
433
+ .sw-prose table:not(:where(.not-sw-prose *)) {
434
+ width: 100%;
435
+ table-layout: auto;
436
+ margin-top: var(--sw-prose-spacing);
437
+ margin-bottom: var(--sw-prose-spacing);
438
+ font-size: var(--sw-prose-code-size);
439
+ line-height: 1.714;
440
+ }
441
+
442
+ .sw-prose thead:not(:where(.not-sw-prose *)) {
443
+ border-bottom: 1px solid var(--sw-prose-table-border-color);
444
+ }
445
+
446
+ .sw-prose thead th:not(:where(.not-sw-prose *)) {
447
+ color: var(--sw-prose-table-heading-color);
448
+ font-weight: 600;
449
+ vertical-align: bottom;
450
+ padding-inline-end: 0.571em;
451
+ padding-bottom: 0.571em;
452
+ padding-inline-start: 0.571em;
453
+ text-align: start;
454
+ opacity: 1;
455
+ }
456
+
457
+ .sw-prose thead th:first-child:not(:where(.not-sw-prose *)) {
458
+ padding-inline-start: 0;
459
+ }
460
+
461
+ .sw-prose thead th:last-child:not(:where(.not-sw-prose *)) {
462
+ padding-inline-end: 0;
463
+ }
464
+
465
+ .sw-prose tbody tr:not(:where(.not-sw-prose *)) {
466
+ border-bottom: 1px solid var(--sw-prose-table-border-color);
467
+ }
468
+
469
+ .sw-prose tbody tr:last-child:not(:where(.not-sw-prose *)) {
470
+ border-bottom-width: 0;
471
+ }
472
+
473
+ .sw-prose :is(td, th):not(:where(.not-sw-prose *)) {
474
+ vertical-align: baseline;
475
+ padding: 0.571em;
476
+ }
477
+
478
+ .sw-prose :is(td:first-child, th:first-child):not(:where(.not-sw-prose *)) {
479
+ padding-inline-start: 0;
480
+ }
481
+
482
+ .sw-prose :is(td:last-child, th:last-child):not(:where(.not-sw-prose *)) {
483
+ padding-inline-end: 0;
484
+ }
485
+
486
+ .sw-prose tfoot:not(:where(.not-sw-prose *)) {
487
+ border-top: 1px solid var(--sw-prose-table-border-color);
488
+ }
489
+
490
+ .sw-prose tfoot td:not(:where(.not-sw-prose *)) {
491
+ vertical-align: top;
492
+ }
493
+
494
+ /* --------------------------------------------------------------------------
495
+ * Keyboard Input
496
+ * -------------------------------------------------------------------------- */
497
+
498
+ .sw-prose kbd:not(:where(.not-sw-prose *)) {
499
+ font-weight: 500;
500
+ font-family: inherit;
501
+ font-size: var(--sw-prose-code-size);
502
+ width: fit-content;
503
+ display: inline-flex;
504
+ justify-content: center;
505
+ align-items: center;
506
+ gap: var(--spacing);
507
+ min-width: calc(var(--spacing) * 5);
508
+ color: var(--color-muted-foreground);
509
+ background-color: var(--color-muted);
510
+ padding: calc(var(--spacing) / 2) calc(var(--spacing) * 1.25);
511
+ border-radius: var(--radius-sm);
512
+ /* box-shadow:
513
+ 0 0 0 1px color-mix(in srgb, var(--color-foreground) 10%, transparent),
514
+ 0 2px 0 color-mix(in srgb, var(--color-foreground) 10%, transparent); */
515
+ }
516
+
517
+ /* --------------------------------------------------------------------------
518
+ * Details / Summary (Starlight-inspired)
519
+ * -------------------------------------------------------------------------- */
520
+
521
+ .sw-prose details:not(:where(.not-sw-prose *)) {
522
+ --sw-details-border-color: var(--color-border);
523
+ --sw-details-border-color-hover: var(--color-primary-accent);
524
+
525
+ border-inline-start: 2px solid var(--sw-details-border-color);
526
+ padding-inline-start: 1rem;
527
+ margin-top: var(--sw-prose-spacing);
528
+ margin-bottom: var(--sw-prose-spacing);
529
+ transition-property: border-color;
530
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
531
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
532
+ }
533
+
534
+ .sw-prose details:not([open]):hover:not(:where(.not-sw-prose *)),
535
+ .sw-prose details:has(> summary:hover):not(:where(.not-sw-prose *)) {
536
+ border-color: var(--sw-details-border-color-hover);
537
+ }
538
+
539
+ .sw-prose summary:not(:where(.not-sw-prose *)) {
540
+ color: var(--color-foreground);
541
+ cursor: pointer;
542
+ display: block;
543
+ font-weight: 600;
544
+ margin-inline-start: -0.5rem;
545
+ padding-inline-start: 0.5rem;
546
+ opacity: 1;
547
+ }
548
+
549
+ .sw-prose details[open] > summary:not(:where(.not-sw-prose *)) {
550
+ margin-bottom: 1rem;
551
+ }
552
+
553
+ /* Summary marker styles */
554
+ .sw-prose summary:not(:where(.not-sw-prose *))::marker,
555
+ .sw-prose summary:not(:where(.not-sw-prose *))::-webkit-details-marker {
556
+ display: none;
557
+ }
558
+
559
+ .sw-prose summary:not(:where(.not-sw-prose *))::before {
560
+ --sw-details-marker-size: 1.25rem;
561
+
562
+ background-color: currentColor;
563
+ content: "";
564
+ display: inline-block;
565
+ height: var(--sw-details-marker-size);
566
+ width: var(--sw-details-marker-size);
567
+ margin-inline: calc((var(--sw-details-marker-size) / 4) * -1) 0.25rem;
568
+ vertical-align: middle;
569
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.8 11.3 10.6 7a1 1 0 1 0-1.4 1.5l3.5 3.5-3.5 3.5a1 1 0 0 0 0 1.4 1 1 0 0 0 .7.3 1 1 0 0 0 .7-.3l4.2-4.2a1 1 0 0 0 0-1.4Z'/%3E%3C/svg%3E%0A");
570
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.8 11.3 10.6 7a1 1 0 1 0-1.4 1.5l3.5 3.5-3.5 3.5a1 1 0 0 0 0 1.4 1 1 0 0 0 .7.3 1 1 0 0 0 .7-.3l4.2-4.2a1 1 0 0 0 0-1.4Z'/%3E%3C/svg%3E%0A");
571
+ -webkit-mask-repeat: no-repeat;
572
+ mask-repeat: no-repeat;
573
+ }
574
+
575
+ @media (prefers-reduced-motion: no-preference) {
576
+ .sw-prose summary:not(:where(.not-sw-prose *))::before {
577
+ transition: transform 0.2s ease-in-out;
578
+ }
579
+ }
580
+
581
+ .sw-prose details[open] > summary:not(:where(.not-sw-prose *))::before {
582
+ transform: rotateZ(90deg);
583
+ }
584
+
585
+ [dir="rtl"] .sw-prose summary:not(:where(.not-sw-prose *))::before,
586
+ .sw-prose [dir="rtl"] summary:not(:where(.not-sw-prose *))::before {
587
+ transform: rotateZ(180deg);
588
+ }
589
+
590
+ /* Summary with only a paragraph (MDX) */
591
+ .sw-prose summary:not(:where(.not-sw-prose *)) p:only-child {
592
+ display: inline;
593
+ }
594
+
595
+ /* --------------------------------------------------------------------------
596
+ * Miscellaneous
597
+ * -------------------------------------------------------------------------- */
598
+
599
+ /* Abbreviations */
600
+ .sw-prose abbr[title]:not(:where(.not-sw-prose *)) {
601
+ text-decoration: underline dotted;
602
+ cursor: help;
603
+ }
604
+
605
+ /* Mark/Highlight */
606
+ .sw-prose mark:not(:where(.not-sw-prose *)) {
607
+ background-color: var(--sw-prose-highlight-bg-color);
608
+ color: var(--sw-prose-highlight-color);
609
+ padding: calc(var(--spacing) / 2) var(--spacing);
610
+ border-radius: calc(var(--radius) / 4);
611
+ }
612
+
613
+ /* Subscript and Superscript */
614
+ .sw-prose :is(sub, sup):not(:where(.not-sw-prose *)) {
615
+ font-size: 0.75em;
616
+ }
617
+ </style>
@@ -0,0 +1,9 @@
1
+ import Prose, { prose } from "./Prose.astro";
2
+
3
+ const ProseVariants = {
4
+ prose,
5
+ };
6
+
7
+ export { Prose, ProseVariants };
8
+
9
+ export default Prose;
@@ -0,0 +1,36 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { tv } from "tailwind-variants";
4
+
5
+ type Props = Omit<HTMLAttributes<"div">, "role" | "aria-orientation"> & {
6
+ /**
7
+ * The orientation of the separator.
8
+ * @default "horizontal"
9
+ */
10
+ orientation?: "horizontal" | "vertical";
11
+ };
12
+
13
+ export const separator = tv({
14
+ base: "bg-border shrink-0",
15
+ variants: {
16
+ orientation: {
17
+ horizontal: "h-[1px] w-full",
18
+ vertical: "h-full w-[1px]",
19
+ },
20
+ },
21
+ defaultVariants: {
22
+ orientation: "horizontal",
23
+ },
24
+ });
25
+
26
+ const { class: className, orientation = "horizontal", ...rest } = Astro.props;
27
+ ---
28
+
29
+ <div
30
+ role="separator"
31
+ aria-orientation={orientation}
32
+ class={separator({ orientation, class: className })}
33
+ data-slot="separator"
34
+ {...rest}
35
+ >
36
+ </div>
@@ -0,0 +1,7 @@
1
+ import Separator, { separator } from "./Separator.astro";
2
+
3
+ const SeparatorVariants = { separator };
4
+
5
+ export { Separator, SeparatorVariants };
6
+
7
+ export default Separator;