@veryfront/ext-css-tailwind 0.1.1271-rc.23191 → 0.1.1271-rc.23202

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,1851 @@
1
+ /*!
2
+ MIT License
3
+
4
+ Copyright (c) Tailwind Labs, Inc.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
23
+ */
24
+ import plugin from "tailwindcss/plugin";
25
+ import colors from "tailwindcss/colors";
26
+ import parser from "postcss-selector-parser";
27
+ // BEGIN UPSTREAM utils.js
28
+ const typographyUtils = (() => {
29
+ const parseSelector = parser();
30
+ function isObject(value) {
31
+ return typeof value === 'object' && value !== null;
32
+ }
33
+ function isPlainObject(value) {
34
+ if (typeof value !== 'object' || value === null) {
35
+ return false;
36
+ }
37
+ if (Object.prototype.toString.call(value) !== '[object Object]') {
38
+ return false;
39
+ }
40
+ if (Object.getPrototypeOf(value) === null) {
41
+ return true;
42
+ }
43
+ let proto = value;
44
+ while (Object.getPrototypeOf(proto) !== null) {
45
+ proto = Object.getPrototypeOf(proto);
46
+ }
47
+ return Object.getPrototypeOf(value) === proto;
48
+ }
49
+ function merge(target, ...sources) {
50
+ if (!sources.length)
51
+ return target;
52
+ const source = sources.shift();
53
+ if (isObject(target) && isObject(source)) {
54
+ for (const key of Object.keys(source)) {
55
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
56
+ throw new TypeError('Typography configuration contains an unsafe property');
57
+ }
58
+ if (Array.isArray(source[key])) {
59
+ if (!target[key])
60
+ target[key] = [];
61
+ source[key].forEach((item, index) => {
62
+ if (isPlainObject(item) && isPlainObject(target[key][index])) {
63
+ target[key][index] = merge(target[key][index], item);
64
+ }
65
+ else {
66
+ target[key][index] = item;
67
+ }
68
+ });
69
+ }
70
+ else if (isPlainObject(source[key])) {
71
+ if (!target[key])
72
+ target[key] = {};
73
+ merge(target[key], source[key]);
74
+ }
75
+ else {
76
+ target[key] = source[key];
77
+ }
78
+ }
79
+ }
80
+ return merge(target, ...sources);
81
+ }
82
+ function castArray(value) {
83
+ return Array.isArray(value) ? value : [value];
84
+ }
85
+ return {
86
+ isObject,
87
+ isPlainObject,
88
+ merge,
89
+ castArray,
90
+ isUsableColor(color, values) {
91
+ return isPlainObject(values) && color !== 'gray' && values[600];
92
+ },
93
+ /**
94
+ * @param {string} selector
95
+ */
96
+ commonTrailingPseudos(selector) {
97
+ const ast = parseSelector.astSync(selector);
98
+ /** @type {import('postcss-selector-parser').Pseudo[][]} */
99
+ const matrix = [];
100
+ // Put the pseudo elements in reverse order in a sparse, column-major 2D array
101
+ for (const [i, sel] of ast.nodes.entries()) {
102
+ for (const [j, child] of [...sel.nodes].reverse().entries()) {
103
+ // We only care about pseudo elements
104
+ if (child.type !== 'pseudo' || !child.value.startsWith('::')) {
105
+ break;
106
+ }
107
+ matrix[j] = matrix[j] || [];
108
+ matrix[j][i] = child;
109
+ }
110
+ }
111
+ const trailingPseudos = parser.selector();
112
+ // At this point the pseudo elements are in a column-major 2D array
113
+ // This means each row contains one "column" of pseudo elements from each selector
114
+ // We can compare all the pseudo elements in a row to see if they are the same
115
+ for (const pseudos of matrix) {
116
+ // It's a sparse 2D array so there are going to be holes in the rows
117
+ // We skip those
118
+ if (!pseudos) {
119
+ continue;
120
+ }
121
+ const values = new Set(pseudos.map((p) => p.value));
122
+ // The pseudo elements are not the same
123
+ if (values.size > 1) {
124
+ break;
125
+ }
126
+ pseudos.forEach((pseudo) => pseudo.remove());
127
+ trailingPseudos.prepend(pseudos[0]);
128
+ }
129
+ if (trailingPseudos.nodes.length) {
130
+ return [trailingPseudos.toString(), ast.toString()];
131
+ }
132
+ return [null, selector];
133
+ },
134
+ };
135
+ })();
136
+ // END UPSTREAM utils.js
137
+ // BEGIN UPSTREAM styles.js
138
+ const styles = (() => {
139
+ const round = (num) => num
140
+ .toFixed(7)
141
+ .replace(/(\.[0-9]+?)0+$/, '$1')
142
+ .replace(/\.0$/, '');
143
+ const rem = (px) => `${round(px / 16)}rem`;
144
+ const em = (px, base) => `${round(px / base)}em`;
145
+ const opacity = (color, opacity) => {
146
+ // In v3, the colors are hex encoded and a previous typography plugin version
147
+ // only handled these values. We keep the old behavior for backward
148
+ // compatibility with v3 codebases but use color-mix for any other color
149
+ // values.
150
+ let hex = color.replace('#', '');
151
+ hex = hex.length === 3 ? hex.replace(/./g, '$&$&') : hex;
152
+ const r = parseInt(hex.substring(0, 2), 16);
153
+ const g = parseInt(hex.substring(2, 4), 16);
154
+ const b = parseInt(hex.substring(4, 6), 16);
155
+ if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
156
+ return `color-mix(in oklab, ${color} ${opacity}, transparent)`;
157
+ }
158
+ return `rgb(${r} ${g} ${b} / ${opacity})`;
159
+ };
160
+ const defaultModifiers = {
161
+ sm: {
162
+ css: [
163
+ {
164
+ fontSize: rem(14),
165
+ lineHeight: round(24 / 14),
166
+ p: {
167
+ marginTop: em(16, 14),
168
+ marginBottom: em(16, 14),
169
+ },
170
+ '[class~="lead"]': {
171
+ fontSize: em(18, 14),
172
+ lineHeight: round(28 / 18),
173
+ marginTop: em(16, 18),
174
+ marginBottom: em(16, 18),
175
+ },
176
+ blockquote: {
177
+ marginTop: em(24, 18),
178
+ marginBottom: em(24, 18),
179
+ paddingInlineStart: em(20, 18),
180
+ },
181
+ h1: {
182
+ fontSize: em(30, 14),
183
+ marginTop: '0',
184
+ marginBottom: em(24, 30),
185
+ lineHeight: round(36 / 30),
186
+ },
187
+ h2: {
188
+ fontSize: em(20, 14),
189
+ marginTop: em(32, 20),
190
+ marginBottom: em(16, 20),
191
+ lineHeight: round(28 / 20),
192
+ },
193
+ h3: {
194
+ fontSize: em(18, 14),
195
+ marginTop: em(28, 18),
196
+ marginBottom: em(8, 18),
197
+ lineHeight: round(28 / 18),
198
+ },
199
+ h4: {
200
+ marginTop: em(20, 14),
201
+ marginBottom: em(8, 14),
202
+ lineHeight: round(20 / 14),
203
+ },
204
+ img: {
205
+ marginTop: em(24, 14),
206
+ marginBottom: em(24, 14),
207
+ },
208
+ picture: {
209
+ marginTop: em(24, 14),
210
+ marginBottom: em(24, 14),
211
+ },
212
+ 'picture > img': {
213
+ marginTop: '0',
214
+ marginBottom: '0',
215
+ },
216
+ video: {
217
+ marginTop: em(24, 14),
218
+ marginBottom: em(24, 14),
219
+ },
220
+ kbd: {
221
+ fontSize: em(12, 14),
222
+ borderRadius: rem(5),
223
+ paddingTop: em(2, 14),
224
+ paddingInlineEnd: em(5, 14),
225
+ paddingBottom: em(2, 14),
226
+ paddingInlineStart: em(5, 14),
227
+ },
228
+ code: {
229
+ fontSize: em(12, 14),
230
+ },
231
+ 'h2 code': {
232
+ fontSize: em(18, 20),
233
+ },
234
+ 'h3 code': {
235
+ fontSize: em(16, 18),
236
+ },
237
+ pre: {
238
+ fontSize: em(12, 14),
239
+ lineHeight: round(20 / 12),
240
+ marginTop: em(20, 12),
241
+ marginBottom: em(20, 12),
242
+ borderRadius: rem(4),
243
+ paddingTop: em(8, 12),
244
+ paddingInlineEnd: em(12, 12),
245
+ paddingBottom: em(8, 12),
246
+ paddingInlineStart: em(12, 12),
247
+ },
248
+ ol: {
249
+ marginTop: em(16, 14),
250
+ marginBottom: em(16, 14),
251
+ paddingInlineStart: em(22, 14),
252
+ },
253
+ ul: {
254
+ marginTop: em(16, 14),
255
+ marginBottom: em(16, 14),
256
+ paddingInlineStart: em(22, 14),
257
+ },
258
+ li: {
259
+ marginTop: em(4, 14),
260
+ marginBottom: em(4, 14),
261
+ },
262
+ 'ol > li': {
263
+ paddingInlineStart: em(6, 14),
264
+ },
265
+ 'ul > li': {
266
+ paddingInlineStart: em(6, 14),
267
+ },
268
+ '> ul > li p': {
269
+ marginTop: em(8, 14),
270
+ marginBottom: em(8, 14),
271
+ },
272
+ '> ul > li > p:first-child': {
273
+ marginTop: em(16, 14),
274
+ },
275
+ '> ul > li > p:last-child': {
276
+ marginBottom: em(16, 14),
277
+ },
278
+ '> ol > li > p:first-child': {
279
+ marginTop: em(16, 14),
280
+ },
281
+ '> ol > li > p:last-child': {
282
+ marginBottom: em(16, 14),
283
+ },
284
+ 'ul ul, ul ol, ol ul, ol ol': {
285
+ marginTop: em(8, 14),
286
+ marginBottom: em(8, 14),
287
+ },
288
+ dl: {
289
+ marginTop: em(16, 14),
290
+ marginBottom: em(16, 14),
291
+ },
292
+ dt: {
293
+ marginTop: em(16, 14),
294
+ },
295
+ dd: {
296
+ marginTop: em(4, 14),
297
+ paddingInlineStart: em(22, 14),
298
+ },
299
+ hr: {
300
+ marginTop: em(40, 14),
301
+ marginBottom: em(40, 14),
302
+ },
303
+ 'hr + *': {
304
+ marginTop: '0',
305
+ },
306
+ 'h2 + *': {
307
+ marginTop: '0',
308
+ },
309
+ 'h3 + *': {
310
+ marginTop: '0',
311
+ },
312
+ 'h4 + *': {
313
+ marginTop: '0',
314
+ },
315
+ table: {
316
+ fontSize: em(12, 14),
317
+ lineHeight: round(18 / 12),
318
+ },
319
+ 'thead th': {
320
+ paddingInlineEnd: em(12, 12),
321
+ paddingBottom: em(8, 12),
322
+ paddingInlineStart: em(12, 12),
323
+ },
324
+ 'thead th:first-child': {
325
+ paddingInlineStart: '0',
326
+ },
327
+ 'thead th:last-child': {
328
+ paddingInlineEnd: '0',
329
+ },
330
+ 'tbody td, tfoot td': {
331
+ paddingTop: em(8, 12),
332
+ paddingInlineEnd: em(12, 12),
333
+ paddingBottom: em(8, 12),
334
+ paddingInlineStart: em(12, 12),
335
+ },
336
+ 'tbody td:first-child, tfoot td:first-child': {
337
+ paddingInlineStart: '0',
338
+ },
339
+ 'tbody td:last-child, tfoot td:last-child': {
340
+ paddingInlineEnd: '0',
341
+ },
342
+ figure: {
343
+ marginTop: em(24, 14),
344
+ marginBottom: em(24, 14),
345
+ },
346
+ 'figure > *': {
347
+ marginTop: '0',
348
+ marginBottom: '0',
349
+ },
350
+ figcaption: {
351
+ fontSize: em(12, 14),
352
+ lineHeight: round(16 / 12),
353
+ marginTop: em(8, 12),
354
+ },
355
+ },
356
+ {
357
+ '> :first-child': {
358
+ marginTop: '0',
359
+ },
360
+ '> :last-child': {
361
+ marginBottom: '0',
362
+ },
363
+ },
364
+ ],
365
+ },
366
+ base: {
367
+ css: [
368
+ {
369
+ fontSize: rem(16),
370
+ lineHeight: round(28 / 16),
371
+ p: {
372
+ marginTop: em(20, 16),
373
+ marginBottom: em(20, 16),
374
+ },
375
+ '[class~="lead"]': {
376
+ fontSize: em(20, 16),
377
+ lineHeight: round(32 / 20),
378
+ marginTop: em(24, 20),
379
+ marginBottom: em(24, 20),
380
+ },
381
+ blockquote: {
382
+ marginTop: em(32, 20),
383
+ marginBottom: em(32, 20),
384
+ paddingInlineStart: em(20, 20),
385
+ },
386
+ h1: {
387
+ fontSize: em(36, 16),
388
+ marginTop: '0',
389
+ marginBottom: em(32, 36),
390
+ lineHeight: round(40 / 36),
391
+ },
392
+ h2: {
393
+ fontSize: em(24, 16),
394
+ marginTop: em(48, 24),
395
+ marginBottom: em(24, 24),
396
+ lineHeight: round(32 / 24),
397
+ },
398
+ h3: {
399
+ fontSize: em(20, 16),
400
+ marginTop: em(32, 20),
401
+ marginBottom: em(12, 20),
402
+ lineHeight: round(32 / 20),
403
+ },
404
+ h4: {
405
+ marginTop: em(24, 16),
406
+ marginBottom: em(8, 16),
407
+ lineHeight: round(24 / 16),
408
+ },
409
+ img: {
410
+ marginTop: em(32, 16),
411
+ marginBottom: em(32, 16),
412
+ },
413
+ picture: {
414
+ marginTop: em(32, 16),
415
+ marginBottom: em(32, 16),
416
+ },
417
+ 'picture > img': {
418
+ marginTop: '0',
419
+ marginBottom: '0',
420
+ },
421
+ video: {
422
+ marginTop: em(32, 16),
423
+ marginBottom: em(32, 16),
424
+ },
425
+ kbd: {
426
+ fontSize: em(14, 16),
427
+ borderRadius: rem(5),
428
+ paddingTop: em(3, 16),
429
+ paddingInlineEnd: em(6, 16),
430
+ paddingBottom: em(3, 16),
431
+ paddingInlineStart: em(6, 16),
432
+ },
433
+ code: {
434
+ fontSize: em(14, 16),
435
+ },
436
+ 'h2 code': {
437
+ fontSize: em(21, 24),
438
+ },
439
+ 'h3 code': {
440
+ fontSize: em(18, 20),
441
+ },
442
+ pre: {
443
+ fontSize: em(14, 16),
444
+ lineHeight: round(24 / 14),
445
+ marginTop: em(24, 14),
446
+ marginBottom: em(24, 14),
447
+ borderRadius: rem(6),
448
+ paddingTop: em(12, 14),
449
+ paddingInlineEnd: em(16, 14),
450
+ paddingBottom: em(12, 14),
451
+ paddingInlineStart: em(16, 14),
452
+ },
453
+ ol: {
454
+ marginTop: em(20, 16),
455
+ marginBottom: em(20, 16),
456
+ paddingInlineStart: em(26, 16),
457
+ },
458
+ ul: {
459
+ marginTop: em(20, 16),
460
+ marginBottom: em(20, 16),
461
+ paddingInlineStart: em(26, 16),
462
+ },
463
+ li: {
464
+ marginTop: em(8, 16),
465
+ marginBottom: em(8, 16),
466
+ },
467
+ 'ol > li': {
468
+ paddingInlineStart: em(6, 16),
469
+ },
470
+ 'ul > li': {
471
+ paddingInlineStart: em(6, 16),
472
+ },
473
+ '> ul > li p': {
474
+ marginTop: em(12, 16),
475
+ marginBottom: em(12, 16),
476
+ },
477
+ '> ul > li > p:first-child': {
478
+ marginTop: em(20, 16),
479
+ },
480
+ '> ul > li > p:last-child': {
481
+ marginBottom: em(20, 16),
482
+ },
483
+ '> ol > li > p:first-child': {
484
+ marginTop: em(20, 16),
485
+ },
486
+ '> ol > li > p:last-child': {
487
+ marginBottom: em(20, 16),
488
+ },
489
+ 'ul ul, ul ol, ol ul, ol ol': {
490
+ marginTop: em(12, 16),
491
+ marginBottom: em(12, 16),
492
+ },
493
+ dl: {
494
+ marginTop: em(20, 16),
495
+ marginBottom: em(20, 16),
496
+ },
497
+ dt: {
498
+ marginTop: em(20, 16),
499
+ },
500
+ dd: {
501
+ marginTop: em(8, 16),
502
+ paddingInlineStart: em(26, 16),
503
+ },
504
+ hr: {
505
+ marginTop: em(48, 16),
506
+ marginBottom: em(48, 16),
507
+ },
508
+ 'hr + *': {
509
+ marginTop: '0',
510
+ },
511
+ 'h2 + *': {
512
+ marginTop: '0',
513
+ },
514
+ 'h3 + *': {
515
+ marginTop: '0',
516
+ },
517
+ 'h4 + *': {
518
+ marginTop: '0',
519
+ },
520
+ table: {
521
+ fontSize: em(14, 16),
522
+ lineHeight: round(24 / 14),
523
+ },
524
+ 'thead th': {
525
+ paddingInlineEnd: em(8, 14),
526
+ paddingBottom: em(8, 14),
527
+ paddingInlineStart: em(8, 14),
528
+ },
529
+ 'thead th:first-child': {
530
+ paddingInlineStart: '0',
531
+ },
532
+ 'thead th:last-child': {
533
+ paddingInlineEnd: '0',
534
+ },
535
+ 'tbody td, tfoot td': {
536
+ paddingTop: em(8, 14),
537
+ paddingInlineEnd: em(8, 14),
538
+ paddingBottom: em(8, 14),
539
+ paddingInlineStart: em(8, 14),
540
+ },
541
+ 'tbody td:first-child, tfoot td:first-child': {
542
+ paddingInlineStart: '0',
543
+ },
544
+ 'tbody td:last-child, tfoot td:last-child': {
545
+ paddingInlineEnd: '0',
546
+ },
547
+ figure: {
548
+ marginTop: em(32, 16),
549
+ marginBottom: em(32, 16),
550
+ },
551
+ 'figure > *': {
552
+ marginTop: '0',
553
+ marginBottom: '0',
554
+ },
555
+ figcaption: {
556
+ fontSize: em(14, 16),
557
+ lineHeight: round(20 / 14),
558
+ marginTop: em(12, 14),
559
+ },
560
+ },
561
+ {
562
+ '> :first-child': {
563
+ marginTop: '0',
564
+ },
565
+ '> :last-child': {
566
+ marginBottom: '0',
567
+ },
568
+ },
569
+ ],
570
+ },
571
+ lg: {
572
+ css: [
573
+ {
574
+ fontSize: rem(18),
575
+ lineHeight: round(32 / 18),
576
+ p: {
577
+ marginTop: em(24, 18),
578
+ marginBottom: em(24, 18),
579
+ },
580
+ '[class~="lead"]': {
581
+ fontSize: em(22, 18),
582
+ lineHeight: round(32 / 22),
583
+ marginTop: em(24, 22),
584
+ marginBottom: em(24, 22),
585
+ },
586
+ blockquote: {
587
+ marginTop: em(40, 24),
588
+ marginBottom: em(40, 24),
589
+ paddingInlineStart: em(24, 24),
590
+ },
591
+ h1: {
592
+ fontSize: em(48, 18),
593
+ marginTop: '0',
594
+ marginBottom: em(40, 48),
595
+ lineHeight: round(48 / 48),
596
+ },
597
+ h2: {
598
+ fontSize: em(30, 18),
599
+ marginTop: em(56, 30),
600
+ marginBottom: em(32, 30),
601
+ lineHeight: round(40 / 30),
602
+ },
603
+ h3: {
604
+ fontSize: em(24, 18),
605
+ marginTop: em(40, 24),
606
+ marginBottom: em(16, 24),
607
+ lineHeight: round(36 / 24),
608
+ },
609
+ h4: {
610
+ marginTop: em(32, 18),
611
+ marginBottom: em(8, 18),
612
+ lineHeight: round(28 / 18),
613
+ },
614
+ img: {
615
+ marginTop: em(32, 18),
616
+ marginBottom: em(32, 18),
617
+ },
618
+ picture: {
619
+ marginTop: em(32, 18),
620
+ marginBottom: em(32, 18),
621
+ },
622
+ 'picture > img': {
623
+ marginTop: '0',
624
+ marginBottom: '0',
625
+ },
626
+ video: {
627
+ marginTop: em(32, 18),
628
+ marginBottom: em(32, 18),
629
+ },
630
+ kbd: {
631
+ fontSize: em(16, 18),
632
+ borderRadius: rem(5),
633
+ paddingTop: em(4, 18),
634
+ paddingInlineEnd: em(8, 18),
635
+ paddingBottom: em(4, 18),
636
+ paddingInlineStart: em(8, 18),
637
+ },
638
+ code: {
639
+ fontSize: em(16, 18),
640
+ },
641
+ 'h2 code': {
642
+ fontSize: em(26, 30),
643
+ },
644
+ 'h3 code': {
645
+ fontSize: em(21, 24),
646
+ },
647
+ pre: {
648
+ fontSize: em(16, 18),
649
+ lineHeight: round(28 / 16),
650
+ marginTop: em(32, 16),
651
+ marginBottom: em(32, 16),
652
+ borderRadius: rem(6),
653
+ paddingTop: em(16, 16),
654
+ paddingInlineEnd: em(24, 16),
655
+ paddingBottom: em(16, 16),
656
+ paddingInlineStart: em(24, 16),
657
+ },
658
+ ol: {
659
+ marginTop: em(24, 18),
660
+ marginBottom: em(24, 18),
661
+ paddingInlineStart: em(28, 18),
662
+ },
663
+ ul: {
664
+ marginTop: em(24, 18),
665
+ marginBottom: em(24, 18),
666
+ paddingInlineStart: em(28, 18),
667
+ },
668
+ li: {
669
+ marginTop: em(12, 18),
670
+ marginBottom: em(12, 18),
671
+ },
672
+ 'ol > li': {
673
+ paddingInlineStart: em(8, 18),
674
+ },
675
+ 'ul > li': {
676
+ paddingInlineStart: em(8, 18),
677
+ },
678
+ '> ul > li p': {
679
+ marginTop: em(16, 18),
680
+ marginBottom: em(16, 18),
681
+ },
682
+ '> ul > li > p:first-child': {
683
+ marginTop: em(24, 18),
684
+ },
685
+ '> ul > li > p:last-child': {
686
+ marginBottom: em(24, 18),
687
+ },
688
+ '> ol > li > p:first-child': {
689
+ marginTop: em(24, 18),
690
+ },
691
+ '> ol > li > p:last-child': {
692
+ marginBottom: em(24, 18),
693
+ },
694
+ 'ul ul, ul ol, ol ul, ol ol': {
695
+ marginTop: em(16, 18),
696
+ marginBottom: em(16, 18),
697
+ },
698
+ dl: {
699
+ marginTop: em(24, 18),
700
+ marginBottom: em(24, 18),
701
+ },
702
+ dt: {
703
+ marginTop: em(24, 18),
704
+ },
705
+ dd: {
706
+ marginTop: em(12, 18),
707
+ paddingInlineStart: em(28, 18),
708
+ },
709
+ hr: {
710
+ marginTop: em(56, 18),
711
+ marginBottom: em(56, 18),
712
+ },
713
+ 'hr + *': {
714
+ marginTop: '0',
715
+ },
716
+ 'h2 + *': {
717
+ marginTop: '0',
718
+ },
719
+ 'h3 + *': {
720
+ marginTop: '0',
721
+ },
722
+ 'h4 + *': {
723
+ marginTop: '0',
724
+ },
725
+ table: {
726
+ fontSize: em(16, 18),
727
+ lineHeight: round(24 / 16),
728
+ },
729
+ 'thead th': {
730
+ paddingInlineEnd: em(12, 16),
731
+ paddingBottom: em(12, 16),
732
+ paddingInlineStart: em(12, 16),
733
+ },
734
+ 'thead th:first-child': {
735
+ paddingInlineStart: '0',
736
+ },
737
+ 'thead th:last-child': {
738
+ paddingInlineEnd: '0',
739
+ },
740
+ 'tbody td, tfoot td': {
741
+ paddingTop: em(12, 16),
742
+ paddingInlineEnd: em(12, 16),
743
+ paddingBottom: em(12, 16),
744
+ paddingInlineStart: em(12, 16),
745
+ },
746
+ 'tbody td:first-child, tfoot td:first-child': {
747
+ paddingInlineStart: '0',
748
+ },
749
+ 'tbody td:last-child, tfoot td:last-child': {
750
+ paddingInlineEnd: '0',
751
+ },
752
+ figure: {
753
+ marginTop: em(32, 18),
754
+ marginBottom: em(32, 18),
755
+ },
756
+ 'figure > *': {
757
+ marginTop: '0',
758
+ marginBottom: '0',
759
+ },
760
+ figcaption: {
761
+ fontSize: em(16, 18),
762
+ lineHeight: round(24 / 16),
763
+ marginTop: em(16, 16),
764
+ },
765
+ },
766
+ {
767
+ '> :first-child': {
768
+ marginTop: '0',
769
+ },
770
+ '> :last-child': {
771
+ marginBottom: '0',
772
+ },
773
+ },
774
+ ],
775
+ },
776
+ xl: {
777
+ css: [
778
+ {
779
+ fontSize: rem(20),
780
+ lineHeight: round(36 / 20),
781
+ p: {
782
+ marginTop: em(24, 20),
783
+ marginBottom: em(24, 20),
784
+ },
785
+ '[class~="lead"]': {
786
+ fontSize: em(24, 20),
787
+ lineHeight: round(36 / 24),
788
+ marginTop: em(24, 24),
789
+ marginBottom: em(24, 24),
790
+ },
791
+ blockquote: {
792
+ marginTop: em(48, 30),
793
+ marginBottom: em(48, 30),
794
+ paddingInlineStart: em(32, 30),
795
+ },
796
+ h1: {
797
+ fontSize: em(56, 20),
798
+ marginTop: '0',
799
+ marginBottom: em(48, 56),
800
+ lineHeight: round(56 / 56),
801
+ },
802
+ h2: {
803
+ fontSize: em(36, 20),
804
+ marginTop: em(56, 36),
805
+ marginBottom: em(32, 36),
806
+ lineHeight: round(40 / 36),
807
+ },
808
+ h3: {
809
+ fontSize: em(30, 20),
810
+ marginTop: em(48, 30),
811
+ marginBottom: em(20, 30),
812
+ lineHeight: round(40 / 30),
813
+ },
814
+ h4: {
815
+ marginTop: em(36, 20),
816
+ marginBottom: em(12, 20),
817
+ lineHeight: round(32 / 20),
818
+ },
819
+ img: {
820
+ marginTop: em(40, 20),
821
+ marginBottom: em(40, 20),
822
+ },
823
+ picture: {
824
+ marginTop: em(40, 20),
825
+ marginBottom: em(40, 20),
826
+ },
827
+ 'picture > img': {
828
+ marginTop: '0',
829
+ marginBottom: '0',
830
+ },
831
+ video: {
832
+ marginTop: em(40, 20),
833
+ marginBottom: em(40, 20),
834
+ },
835
+ kbd: {
836
+ fontSize: em(18, 20),
837
+ borderRadius: rem(5),
838
+ paddingTop: em(5, 20),
839
+ paddingInlineEnd: em(8, 20),
840
+ paddingBottom: em(5, 20),
841
+ paddingInlineStart: em(8, 20),
842
+ },
843
+ code: {
844
+ fontSize: em(18, 20),
845
+ },
846
+ 'h2 code': {
847
+ fontSize: em(31, 36),
848
+ },
849
+ 'h3 code': {
850
+ fontSize: em(27, 30),
851
+ },
852
+ pre: {
853
+ fontSize: em(18, 20),
854
+ lineHeight: round(32 / 18),
855
+ marginTop: em(36, 18),
856
+ marginBottom: em(36, 18),
857
+ borderRadius: rem(8),
858
+ paddingTop: em(20, 18),
859
+ paddingInlineEnd: em(24, 18),
860
+ paddingBottom: em(20, 18),
861
+ paddingInlineStart: em(24, 18),
862
+ },
863
+ ol: {
864
+ marginTop: em(24, 20),
865
+ marginBottom: em(24, 20),
866
+ paddingInlineStart: em(32, 20),
867
+ },
868
+ ul: {
869
+ marginTop: em(24, 20),
870
+ marginBottom: em(24, 20),
871
+ paddingInlineStart: em(32, 20),
872
+ },
873
+ li: {
874
+ marginTop: em(12, 20),
875
+ marginBottom: em(12, 20),
876
+ },
877
+ 'ol > li': {
878
+ paddingInlineStart: em(8, 20),
879
+ },
880
+ 'ul > li': {
881
+ paddingInlineStart: em(8, 20),
882
+ },
883
+ '> ul > li p': {
884
+ marginTop: em(16, 20),
885
+ marginBottom: em(16, 20),
886
+ },
887
+ '> ul > li > p:first-child': {
888
+ marginTop: em(24, 20),
889
+ },
890
+ '> ul > li > p:last-child': {
891
+ marginBottom: em(24, 20),
892
+ },
893
+ '> ol > li > p:first-child': {
894
+ marginTop: em(24, 20),
895
+ },
896
+ '> ol > li > p:last-child': {
897
+ marginBottom: em(24, 20),
898
+ },
899
+ 'ul ul, ul ol, ol ul, ol ol': {
900
+ marginTop: em(16, 20),
901
+ marginBottom: em(16, 20),
902
+ },
903
+ dl: {
904
+ marginTop: em(24, 20),
905
+ marginBottom: em(24, 20),
906
+ },
907
+ dt: {
908
+ marginTop: em(24, 20),
909
+ },
910
+ dd: {
911
+ marginTop: em(12, 20),
912
+ paddingInlineStart: em(32, 20),
913
+ },
914
+ hr: {
915
+ marginTop: em(56, 20),
916
+ marginBottom: em(56, 20),
917
+ },
918
+ 'hr + *': {
919
+ marginTop: '0',
920
+ },
921
+ 'h2 + *': {
922
+ marginTop: '0',
923
+ },
924
+ 'h3 + *': {
925
+ marginTop: '0',
926
+ },
927
+ 'h4 + *': {
928
+ marginTop: '0',
929
+ },
930
+ table: {
931
+ fontSize: em(18, 20),
932
+ lineHeight: round(28 / 18),
933
+ },
934
+ 'thead th': {
935
+ paddingInlineEnd: em(12, 18),
936
+ paddingBottom: em(16, 18),
937
+ paddingInlineStart: em(12, 18),
938
+ },
939
+ 'thead th:first-child': {
940
+ paddingInlineStart: '0',
941
+ },
942
+ 'thead th:last-child': {
943
+ paddingInlineEnd: '0',
944
+ },
945
+ 'tbody td, tfoot td': {
946
+ paddingTop: em(16, 18),
947
+ paddingInlineEnd: em(12, 18),
948
+ paddingBottom: em(16, 18),
949
+ paddingInlineStart: em(12, 18),
950
+ },
951
+ 'tbody td:first-child, tfoot td:first-child': {
952
+ paddingInlineStart: '0',
953
+ },
954
+ 'tbody td:last-child, tfoot td:last-child': {
955
+ paddingInlineEnd: '0',
956
+ },
957
+ figure: {
958
+ marginTop: em(40, 20),
959
+ marginBottom: em(40, 20),
960
+ },
961
+ 'figure > *': {
962
+ marginTop: '0',
963
+ marginBottom: '0',
964
+ },
965
+ figcaption: {
966
+ fontSize: em(18, 20),
967
+ lineHeight: round(28 / 18),
968
+ marginTop: em(18, 18),
969
+ },
970
+ },
971
+ {
972
+ '> :first-child': {
973
+ marginTop: '0',
974
+ },
975
+ '> :last-child': {
976
+ marginBottom: '0',
977
+ },
978
+ },
979
+ ],
980
+ },
981
+ '2xl': {
982
+ css: [
983
+ {
984
+ fontSize: rem(24),
985
+ lineHeight: round(40 / 24),
986
+ p: {
987
+ marginTop: em(32, 24),
988
+ marginBottom: em(32, 24),
989
+ },
990
+ '[class~="lead"]': {
991
+ fontSize: em(30, 24),
992
+ lineHeight: round(44 / 30),
993
+ marginTop: em(32, 30),
994
+ marginBottom: em(32, 30),
995
+ },
996
+ blockquote: {
997
+ marginTop: em(64, 36),
998
+ marginBottom: em(64, 36),
999
+ paddingInlineStart: em(40, 36),
1000
+ },
1001
+ h1: {
1002
+ fontSize: em(64, 24),
1003
+ marginTop: '0',
1004
+ marginBottom: em(56, 64),
1005
+ lineHeight: round(64 / 64),
1006
+ },
1007
+ h2: {
1008
+ fontSize: em(48, 24),
1009
+ marginTop: em(72, 48),
1010
+ marginBottom: em(40, 48),
1011
+ lineHeight: round(52 / 48),
1012
+ },
1013
+ h3: {
1014
+ fontSize: em(36, 24),
1015
+ marginTop: em(56, 36),
1016
+ marginBottom: em(24, 36),
1017
+ lineHeight: round(44 / 36),
1018
+ },
1019
+ h4: {
1020
+ marginTop: em(40, 24),
1021
+ marginBottom: em(16, 24),
1022
+ lineHeight: round(36 / 24),
1023
+ },
1024
+ img: {
1025
+ marginTop: em(48, 24),
1026
+ marginBottom: em(48, 24),
1027
+ },
1028
+ picture: {
1029
+ marginTop: em(48, 24),
1030
+ marginBottom: em(48, 24),
1031
+ },
1032
+ 'picture > img': {
1033
+ marginTop: '0',
1034
+ marginBottom: '0',
1035
+ },
1036
+ video: {
1037
+ marginTop: em(48, 24),
1038
+ marginBottom: em(48, 24),
1039
+ },
1040
+ kbd: {
1041
+ fontSize: em(20, 24),
1042
+ borderRadius: rem(6),
1043
+ paddingTop: em(6, 24),
1044
+ paddingInlineEnd: em(8, 24),
1045
+ paddingBottom: em(6, 24),
1046
+ paddingInlineStart: em(8, 24),
1047
+ },
1048
+ code: {
1049
+ fontSize: em(20, 24),
1050
+ },
1051
+ 'h2 code': {
1052
+ fontSize: em(42, 48),
1053
+ },
1054
+ 'h3 code': {
1055
+ fontSize: em(32, 36),
1056
+ },
1057
+ pre: {
1058
+ fontSize: em(20, 24),
1059
+ lineHeight: round(36 / 20),
1060
+ marginTop: em(40, 20),
1061
+ marginBottom: em(40, 20),
1062
+ borderRadius: rem(8),
1063
+ paddingTop: em(24, 20),
1064
+ paddingInlineEnd: em(32, 20),
1065
+ paddingBottom: em(24, 20),
1066
+ paddingInlineStart: em(32, 20),
1067
+ },
1068
+ ol: {
1069
+ marginTop: em(32, 24),
1070
+ marginBottom: em(32, 24),
1071
+ paddingInlineStart: em(38, 24),
1072
+ },
1073
+ ul: {
1074
+ marginTop: em(32, 24),
1075
+ marginBottom: em(32, 24),
1076
+ paddingInlineStart: em(38, 24),
1077
+ },
1078
+ li: {
1079
+ marginTop: em(12, 24),
1080
+ marginBottom: em(12, 24),
1081
+ },
1082
+ 'ol > li': {
1083
+ paddingInlineStart: em(10, 24),
1084
+ },
1085
+ 'ul > li': {
1086
+ paddingInlineStart: em(10, 24),
1087
+ },
1088
+ '> ul > li p': {
1089
+ marginTop: em(20, 24),
1090
+ marginBottom: em(20, 24),
1091
+ },
1092
+ '> ul > li > p:first-child': {
1093
+ marginTop: em(32, 24),
1094
+ },
1095
+ '> ul > li > p:last-child': {
1096
+ marginBottom: em(32, 24),
1097
+ },
1098
+ '> ol > li > p:first-child': {
1099
+ marginTop: em(32, 24),
1100
+ },
1101
+ '> ol > li > p:last-child': {
1102
+ marginBottom: em(32, 24),
1103
+ },
1104
+ 'ul ul, ul ol, ol ul, ol ol': {
1105
+ marginTop: em(16, 24),
1106
+ marginBottom: em(16, 24),
1107
+ },
1108
+ dl: {
1109
+ marginTop: em(32, 24),
1110
+ marginBottom: em(32, 24),
1111
+ },
1112
+ dt: {
1113
+ marginTop: em(32, 24),
1114
+ },
1115
+ dd: {
1116
+ marginTop: em(12, 24),
1117
+ paddingInlineStart: em(38, 24),
1118
+ },
1119
+ hr: {
1120
+ marginTop: em(72, 24),
1121
+ marginBottom: em(72, 24),
1122
+ },
1123
+ 'hr + *': {
1124
+ marginTop: '0',
1125
+ },
1126
+ 'h2 + *': {
1127
+ marginTop: '0',
1128
+ },
1129
+ 'h3 + *': {
1130
+ marginTop: '0',
1131
+ },
1132
+ 'h4 + *': {
1133
+ marginTop: '0',
1134
+ },
1135
+ table: {
1136
+ fontSize: em(20, 24),
1137
+ lineHeight: round(28 / 20),
1138
+ },
1139
+ 'thead th': {
1140
+ paddingInlineEnd: em(12, 20),
1141
+ paddingBottom: em(16, 20),
1142
+ paddingInlineStart: em(12, 20),
1143
+ },
1144
+ 'thead th:first-child': {
1145
+ paddingInlineStart: '0',
1146
+ },
1147
+ 'thead th:last-child': {
1148
+ paddingInlineEnd: '0',
1149
+ },
1150
+ 'tbody td, tfoot td': {
1151
+ paddingTop: em(16, 20),
1152
+ paddingInlineEnd: em(12, 20),
1153
+ paddingBottom: em(16, 20),
1154
+ paddingInlineStart: em(12, 20),
1155
+ },
1156
+ 'tbody td:first-child, tfoot td:first-child': {
1157
+ paddingInlineStart: '0',
1158
+ },
1159
+ 'tbody td:last-child, tfoot td:last-child': {
1160
+ paddingInlineEnd: '0',
1161
+ },
1162
+ figure: {
1163
+ marginTop: em(48, 24),
1164
+ marginBottom: em(48, 24),
1165
+ },
1166
+ 'figure > *': {
1167
+ marginTop: '0',
1168
+ marginBottom: '0',
1169
+ },
1170
+ figcaption: {
1171
+ fontSize: em(20, 24),
1172
+ lineHeight: round(32 / 20),
1173
+ marginTop: em(20, 20),
1174
+ },
1175
+ },
1176
+ {
1177
+ '> :first-child': {
1178
+ marginTop: '0',
1179
+ },
1180
+ '> :last-child': {
1181
+ marginBottom: '0',
1182
+ },
1183
+ },
1184
+ ],
1185
+ },
1186
+ // Gray color themes
1187
+ slate: {
1188
+ css: {
1189
+ '--tw-prose-body': colors.slate[700],
1190
+ '--tw-prose-headings': colors.slate[900],
1191
+ '--tw-prose-lead': colors.slate[600],
1192
+ '--tw-prose-links': colors.slate[900],
1193
+ '--tw-prose-bold': colors.slate[900],
1194
+ '--tw-prose-counters': colors.slate[500],
1195
+ '--tw-prose-bullets': colors.slate[300],
1196
+ '--tw-prose-hr': colors.slate[200],
1197
+ '--tw-prose-quotes': colors.slate[900],
1198
+ '--tw-prose-quote-borders': colors.slate[200],
1199
+ '--tw-prose-captions': colors.slate[500],
1200
+ '--tw-prose-kbd': colors.slate[900],
1201
+ '--tw-prose-kbd-shadows': opacity(colors.slate[900], '10%'),
1202
+ '--tw-prose-code': colors.slate[900],
1203
+ '--tw-prose-pre-code': colors.slate[200],
1204
+ '--tw-prose-pre-bg': colors.slate[800],
1205
+ '--tw-prose-th-borders': colors.slate[300],
1206
+ '--tw-prose-td-borders': colors.slate[200],
1207
+ '--tw-prose-invert-body': colors.slate[300],
1208
+ '--tw-prose-invert-headings': colors.white,
1209
+ '--tw-prose-invert-lead': colors.slate[400],
1210
+ '--tw-prose-invert-links': colors.white,
1211
+ '--tw-prose-invert-bold': colors.white,
1212
+ '--tw-prose-invert-counters': colors.slate[400],
1213
+ '--tw-prose-invert-bullets': colors.slate[600],
1214
+ '--tw-prose-invert-hr': colors.slate[700],
1215
+ '--tw-prose-invert-quotes': colors.slate[100],
1216
+ '--tw-prose-invert-quote-borders': colors.slate[700],
1217
+ '--tw-prose-invert-captions': colors.slate[400],
1218
+ '--tw-prose-invert-kbd': colors.white,
1219
+ '--tw-prose-invert-kbd-shadows': opacity(colors.white, '10%'),
1220
+ '--tw-prose-invert-code': colors.white,
1221
+ '--tw-prose-invert-pre-code': colors.slate[300],
1222
+ '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
1223
+ '--tw-prose-invert-th-borders': colors.slate[600],
1224
+ '--tw-prose-invert-td-borders': colors.slate[700],
1225
+ },
1226
+ },
1227
+ gray: {
1228
+ css: {
1229
+ '--tw-prose-body': colors.gray[700],
1230
+ '--tw-prose-headings': colors.gray[900],
1231
+ '--tw-prose-lead': colors.gray[600],
1232
+ '--tw-prose-links': colors.gray[900],
1233
+ '--tw-prose-bold': colors.gray[900],
1234
+ '--tw-prose-counters': colors.gray[500],
1235
+ '--tw-prose-bullets': colors.gray[300],
1236
+ '--tw-prose-hr': colors.gray[200],
1237
+ '--tw-prose-quotes': colors.gray[900],
1238
+ '--tw-prose-quote-borders': colors.gray[200],
1239
+ '--tw-prose-captions': colors.gray[500],
1240
+ '--tw-prose-kbd': colors.gray[900],
1241
+ '--tw-prose-kbd-shadows': opacity(colors.gray[900], '10%'),
1242
+ '--tw-prose-code': colors.gray[900],
1243
+ '--tw-prose-pre-code': colors.gray[200],
1244
+ '--tw-prose-pre-bg': colors.gray[800],
1245
+ '--tw-prose-th-borders': colors.gray[300],
1246
+ '--tw-prose-td-borders': colors.gray[200],
1247
+ '--tw-prose-invert-body': colors.gray[300],
1248
+ '--tw-prose-invert-headings': colors.white,
1249
+ '--tw-prose-invert-lead': colors.gray[400],
1250
+ '--tw-prose-invert-links': colors.white,
1251
+ '--tw-prose-invert-bold': colors.white,
1252
+ '--tw-prose-invert-counters': colors.gray[400],
1253
+ '--tw-prose-invert-bullets': colors.gray[600],
1254
+ '--tw-prose-invert-hr': colors.gray[700],
1255
+ '--tw-prose-invert-quotes': colors.gray[100],
1256
+ '--tw-prose-invert-quote-borders': colors.gray[700],
1257
+ '--tw-prose-invert-captions': colors.gray[400],
1258
+ '--tw-prose-invert-kbd': colors.white,
1259
+ '--tw-prose-invert-kbd-shadows': opacity(colors.white, '10%'),
1260
+ '--tw-prose-invert-code': colors.white,
1261
+ '--tw-prose-invert-pre-code': colors.gray[300],
1262
+ '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
1263
+ '--tw-prose-invert-th-borders': colors.gray[600],
1264
+ '--tw-prose-invert-td-borders': colors.gray[700],
1265
+ },
1266
+ },
1267
+ zinc: {
1268
+ css: {
1269
+ '--tw-prose-body': colors.zinc[700],
1270
+ '--tw-prose-headings': colors.zinc[900],
1271
+ '--tw-prose-lead': colors.zinc[600],
1272
+ '--tw-prose-links': colors.zinc[900],
1273
+ '--tw-prose-bold': colors.zinc[900],
1274
+ '--tw-prose-counters': colors.zinc[500],
1275
+ '--tw-prose-bullets': colors.zinc[300],
1276
+ '--tw-prose-hr': colors.zinc[200],
1277
+ '--tw-prose-quotes': colors.zinc[900],
1278
+ '--tw-prose-quote-borders': colors.zinc[200],
1279
+ '--tw-prose-captions': colors.zinc[500],
1280
+ '--tw-prose-kbd': colors.zinc[900],
1281
+ '--tw-prose-kbd-shadows': opacity(colors.zinc[900], '10%'),
1282
+ '--tw-prose-code': colors.zinc[900],
1283
+ '--tw-prose-pre-code': colors.zinc[200],
1284
+ '--tw-prose-pre-bg': colors.zinc[800],
1285
+ '--tw-prose-th-borders': colors.zinc[300],
1286
+ '--tw-prose-td-borders': colors.zinc[200],
1287
+ '--tw-prose-invert-body': colors.zinc[300],
1288
+ '--tw-prose-invert-headings': colors.white,
1289
+ '--tw-prose-invert-lead': colors.zinc[400],
1290
+ '--tw-prose-invert-links': colors.white,
1291
+ '--tw-prose-invert-bold': colors.white,
1292
+ '--tw-prose-invert-counters': colors.zinc[400],
1293
+ '--tw-prose-invert-bullets': colors.zinc[600],
1294
+ '--tw-prose-invert-hr': colors.zinc[700],
1295
+ '--tw-prose-invert-quotes': colors.zinc[100],
1296
+ '--tw-prose-invert-quote-borders': colors.zinc[700],
1297
+ '--tw-prose-invert-captions': colors.zinc[400],
1298
+ '--tw-prose-invert-kbd': colors.white,
1299
+ '--tw-prose-invert-kbd-shadows': opacity(colors.white, '10%'),
1300
+ '--tw-prose-invert-code': colors.white,
1301
+ '--tw-prose-invert-pre-code': colors.zinc[300],
1302
+ '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
1303
+ '--tw-prose-invert-th-borders': colors.zinc[600],
1304
+ '--tw-prose-invert-td-borders': colors.zinc[700],
1305
+ },
1306
+ },
1307
+ neutral: {
1308
+ css: {
1309
+ '--tw-prose-body': colors.neutral[700],
1310
+ '--tw-prose-headings': colors.neutral[900],
1311
+ '--tw-prose-lead': colors.neutral[600],
1312
+ '--tw-prose-links': colors.neutral[900],
1313
+ '--tw-prose-bold': colors.neutral[900],
1314
+ '--tw-prose-counters': colors.neutral[500],
1315
+ '--tw-prose-bullets': colors.neutral[300],
1316
+ '--tw-prose-hr': colors.neutral[200],
1317
+ '--tw-prose-quotes': colors.neutral[900],
1318
+ '--tw-prose-quote-borders': colors.neutral[200],
1319
+ '--tw-prose-captions': colors.neutral[500],
1320
+ '--tw-prose-kbd': colors.neutral[900],
1321
+ '--tw-prose-kbd-shadows': opacity(colors.neutral[900], '10%'),
1322
+ '--tw-prose-code': colors.neutral[900],
1323
+ '--tw-prose-pre-code': colors.neutral[200],
1324
+ '--tw-prose-pre-bg': colors.neutral[800],
1325
+ '--tw-prose-th-borders': colors.neutral[300],
1326
+ '--tw-prose-td-borders': colors.neutral[200],
1327
+ '--tw-prose-invert-body': colors.neutral[300],
1328
+ '--tw-prose-invert-headings': colors.white,
1329
+ '--tw-prose-invert-lead': colors.neutral[400],
1330
+ '--tw-prose-invert-links': colors.white,
1331
+ '--tw-prose-invert-bold': colors.white,
1332
+ '--tw-prose-invert-counters': colors.neutral[400],
1333
+ '--tw-prose-invert-bullets': colors.neutral[600],
1334
+ '--tw-prose-invert-hr': colors.neutral[700],
1335
+ '--tw-prose-invert-quotes': colors.neutral[100],
1336
+ '--tw-prose-invert-quote-borders': colors.neutral[700],
1337
+ '--tw-prose-invert-captions': colors.neutral[400],
1338
+ '--tw-prose-invert-kbd': colors.white,
1339
+ '--tw-prose-invert-kbd-shadows': opacity(colors.white, '10%'),
1340
+ '--tw-prose-invert-code': colors.white,
1341
+ '--tw-prose-invert-pre-code': colors.neutral[300],
1342
+ '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
1343
+ '--tw-prose-invert-th-borders': colors.neutral[600],
1344
+ '--tw-prose-invert-td-borders': colors.neutral[700],
1345
+ },
1346
+ },
1347
+ stone: {
1348
+ css: {
1349
+ '--tw-prose-body': colors.stone[700],
1350
+ '--tw-prose-headings': colors.stone[900],
1351
+ '--tw-prose-lead': colors.stone[600],
1352
+ '--tw-prose-links': colors.stone[900],
1353
+ '--tw-prose-bold': colors.stone[900],
1354
+ '--tw-prose-counters': colors.stone[500],
1355
+ '--tw-prose-bullets': colors.stone[300],
1356
+ '--tw-prose-hr': colors.stone[200],
1357
+ '--tw-prose-quotes': colors.stone[900],
1358
+ '--tw-prose-quote-borders': colors.stone[200],
1359
+ '--tw-prose-captions': colors.stone[500],
1360
+ '--tw-prose-kbd': colors.stone[900],
1361
+ '--tw-prose-kbd-shadows': opacity(colors.stone[900], '10%'),
1362
+ '--tw-prose-code': colors.stone[900],
1363
+ '--tw-prose-pre-code': colors.stone[200],
1364
+ '--tw-prose-pre-bg': colors.stone[800],
1365
+ '--tw-prose-th-borders': colors.stone[300],
1366
+ '--tw-prose-td-borders': colors.stone[200],
1367
+ '--tw-prose-invert-body': colors.stone[300],
1368
+ '--tw-prose-invert-headings': colors.white,
1369
+ '--tw-prose-invert-lead': colors.stone[400],
1370
+ '--tw-prose-invert-links': colors.white,
1371
+ '--tw-prose-invert-bold': colors.white,
1372
+ '--tw-prose-invert-counters': colors.stone[400],
1373
+ '--tw-prose-invert-bullets': colors.stone[600],
1374
+ '--tw-prose-invert-hr': colors.stone[700],
1375
+ '--tw-prose-invert-quotes': colors.stone[100],
1376
+ '--tw-prose-invert-quote-borders': colors.stone[700],
1377
+ '--tw-prose-invert-captions': colors.stone[400],
1378
+ '--tw-prose-invert-kbd': colors.white,
1379
+ '--tw-prose-invert-kbd-shadows': opacity(colors.white, '10%'),
1380
+ '--tw-prose-invert-code': colors.white,
1381
+ '--tw-prose-invert-pre-code': colors.stone[300],
1382
+ '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
1383
+ '--tw-prose-invert-th-borders': colors.stone[600],
1384
+ '--tw-prose-invert-td-borders': colors.stone[700],
1385
+ },
1386
+ },
1387
+ // Link-only themes (for backward compatibility)
1388
+ red: {
1389
+ css: {
1390
+ '--tw-prose-links': colors.red[600],
1391
+ '--tw-prose-invert-links': colors.red[500],
1392
+ },
1393
+ },
1394
+ orange: {
1395
+ css: {
1396
+ '--tw-prose-links': colors.orange[600],
1397
+ '--tw-prose-invert-links': colors.orange[500],
1398
+ },
1399
+ },
1400
+ amber: {
1401
+ css: {
1402
+ '--tw-prose-links': colors.amber[600],
1403
+ '--tw-prose-invert-links': colors.amber[500],
1404
+ },
1405
+ },
1406
+ yellow: {
1407
+ css: {
1408
+ '--tw-prose-links': colors.yellow[600],
1409
+ '--tw-prose-invert-links': colors.yellow[500],
1410
+ },
1411
+ },
1412
+ lime: {
1413
+ css: {
1414
+ '--tw-prose-links': colors.lime[600],
1415
+ '--tw-prose-invert-links': colors.lime[500],
1416
+ },
1417
+ },
1418
+ green: {
1419
+ css: {
1420
+ '--tw-prose-links': colors.green[600],
1421
+ '--tw-prose-invert-links': colors.green[500],
1422
+ },
1423
+ },
1424
+ emerald: {
1425
+ css: {
1426
+ '--tw-prose-links': colors.emerald[600],
1427
+ '--tw-prose-invert-links': colors.emerald[500],
1428
+ },
1429
+ },
1430
+ teal: {
1431
+ css: {
1432
+ '--tw-prose-links': colors.teal[600],
1433
+ '--tw-prose-invert-links': colors.teal[500],
1434
+ },
1435
+ },
1436
+ cyan: {
1437
+ css: {
1438
+ '--tw-prose-links': colors.cyan[600],
1439
+ '--tw-prose-invert-links': colors.cyan[500],
1440
+ },
1441
+ },
1442
+ sky: {
1443
+ css: {
1444
+ '--tw-prose-links': colors.sky[600],
1445
+ '--tw-prose-invert-links': colors.sky[500],
1446
+ },
1447
+ },
1448
+ blue: {
1449
+ css: {
1450
+ '--tw-prose-links': colors.blue[600],
1451
+ '--tw-prose-invert-links': colors.blue[500],
1452
+ },
1453
+ },
1454
+ indigo: {
1455
+ css: {
1456
+ '--tw-prose-links': colors.indigo[600],
1457
+ '--tw-prose-invert-links': colors.indigo[500],
1458
+ },
1459
+ },
1460
+ violet: {
1461
+ css: {
1462
+ '--tw-prose-links': colors.violet[600],
1463
+ '--tw-prose-invert-links': colors.violet[500],
1464
+ },
1465
+ },
1466
+ purple: {
1467
+ css: {
1468
+ '--tw-prose-links': colors.purple[600],
1469
+ '--tw-prose-invert-links': colors.purple[500],
1470
+ },
1471
+ },
1472
+ fuchsia: {
1473
+ css: {
1474
+ '--tw-prose-links': colors.fuchsia[600],
1475
+ '--tw-prose-invert-links': colors.fuchsia[500],
1476
+ },
1477
+ },
1478
+ pink: {
1479
+ css: {
1480
+ '--tw-prose-links': colors.pink[600],
1481
+ '--tw-prose-invert-links': colors.pink[500],
1482
+ },
1483
+ },
1484
+ rose: {
1485
+ css: {
1486
+ '--tw-prose-links': colors.rose[600],
1487
+ '--tw-prose-invert-links': colors.rose[500],
1488
+ },
1489
+ },
1490
+ // Invert (for dark mode)
1491
+ invert: {
1492
+ css: {
1493
+ '--tw-prose-body': 'var(--tw-prose-invert-body)',
1494
+ '--tw-prose-headings': 'var(--tw-prose-invert-headings)',
1495
+ '--tw-prose-lead': 'var(--tw-prose-invert-lead)',
1496
+ '--tw-prose-links': 'var(--tw-prose-invert-links)',
1497
+ '--tw-prose-bold': 'var(--tw-prose-invert-bold)',
1498
+ '--tw-prose-counters': 'var(--tw-prose-invert-counters)',
1499
+ '--tw-prose-bullets': 'var(--tw-prose-invert-bullets)',
1500
+ '--tw-prose-hr': 'var(--tw-prose-invert-hr)',
1501
+ '--tw-prose-quotes': 'var(--tw-prose-invert-quotes)',
1502
+ '--tw-prose-quote-borders': 'var(--tw-prose-invert-quote-borders)',
1503
+ '--tw-prose-captions': 'var(--tw-prose-invert-captions)',
1504
+ '--tw-prose-kbd': 'var(--tw-prose-invert-kbd)',
1505
+ '--tw-prose-kbd-shadows': 'var(--tw-prose-invert-kbd-shadows)',
1506
+ '--tw-prose-code': 'var(--tw-prose-invert-code)',
1507
+ '--tw-prose-pre-code': 'var(--tw-prose-invert-pre-code)',
1508
+ '--tw-prose-pre-bg': 'var(--tw-prose-invert-pre-bg)',
1509
+ '--tw-prose-th-borders': 'var(--tw-prose-invert-th-borders)',
1510
+ '--tw-prose-td-borders': 'var(--tw-prose-invert-td-borders)',
1511
+ },
1512
+ },
1513
+ };
1514
+ return {
1515
+ DEFAULT: {
1516
+ css: [
1517
+ {
1518
+ color: 'var(--tw-prose-body)',
1519
+ maxWidth: '65ch',
1520
+ p: {}, // Required to maintain correct order when merging
1521
+ '[class~="lead"]': {
1522
+ color: 'var(--tw-prose-lead)',
1523
+ },
1524
+ a: {
1525
+ color: 'var(--tw-prose-links)',
1526
+ textDecoration: 'underline',
1527
+ fontWeight: '500',
1528
+ },
1529
+ strong: {
1530
+ color: 'var(--tw-prose-bold)',
1531
+ fontWeight: '600',
1532
+ },
1533
+ 'a strong': {
1534
+ color: 'inherit',
1535
+ },
1536
+ 'blockquote strong': {
1537
+ color: 'inherit',
1538
+ },
1539
+ 'thead th strong': {
1540
+ color: 'inherit',
1541
+ },
1542
+ ol: {
1543
+ listStyleType: 'decimal',
1544
+ },
1545
+ 'ol[type="A"]': {
1546
+ listStyleType: 'upper-alpha',
1547
+ },
1548
+ 'ol[type="a"]': {
1549
+ listStyleType: 'lower-alpha',
1550
+ },
1551
+ 'ol[type="A" s]': {
1552
+ listStyleType: 'upper-alpha',
1553
+ },
1554
+ 'ol[type="a" s]': {
1555
+ listStyleType: 'lower-alpha',
1556
+ },
1557
+ 'ol[type="I"]': {
1558
+ listStyleType: 'upper-roman',
1559
+ },
1560
+ 'ol[type="i"]': {
1561
+ listStyleType: 'lower-roman',
1562
+ },
1563
+ 'ol[type="I" s]': {
1564
+ listStyleType: 'upper-roman',
1565
+ },
1566
+ 'ol[type="i" s]': {
1567
+ listStyleType: 'lower-roman',
1568
+ },
1569
+ 'ol[type="1"]': {
1570
+ listStyleType: 'decimal',
1571
+ },
1572
+ ul: {
1573
+ listStyleType: 'disc',
1574
+ },
1575
+ 'ol > li::marker': {
1576
+ fontWeight: '400',
1577
+ color: 'var(--tw-prose-counters)',
1578
+ },
1579
+ 'ul > li::marker': {
1580
+ color: 'var(--tw-prose-bullets)',
1581
+ },
1582
+ dt: {
1583
+ color: 'var(--tw-prose-headings)',
1584
+ fontWeight: '600',
1585
+ },
1586
+ hr: {
1587
+ borderColor: 'var(--tw-prose-hr)',
1588
+ borderTopWidth: '1px',
1589
+ },
1590
+ blockquote: {
1591
+ fontWeight: '500',
1592
+ fontStyle: 'italic',
1593
+ color: 'var(--tw-prose-quotes)',
1594
+ borderInlineStartWidth: '0.25rem',
1595
+ borderInlineStartColor: 'var(--tw-prose-quote-borders)',
1596
+ quotes: '"\\201C""\\201D""\\2018""\\2019"',
1597
+ },
1598
+ 'blockquote p:first-of-type::before': {
1599
+ content: 'open-quote',
1600
+ },
1601
+ 'blockquote p:last-of-type::after': {
1602
+ content: 'close-quote',
1603
+ },
1604
+ h1: {
1605
+ color: 'var(--tw-prose-headings)',
1606
+ fontWeight: '800',
1607
+ },
1608
+ 'h1 strong': {
1609
+ fontWeight: '900',
1610
+ color: 'inherit',
1611
+ },
1612
+ h2: {
1613
+ color: 'var(--tw-prose-headings)',
1614
+ fontWeight: '700',
1615
+ },
1616
+ 'h2 strong': {
1617
+ fontWeight: '800',
1618
+ color: 'inherit',
1619
+ },
1620
+ h3: {
1621
+ color: 'var(--tw-prose-headings)',
1622
+ fontWeight: '600',
1623
+ },
1624
+ 'h3 strong': {
1625
+ fontWeight: '700',
1626
+ color: 'inherit',
1627
+ },
1628
+ h4: {
1629
+ color: 'var(--tw-prose-headings)',
1630
+ fontWeight: '600',
1631
+ },
1632
+ 'h4 strong': {
1633
+ fontWeight: '700',
1634
+ color: 'inherit',
1635
+ },
1636
+ img: {}, // Required to maintain correct order when merging
1637
+ picture: {
1638
+ display: 'block',
1639
+ },
1640
+ video: {}, // Required to maintain correct order when merging
1641
+ kbd: {
1642
+ fontWeight: '500',
1643
+ fontFamily: 'inherit',
1644
+ color: 'var(--tw-prose-kbd)',
1645
+ boxShadow: '0 0 0 1px var(--tw-prose-kbd-shadows), 0 3px 0 var(--tw-prose-kbd-shadows)',
1646
+ },
1647
+ code: {
1648
+ color: 'var(--tw-prose-code)',
1649
+ fontWeight: '600',
1650
+ },
1651
+ 'code::before': {
1652
+ content: '"`"',
1653
+ },
1654
+ 'code::after': {
1655
+ content: '"`"',
1656
+ },
1657
+ 'a code': {
1658
+ color: 'inherit',
1659
+ },
1660
+ 'h1 code': {
1661
+ color: 'inherit',
1662
+ },
1663
+ 'h2 code': {
1664
+ color: 'inherit',
1665
+ },
1666
+ 'h3 code': {
1667
+ color: 'inherit',
1668
+ },
1669
+ 'h4 code': {
1670
+ color: 'inherit',
1671
+ },
1672
+ 'blockquote code': {
1673
+ color: 'inherit',
1674
+ },
1675
+ 'thead th code': {
1676
+ color: 'inherit',
1677
+ },
1678
+ pre: {
1679
+ color: 'var(--tw-prose-pre-code)',
1680
+ backgroundColor: 'var(--tw-prose-pre-bg)',
1681
+ overflowX: 'auto',
1682
+ fontWeight: '400',
1683
+ },
1684
+ 'pre code': {
1685
+ backgroundColor: 'transparent',
1686
+ borderWidth: '0',
1687
+ borderRadius: '0',
1688
+ padding: '0',
1689
+ fontWeight: 'inherit',
1690
+ color: 'inherit',
1691
+ fontSize: 'inherit',
1692
+ fontFamily: 'inherit',
1693
+ lineHeight: 'inherit',
1694
+ },
1695
+ 'pre code::before': {
1696
+ content: 'none',
1697
+ },
1698
+ 'pre code::after': {
1699
+ content: 'none',
1700
+ },
1701
+ table: {
1702
+ width: '100%',
1703
+ tableLayout: 'auto',
1704
+ marginTop: em(32, 16),
1705
+ marginBottom: em(32, 16),
1706
+ },
1707
+ thead: {
1708
+ borderBottomWidth: '1px',
1709
+ borderBottomColor: 'var(--tw-prose-th-borders)',
1710
+ },
1711
+ 'thead th': {
1712
+ color: 'var(--tw-prose-headings)',
1713
+ fontWeight: '600',
1714
+ verticalAlign: 'bottom',
1715
+ },
1716
+ 'tbody tr': {
1717
+ borderBottomWidth: '1px',
1718
+ borderBottomColor: 'var(--tw-prose-td-borders)',
1719
+ },
1720
+ 'tbody tr:last-child': {
1721
+ borderBottomWidth: '0',
1722
+ },
1723
+ 'tbody td': {
1724
+ verticalAlign: 'baseline',
1725
+ },
1726
+ tfoot: {
1727
+ borderTopWidth: '1px',
1728
+ borderTopColor: 'var(--tw-prose-th-borders)',
1729
+ },
1730
+ 'tfoot td': {
1731
+ verticalAlign: 'top',
1732
+ },
1733
+ 'th, td': {
1734
+ textAlign: 'start',
1735
+ },
1736
+ 'figure > *': {}, // Required to maintain correct order when merging
1737
+ figcaption: {
1738
+ color: 'var(--tw-prose-captions)',
1739
+ },
1740
+ },
1741
+ defaultModifiers.gray.css,
1742
+ ...defaultModifiers.base.css,
1743
+ ],
1744
+ },
1745
+ ...defaultModifiers,
1746
+ };
1747
+ })();
1748
+ // END UPSTREAM styles.js
1749
+ // BEGIN UPSTREAM index.js
1750
+ const { commonTrailingPseudos, isObject, merge, castArray } = typographyUtils;
1751
+ const computed = {
1752
+ // Reserved for future "magic properties", for example:
1753
+ // bulletColor: (color) => ({ 'ul > li::before': { backgroundColor: color } }),
1754
+ };
1755
+ function inWhere(selector, { className, modifier, prefix }) {
1756
+ const prefixedNot = prefix(`.not-${className}`).slice(1);
1757
+ const selectorPrefix = selector.startsWith('>')
1758
+ ? `${modifier === 'DEFAULT' ? `.${className}` : `.${className}-${modifier}`} `
1759
+ : '';
1760
+ // Parse the selector, if every component ends in the same pseudo element(s) then move it to the end
1761
+ const [trailingPseudo, rebuiltSelector] = commonTrailingPseudos(selector);
1762
+ if (trailingPseudo) {
1763
+ return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))${trailingPseudo}`;
1764
+ }
1765
+ return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))`;
1766
+ }
1767
+ function configToCss(config = {}, { target, className, modifier, prefix }) {
1768
+ function updateSelector(k, v) {
1769
+ if (target === 'legacy') {
1770
+ return [k, v];
1771
+ }
1772
+ if (Array.isArray(v)) {
1773
+ return [k, v];
1774
+ }
1775
+ if (isObject(v)) {
1776
+ const nested = Object.values(v).some(isObject);
1777
+ if (nested) {
1778
+ return [
1779
+ inWhere(k, { className, modifier, prefix }),
1780
+ v,
1781
+ Object.fromEntries(Object.entries(v).map(([k, v]) => updateSelector(k, v))),
1782
+ ];
1783
+ }
1784
+ return [inWhere(k, { className, modifier, prefix }), v];
1785
+ }
1786
+ return [k, v];
1787
+ }
1788
+ return Object.fromEntries(Object.entries(merge({}, ...Object.keys(config)
1789
+ .filter((key) => computed[key])
1790
+ .map((key) => computed[key](config[key])), ...castArray(config.css || {}))).map(([k, v]) => updateSelector(k, v)));
1791
+ }
1792
+ /** @type {unknown} */
1793
+ const typography = plugin.withOptions(({ className = 'prose', target = 'modern' } = {}) => {
1794
+ return function ({ addVariant, addComponents, theme, prefix }) {
1795
+ const modifiers = theme('typography');
1796
+ const options = { className, prefix };
1797
+ for (let [name, ...selectors] of [
1798
+ ['headings', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'th'],
1799
+ ['h1'],
1800
+ ['h2'],
1801
+ ['h3'],
1802
+ ['h4'],
1803
+ ['h5'],
1804
+ ['h6'],
1805
+ ['p'],
1806
+ ['a'],
1807
+ ['blockquote'],
1808
+ ['figure'],
1809
+ ['figcaption'],
1810
+ ['strong'],
1811
+ ['em'],
1812
+ ['kbd'],
1813
+ ['code'],
1814
+ ['pre'],
1815
+ ['ol'],
1816
+ ['ul'],
1817
+ ['li'],
1818
+ ['dl'],
1819
+ ['dt'],
1820
+ ['dd'],
1821
+ ['table'],
1822
+ ['thead'],
1823
+ ['tr'],
1824
+ ['th'],
1825
+ ['td'],
1826
+ ['img'],
1827
+ ['picture'],
1828
+ ['video'],
1829
+ ['hr'],
1830
+ ['lead', '[class~="lead"]'],
1831
+ ]) {
1832
+ selectors = selectors.length === 0 ? [name] : selectors;
1833
+ const selector = target === 'legacy' ? selectors.map((selector) => `& ${selector}`) : selectors.join(', ');
1834
+ addVariant(`${className}-${name}`, target === 'legacy' ? selector : `& :is(${inWhere(selector, options)})`);
1835
+ }
1836
+ addComponents(Object.keys(modifiers).map((modifier) => ({
1837
+ [modifier === 'DEFAULT' ? `.${className}` : `.${className}-${modifier}`]: configToCss(modifiers[modifier], {
1838
+ target,
1839
+ className,
1840
+ modifier,
1841
+ prefix,
1842
+ }),
1843
+ })));
1844
+ };
1845
+ }, () => {
1846
+ return {
1847
+ theme: { typography: styles },
1848
+ };
1849
+ });
1850
+ export default typography;
1851
+ // END UPSTREAM index.js