opui-css 5.0.0 → 5.0.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 (114) hide show
  1. package/CHANGELOG.md +282 -276
  2. package/LICENSE +21 -21
  3. package/MIGRATING.md +127 -127
  4. package/README.md +87 -87
  5. package/astro/index.ts +46 -46
  6. package/components/AGENTS.md +248 -248
  7. package/components/Accordion/Accordion.astro +42 -42
  8. package/components/Anchor/Anchor.astro +51 -51
  9. package/components/Avatar/Avatar.astro +38 -38
  10. package/components/Badge/Badge.astro +59 -59
  11. package/components/Button/Button.astro +45 -45
  12. package/components/ButtonGroup/ButtonGroup.astro +29 -29
  13. package/components/Callout/Callout.astro +75 -75
  14. package/components/Card/Card.astro +36 -36
  15. package/components/Checkbox/Checkbox.astro +76 -76
  16. package/components/Checkbox/CheckboxInput.astro +32 -32
  17. package/components/Chip/Chip.astro +37 -37
  18. package/components/ClassicSelect/ClassicSelect.astro +83 -83
  19. package/components/DescriptionList/Description.astro +12 -12
  20. package/components/DescriptionList/DescriptionList.astro +22 -22
  21. package/components/DescriptionList/Item.astro +12 -12
  22. package/components/DescriptionList/Term.astro +12 -12
  23. package/components/DescriptionList/index.ts +12 -12
  24. package/components/Dialog/Dialog.astro +41 -41
  25. package/components/Divider/Divider.astro +17 -17
  26. package/components/Drawer/Drawer.astro +49 -49
  27. package/components/Drawer/DrawerFooter.astro +14 -14
  28. package/components/Drawer/DrawerHeader.astro +31 -31
  29. package/components/FieldDescription/FieldDescription.astro +13 -13
  30. package/components/FieldGroup/FieldGroup.astro +31 -31
  31. package/components/FieldLegend/FieldLegend.astro +15 -15
  32. package/components/FieldSet/FieldSet.astro +15 -15
  33. package/components/Form/Form.astro +15 -15
  34. package/components/IconButton/IconButton.astro +26 -26
  35. package/components/List/List.astro +36 -36
  36. package/components/ListItem/ListItem.astro +118 -118
  37. package/components/Progress/Progress.astro +41 -40
  38. package/components/Radio/Radio.astro +70 -70
  39. package/components/Radio/RadioInput.astro +24 -24
  40. package/components/Range/Range.astro +136 -136
  41. package/components/Select/Select.astro +106 -106
  42. package/components/Switch/Switch.astro +101 -101
  43. package/components/Switch/SwitchInput.astro +25 -25
  44. package/components/Table/Body.astro +13 -13
  45. package/components/Table/Cell.astro +13 -13
  46. package/components/Table/Column.astro +15 -15
  47. package/components/Table/ColumnGroup.astro +13 -13
  48. package/components/Table/Head.astro +13 -13
  49. package/components/Table/HeaderCell.astro +13 -13
  50. package/components/Table/Row.astro +13 -13
  51. package/components/Table/Table.astro +18 -18
  52. package/components/Table/index.ts +20 -20
  53. package/components/Tabs/Tabs.astro +28 -28
  54. package/components/Tabs/TabsItem.astro +47 -47
  55. package/components/Tabs/TabsPanel.astro +21 -21
  56. package/components/Tabs/TabsTab.astro +19 -19
  57. package/components/Tabs/index.ts +14 -14
  58. package/components/TextField/TextField.astro +128 -128
  59. package/components/Textarea/Textarea.astro +106 -106
  60. package/components/Toast/Toast.astro +42 -42
  61. package/components/ToggleButton/ToggleButton.astro +53 -53
  62. package/components/ToggleGroup/ToggleGroup.astro +49 -49
  63. package/components/Tooltip/Tooltip.astro +30 -30
  64. package/core/normalize.css +194 -194
  65. package/core/palette.css +59 -59
  66. package/core/utils.css +71 -71
  67. package/css/components/accordion.css +174 -174
  68. package/css/components/anchor.css +27 -27
  69. package/css/components/avatar.css +65 -65
  70. package/css/components/badge.css +107 -107
  71. package/css/components/button-group.css +179 -179
  72. package/css/components/button.css +215 -215
  73. package/css/components/callout.css +109 -109
  74. package/css/components/card.css +117 -117
  75. package/css/components/checkbox.css +205 -205
  76. package/css/components/chip.css +87 -87
  77. package/css/components/description-list.css +80 -80
  78. package/css/components/dialog.css +68 -68
  79. package/css/components/divider.css +20 -20
  80. package/css/components/drawer.css +171 -171
  81. package/css/components/form.css +146 -146
  82. package/css/components/icon-button.css +139 -139
  83. package/css/components/link.css +21 -21
  84. package/css/components/list.css +345 -345
  85. package/css/components/progress.css +102 -97
  86. package/css/components/radio.css +172 -172
  87. package/css/components/range.css +337 -337
  88. package/css/components/select.css +169 -169
  89. package/css/components/spinner.css +37 -37
  90. package/css/components/switch.css +268 -268
  91. package/css/components/table.css +179 -179
  92. package/css/components/tabs.css +83 -83
  93. package/css/components/text-field.css +450 -450
  94. package/css/components/text-input.css +64 -64
  95. package/css/components/textarea.css +24 -24
  96. package/css/components/toast.css +161 -161
  97. package/css/components/toggle-button.css +87 -87
  98. package/css/components/toggle-group.css +56 -56
  99. package/css/components/tooltip.css +67 -67
  100. package/css/components/typography.css +585 -585
  101. package/css/components.css +41 -41
  102. package/css/imports.css +16 -16
  103. package/css/js/checkbox.js +21 -21
  104. package/css/js/toast.js +94 -94
  105. package/css/theme.css +132 -132
  106. package/dist/op.css +65 -65
  107. package/dist/op.css.map +1 -1
  108. package/dist/opui.components.css +5159 -5154
  109. package/dist/opui.components.css.map +1 -1
  110. package/dist/opui.css +5668 -5663
  111. package/dist/opui.css.map +1 -1
  112. package/env.d.ts +14 -14
  113. package/open-props.css +9 -9
  114. package/package.json +81 -81
@@ -1,585 +1,585 @@
1
- @layer components.root {
2
-
3
- :where(.ui-p) {
4
- text-wrap: pretty;
5
-
6
- &.ui-small {
7
- font-size: var(--font-size-1);
8
- }
9
-
10
- &.ui-large {
11
- font-size: var(--font-size-3);
12
- }
13
- }
14
-
15
- :where(.ui-h1, .ui-h2, .ui-h3, .ui-h4, .ui-h5, .ui-h6) {
16
- color: var(--text-primary);
17
- font-weight: 700;
18
- text-wrap: pretty;
19
- }
20
-
21
- :where(.ui-h1) {
22
- font-size: var(--font-size-h1, var(--font-size-7));
23
- letter-spacing: -0.02em;
24
- line-height: 1.15;
25
- }
26
-
27
- :where(.ui-h2) {
28
- font-size: var(--font-size-h2, var(--font-size-5, 2rem));
29
- letter-spacing: -0.02em;
30
- line-height: 1.2;
31
- }
32
-
33
- :where(.ui-h3) {
34
- font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
35
- letter-spacing: -0.01em;
36
- line-height: 1.167;
37
- }
38
-
39
- :where(.ui-h4) {
40
- font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
41
- letter-spacing: -0.01em;
42
- line-height: 1.235;
43
- }
44
-
45
- :where(.ui-h5) {
46
- font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
47
- line-height: 1.334;
48
- }
49
-
50
- :where(.ui-h6) {
51
- font-size: var(--font-size-h6, var(--font-size-1, 1rem));
52
- line-height: 1;
53
- }
54
-
55
- /** Overline */
56
- :where(.ui-overline) {
57
- color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
58
- oklch(from var(--text-muted) calc(l * 0.75) c h));
59
- font-size: var(--font-size-0);
60
- font-weight: 500;
61
- letter-spacing: 0.06em;
62
- text-transform: uppercase;
63
- }
64
-
65
- :where(.ui-hgroup) {
66
- &>p {
67
- margin: 0;
68
- }
69
-
70
- &> :where(h1, h2, h3, h4, h5, h6) {
71
- margin-block: 0 0.4em;
72
- }
73
-
74
- /* First p element (overline) */
75
- &>p:first-of-type:first-child {
76
- color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
77
- oklch(from var(--text-muted) calc(l * 0.75) c h));
78
- font-size: var(--font-size-0);
79
- font-weight: 500;
80
- letter-spacing: 0.06em;
81
- text-transform: uppercase;
82
- }
83
-
84
- /* Body paragraphs after the heading */
85
- &>p:not(:first-of-type:first-child) {
86
- color: oklch(from currentColor l c h / 75%);
87
- font-size: var(--font-size-3);
88
- line-height: 1.6;
89
- }
90
-
91
- &>p+p {
92
- margin-block-start: 0.75em;
93
- }
94
- }
95
-
96
- /** Caption */
97
- :where(.ui-caption) {
98
- color: var(--text-muted);
99
- font-size: var(--font-size-0);
100
- line-height: 1.6;
101
- }
102
-
103
-
104
-
105
- /* Inline text elements — class utilities (work anywhere) */
106
- :where(.ui-u, .ui-abbr, .ui-dfn) {
107
- text-decoration: underline;
108
- text-underline-offset: 1px;
109
-
110
- @supports (-moz-appearance: none) {
111
- text-underline-offset: 2px;
112
- }
113
- }
114
-
115
- :where(.ui-abbr, .ui-dfn) {
116
- font-style: normal;
117
- text-decoration: var(--color-9) underline dotted;
118
-
119
- &[title] {
120
- cursor: help;
121
- text-underline-offset: 1px;
122
- }
123
-
124
- @supports (-moz-appearance: none) {
125
- text-underline-offset: 2px;
126
- }
127
- }
128
-
129
- :where(.ui-sup) {
130
- font-size: 0.5em;
131
- vertical-align: super;
132
- }
133
-
134
- :where(p, span).ui-small {
135
- font-size: max(0.5em, var(--font-size-0, 0.75rem));
136
- }
137
-
138
- :where(.ui-cite) {
139
- font-style: italic;
140
- }
141
-
142
- /* Code */
143
- :where(.ui-kbd) {
144
- font-family: var(--font-mono);
145
- background-color: var(--text-muted);
146
- border-color: var(--text-muted);
147
- border-radius: var(--radius-2);
148
- border-width: var(--border-size-1);
149
- color: var(--text-muted-contrast);
150
- padding: 0.1ex 0.3ex;
151
- word-break: break-word;
152
- }
153
-
154
- :where(.ui-mark) {
155
- border-radius: var(--radius-2);
156
- box-decoration-break: clone;
157
- padding: .1ex .3ex;
158
- vertical-align: baseline;
159
- }
160
-
161
- :where(.ui-s) {
162
- text-decoration: line-through;
163
- }
164
-
165
- :where(.ui-sub) {
166
- font-size: 0.75em;
167
- vertical-align: sub;
168
- }
169
-
170
- :where(.ui-del) {
171
- color: var(--color-9);
172
- text-decoration: line-through;
173
- }
174
-
175
- :where(.ui-ins) {
176
- color: var(--color-9);
177
- text-decoration: underline;
178
- text-underline-offset: 1px;
179
- }
180
-
181
- :where(.ui-var) {
182
- font-family: var(--font-mono);
183
- background-color: var(--text-muted);
184
- border-color: var(--text-muted);
185
- border-radius: var(--radius-2);
186
- border-width: var(--border-size-1);
187
- color: var(--text-muted-contrast);
188
- padding: 0.1ex 0.3ex;
189
- word-break: break-word;
190
- }
191
-
192
- :where(.ui-samp) {
193
- font-family: var(--font-mono);
194
- }
195
-
196
- /* Blockquote */
197
- :where(.ui-blockquote) {
198
- border-inline-start: var(--border-size-3) solid currentColor;
199
- padding-block: var(--size-3);
200
- padding-inline: var(--size-4);
201
-
202
- :first-child {
203
- margin-block-start: 0;
204
- }
205
-
206
- :last-child {
207
- margin-block-end: 0;
208
- }
209
-
210
- footer {
211
- color: var(--text-muted);
212
- margin-block-start: var(--size-3);
213
- }
214
- }
215
-
216
- /* Code block */
217
- :where(pre.ui-code-block) {
218
- background-color: var(--color-15);
219
- border-radius: var(--border-radius);
220
- color: var(--color-1);
221
- font-family: var(--font-mono);
222
- font-size: var(--font-size-05);
223
- max-inline-size: 100%;
224
- overflow-x: auto;
225
- padding-block: var(--size-3);
226
- padding-inline: var(--size-4);
227
- scrollbar-width: thin;
228
- white-space: pre;
229
-
230
- >code {
231
- background: none;
232
- border-radius: 0;
233
- color: inherit;
234
- font-size: inherit;
235
- padding: 0;
236
- word-break: normal;
237
- writing-mode: inherit;
238
- }
239
- }
240
-
241
- }
242
-
243
- /* Rich text */
244
- @layer components.extended {
245
- @scope (.ui-rich-text) to (.ui-not-rich-text) {
246
- a {
247
- color: var(--primary);
248
- cursor: pointer;
249
- font-size: inherit;
250
- font-weight: 700;
251
- line-height: inherit;
252
- text-decoration: underline;
253
- text-decoration-color: var(--primary);
254
- text-underline-offset: 2px;
255
-
256
- &[href] {
257
-
258
- &:hover,
259
- &:focus-visible {
260
- color: var(--primary-light);
261
- }
262
- }
263
- }
264
-
265
- /* Blockquote */
266
- blockquote {
267
- border-inline-start: var(--border-size-3) solid currentColor;
268
- font-size: inherit;
269
- line-height: inherit;
270
- padding-block: var(--size-3);
271
- padding-inline: var(--size-4);
272
-
273
- :first-child {
274
- margin-block-start: 0;
275
- }
276
-
277
- :last-child {
278
- margin-block-end: 0;
279
- }
280
-
281
- footer {
282
- color: var(--text-muted);
283
- margin-block-start: var(--size-3);
284
- }
285
- }
286
-
287
- /* Code */
288
- pre {
289
- border-radius: var(--border-radius);
290
- font-size: var(--font-size-05);
291
- margin-block: var(--size-6);
292
- max-inline-size: max-content;
293
- min-inline-size: 0;
294
- padding-block: var(--size-3);
295
- padding-inline: var(--size-4);
296
- white-space: pre;
297
- }
298
-
299
- pre:has(> code) {
300
- background-color: var(--color-15);
301
- border-radius: var(--border-radius);
302
- color: var(--color-1);
303
- max-inline-size: 100%;
304
- overflow-x: auto;
305
- scrollbar-width: thin;
306
-
307
- >code {
308
- background: none;
309
- border-radius: 0;
310
- color: inherit;
311
- font-size: inherit;
312
- padding: 0;
313
- word-break: normal;
314
- writing-mode: inherit;
315
- }
316
- }
317
-
318
-
319
- /* Text */
320
- p {
321
- font-size: inherit;
322
- line-height: inherit;
323
- margin-block: 1.25em;
324
- text-wrap: pretty;
325
- }
326
-
327
- :is(h1, h2, h3, h4, h5, h6) {
328
- color: var(--text-primary);
329
- font-weight: 700;
330
- text-wrap: pretty;
331
-
332
- &+*:not(&) {
333
- margin-block-start: 0;
334
- }
335
- }
336
-
337
- h1 {
338
- font-size: var(--font-size-h1, var(--font-size-7));
339
- letter-spacing: -0.02em;
340
- line-height: 1.1111111;
341
- margin-block: 0 0.8888889em;
342
- }
343
-
344
- h2 {
345
- font-size: var(--font-size-h2, var(--font-size-5, 2rem));
346
- letter-spacing: -0.02em;
347
- line-height: 1.3333333;
348
- margin-block: 2em 1em;
349
- }
350
-
351
- h3 {
352
- font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
353
- letter-spacing: -0.01em;
354
- line-height: 1.6;
355
- margin-block: 1.6em 0.6em;
356
- }
357
-
358
- h4 {
359
- font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
360
- letter-spacing: -0.01em;
361
- line-height: 1.5;
362
- margin-block: 1.5em 0.5em;
363
- }
364
-
365
- h5 {
366
- font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
367
- line-height: 1;
368
- margin-block: 0 var(--size-1);
369
- }
370
-
371
- h6 {
372
- font-size: var(--font-size-h6, var(--font-size-1, 1rem));
373
- line-height: 1;
374
- margin-block: 0 var(--size-1);
375
- }
376
-
377
- /** Overline */
378
- :is(.ui-overline, hgroup p:first-of-type:first-child) {
379
- color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
380
- oklch(from var(--text-muted) calc(l * 0.75) c h));
381
- font-size: var(--font-size-0);
382
- font-weight: 500;
383
- letter-spacing: 0.06em;
384
- text-transform: uppercase;
385
- }
386
-
387
- hgroup {
388
- &>p {
389
- margin: 0;
390
- }
391
-
392
- &> :where(h1, h2, h3, h4, h5, h6) {
393
- margin-block: 0 0.4em;
394
- }
395
-
396
- &+* {
397
- margin-block-start: 3em;
398
- }
399
-
400
- /* Body paragraphs after the heading */
401
- &>p:not(:first-of-type:first-child) {
402
- color: oklch(from currentColor l c h / 75%);
403
- font-size: var(--font-size-3);
404
- line-height: 1.6;
405
- }
406
-
407
- &>p+p {
408
- margin-block-start: 0.75em;
409
- }
410
- }
411
-
412
- /* Lists */
413
- ul:not([class]) {
414
- list-style-type: disc;
415
- }
416
-
417
- ol:not([class]) {
418
- list-style-type: decimal;
419
- }
420
-
421
- :where(ul, ol):not([class]) {
422
- display: grid;
423
- font-size: inherit;
424
- gap: 0.5em;
425
- line-height: inherit;
426
- margin-block-end: 1.25em;
427
- margin-block-start: 1.25em;
428
- padding-inline-start: 1.625em;
429
-
430
- li {
431
- padding-inline-start: 0.375em;
432
- }
433
- }
434
-
435
- /* Nested lists */
436
- :where(ul ul),
437
- :where(ul ol),
438
- :where(ol ul),
439
- :where(ol ol) {
440
- margin-block-end: 0.75em;
441
- margin-block-start: 0.75em;
442
- }
443
-
444
- /* Description lists */
445
- :where(dl) {
446
- font-size: inherit;
447
- line-height: inherit;
448
- margin-block-end: 1.25em;
449
- margin-block-start: 1.25em;
450
-
451
- dt {
452
- font-weight: 700;
453
- margin-block-start: 1.25em;
454
- }
455
-
456
- dd {
457
- margin-block-start: 0.5em;
458
- padding-inline-start: 1.625em;
459
- }
460
- }
461
-
462
- /* Figures */
463
- figure {
464
- display: grid;
465
- gap: var(--size-2);
466
- margin-block: var(--size-7);
467
- place-items: center;
468
-
469
- &>* {
470
- margin-block: 0;
471
- }
472
-
473
- & figcaption {
474
- font-size: var(--font-size-0);
475
- text-wrap: pretty;
476
- }
477
- }
478
-
479
- /* Remove top margin from first child */
480
- &> :first-child {
481
- margin-block-start: 0;
482
- }
483
-
484
- /* Remove bottom margin from last child */
485
- &> :last-child {
486
- margin-block-end: 0;
487
- }
488
-
489
- /* Horizontal rules */
490
- hr {
491
- &+* {
492
- margin-block-start: 0;
493
- }
494
- }
495
-
496
- /* Inline text elements */
497
- :where(ins, u, abbr, dfn) {
498
- text-decoration: underline;
499
- text-underline-offset: 1px;
500
-
501
- @supports (-moz-appearance: none) {
502
- text-underline-offset: 2px;
503
- }
504
- }
505
-
506
- :where(abbr, dfn) {
507
- font-style: normal;
508
- text-decoration: var(--color-9) underline dotted;
509
-
510
- &[title] {
511
- cursor: help;
512
- text-underline-offset: 1px;
513
- }
514
-
515
- @supports (-moz-appearance: none) {
516
- text-underline-offset: 2px;
517
- }
518
- }
519
-
520
- sup {
521
- font-size: 0.5em;
522
- vertical-align: super;
523
- }
524
-
525
- :where(del, ins) {
526
- color: var(--color-9);
527
- }
528
-
529
- small {
530
- font-size: max(0.5em, var(--font-size-0, 0.75rem));
531
- }
532
-
533
- cite {
534
- font-style: italic;
535
- }
536
-
537
- /* Code */
538
- :where(code, kbd, samp, pre) {
539
- font-family: var(--font-mono);
540
- }
541
-
542
- code {
543
- background-color: oklch(0 0 0 / 18%);
544
- border-radius: var(--border-size-3);
545
- font-size: 0.9em;
546
- padding: 0.1ex 0.3ex;
547
- }
548
-
549
- :where(kbd, var) {
550
- background-color: var(--text-muted);
551
- border-color: var(--text-muted);
552
- border-radius: var(--radius-2);
553
- border-width: var(--border-size-1);
554
- color: var(--text-muted-contrast);
555
- padding: 0.1ex 0.3ex;
556
- }
557
-
558
- :not(pre) code,
559
- kbd {
560
- word-break: break-word;
561
- }
562
-
563
- :not(pre) code {
564
- border-radius: var(--border-radius, var(--radius-2));
565
- padding: 0.5ex;
566
- writing-mode: lr;
567
- }
568
-
569
- mark {
570
- border-radius: var(--radius-2);
571
- box-decoration-break: clone;
572
- padding: .1ex .3ex;
573
- vertical-align: baseline;
574
- }
575
-
576
- s {
577
- text-decoration: line-through;
578
- }
579
-
580
- sub {
581
- font-size: 0.75em;
582
- vertical-align: sub;
583
- }
584
- }
585
- }
1
+ @layer components.root {
2
+
3
+ :where(.ui-p) {
4
+ text-wrap: pretty;
5
+
6
+ &.ui-small {
7
+ font-size: var(--font-size-1);
8
+ }
9
+
10
+ &.ui-large {
11
+ font-size: var(--font-size-3);
12
+ }
13
+ }
14
+
15
+ :where(.ui-h1, .ui-h2, .ui-h3, .ui-h4, .ui-h5, .ui-h6) {
16
+ color: var(--text-primary);
17
+ font-weight: 700;
18
+ text-wrap: pretty;
19
+ }
20
+
21
+ :where(.ui-h1) {
22
+ font-size: var(--font-size-h1, var(--font-size-7));
23
+ letter-spacing: -0.02em;
24
+ line-height: 1.15;
25
+ }
26
+
27
+ :where(.ui-h2) {
28
+ font-size: var(--font-size-h2, var(--font-size-5, 2rem));
29
+ letter-spacing: -0.02em;
30
+ line-height: 1.2;
31
+ }
32
+
33
+ :where(.ui-h3) {
34
+ font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
35
+ letter-spacing: -0.01em;
36
+ line-height: 1.167;
37
+ }
38
+
39
+ :where(.ui-h4) {
40
+ font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
41
+ letter-spacing: -0.01em;
42
+ line-height: 1.235;
43
+ }
44
+
45
+ :where(.ui-h5) {
46
+ font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
47
+ line-height: 1.334;
48
+ }
49
+
50
+ :where(.ui-h6) {
51
+ font-size: var(--font-size-h6, var(--font-size-1, 1rem));
52
+ line-height: 1;
53
+ }
54
+
55
+ /** Overline */
56
+ :where(.ui-overline) {
57
+ color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
58
+ oklch(from var(--text-muted) calc(l * 0.75) c h));
59
+ font-size: var(--font-size-0);
60
+ font-weight: 500;
61
+ letter-spacing: 0.06em;
62
+ text-transform: uppercase;
63
+ }
64
+
65
+ :where(.ui-hgroup) {
66
+ &>p {
67
+ margin: 0;
68
+ }
69
+
70
+ &> :where(h1, h2, h3, h4, h5, h6) {
71
+ margin-block: 0 0.4em;
72
+ }
73
+
74
+ /* First p element (overline) */
75
+ &>p:first-of-type:first-child {
76
+ color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
77
+ oklch(from var(--text-muted) calc(l * 0.75) c h));
78
+ font-size: var(--font-size-0);
79
+ font-weight: 500;
80
+ letter-spacing: 0.06em;
81
+ text-transform: uppercase;
82
+ }
83
+
84
+ /* Body paragraphs after the heading */
85
+ &>p:not(:first-of-type:first-child) {
86
+ color: oklch(from currentColor l c h / 75%);
87
+ font-size: var(--font-size-3);
88
+ line-height: 1.6;
89
+ }
90
+
91
+ &>p+p {
92
+ margin-block-start: 0.75em;
93
+ }
94
+ }
95
+
96
+ /** Caption */
97
+ :where(.ui-caption) {
98
+ color: var(--text-muted);
99
+ font-size: var(--font-size-0);
100
+ line-height: 1.6;
101
+ }
102
+
103
+
104
+
105
+ /* Inline text elements — class utilities (work anywhere) */
106
+ :where(.ui-u, .ui-abbr, .ui-dfn) {
107
+ text-decoration: underline;
108
+ text-underline-offset: 1px;
109
+
110
+ @supports (-moz-appearance: none) {
111
+ text-underline-offset: 2px;
112
+ }
113
+ }
114
+
115
+ :where(.ui-abbr, .ui-dfn) {
116
+ font-style: normal;
117
+ text-decoration: var(--color-9) underline dotted;
118
+
119
+ &[title] {
120
+ cursor: help;
121
+ text-underline-offset: 1px;
122
+ }
123
+
124
+ @supports (-moz-appearance: none) {
125
+ text-underline-offset: 2px;
126
+ }
127
+ }
128
+
129
+ :where(.ui-sup) {
130
+ font-size: 0.5em;
131
+ vertical-align: super;
132
+ }
133
+
134
+ :where(p, span).ui-small {
135
+ font-size: max(0.5em, var(--font-size-0, 0.75rem));
136
+ }
137
+
138
+ :where(.ui-cite) {
139
+ font-style: italic;
140
+ }
141
+
142
+ /* Code */
143
+ :where(.ui-kbd) {
144
+ font-family: var(--font-mono);
145
+ background-color: var(--text-muted);
146
+ border-color: var(--text-muted);
147
+ border-radius: var(--radius-2);
148
+ border-width: var(--border-size-1);
149
+ color: var(--text-muted-contrast);
150
+ padding: 0.1ex 0.3ex;
151
+ word-break: break-word;
152
+ }
153
+
154
+ :where(.ui-mark) {
155
+ border-radius: var(--radius-2);
156
+ box-decoration-break: clone;
157
+ padding: .1ex .3ex;
158
+ vertical-align: baseline;
159
+ }
160
+
161
+ :where(.ui-s) {
162
+ text-decoration: line-through;
163
+ }
164
+
165
+ :where(.ui-sub) {
166
+ font-size: 0.75em;
167
+ vertical-align: sub;
168
+ }
169
+
170
+ :where(.ui-del) {
171
+ color: var(--color-9);
172
+ text-decoration: line-through;
173
+ }
174
+
175
+ :where(.ui-ins) {
176
+ color: var(--color-9);
177
+ text-decoration: underline;
178
+ text-underline-offset: 1px;
179
+ }
180
+
181
+ :where(.ui-var) {
182
+ font-family: var(--font-mono);
183
+ background-color: var(--text-muted);
184
+ border-color: var(--text-muted);
185
+ border-radius: var(--radius-2);
186
+ border-width: var(--border-size-1);
187
+ color: var(--text-muted-contrast);
188
+ padding: 0.1ex 0.3ex;
189
+ word-break: break-word;
190
+ }
191
+
192
+ :where(.ui-samp) {
193
+ font-family: var(--font-mono);
194
+ }
195
+
196
+ /* Blockquote */
197
+ :where(.ui-blockquote) {
198
+ border-inline-start: var(--border-size-3) solid currentColor;
199
+ padding-block: var(--size-3);
200
+ padding-inline: var(--size-4);
201
+
202
+ :first-child {
203
+ margin-block-start: 0;
204
+ }
205
+
206
+ :last-child {
207
+ margin-block-end: 0;
208
+ }
209
+
210
+ footer {
211
+ color: var(--text-muted);
212
+ margin-block-start: var(--size-3);
213
+ }
214
+ }
215
+
216
+ /* Code block */
217
+ :where(pre.ui-code-block) {
218
+ background-color: var(--color-15);
219
+ border-radius: var(--border-radius);
220
+ color: var(--color-1);
221
+ font-family: var(--font-mono);
222
+ font-size: var(--font-size-05);
223
+ max-inline-size: 100%;
224
+ overflow-x: auto;
225
+ padding-block: var(--size-3);
226
+ padding-inline: var(--size-4);
227
+ scrollbar-width: thin;
228
+ white-space: pre;
229
+
230
+ >code {
231
+ background: none;
232
+ border-radius: 0;
233
+ color: inherit;
234
+ font-size: inherit;
235
+ padding: 0;
236
+ word-break: normal;
237
+ writing-mode: inherit;
238
+ }
239
+ }
240
+
241
+ }
242
+
243
+ /* Rich text */
244
+ @layer components.extended {
245
+ @scope (.ui-rich-text) to (.ui-not-rich-text) {
246
+ a {
247
+ color: var(--primary);
248
+ cursor: pointer;
249
+ font-size: inherit;
250
+ font-weight: 700;
251
+ line-height: inherit;
252
+ text-decoration: underline;
253
+ text-decoration-color: var(--primary);
254
+ text-underline-offset: 2px;
255
+
256
+ &[href] {
257
+
258
+ &:hover,
259
+ &:focus-visible {
260
+ color: var(--primary-light);
261
+ }
262
+ }
263
+ }
264
+
265
+ /* Blockquote */
266
+ blockquote {
267
+ border-inline-start: var(--border-size-3) solid currentColor;
268
+ font-size: inherit;
269
+ line-height: inherit;
270
+ padding-block: var(--size-3);
271
+ padding-inline: var(--size-4);
272
+
273
+ :first-child {
274
+ margin-block-start: 0;
275
+ }
276
+
277
+ :last-child {
278
+ margin-block-end: 0;
279
+ }
280
+
281
+ footer {
282
+ color: var(--text-muted);
283
+ margin-block-start: var(--size-3);
284
+ }
285
+ }
286
+
287
+ /* Code */
288
+ pre {
289
+ border-radius: var(--border-radius);
290
+ font-size: var(--font-size-05);
291
+ margin-block: var(--size-6);
292
+ max-inline-size: max-content;
293
+ min-inline-size: 0;
294
+ padding-block: var(--size-3);
295
+ padding-inline: var(--size-4);
296
+ white-space: pre;
297
+ }
298
+
299
+ pre:has(> code) {
300
+ background-color: var(--color-15);
301
+ border-radius: var(--border-radius);
302
+ color: var(--color-1);
303
+ max-inline-size: 100%;
304
+ overflow-x: auto;
305
+ scrollbar-width: thin;
306
+
307
+ >code {
308
+ background: none;
309
+ border-radius: 0;
310
+ color: inherit;
311
+ font-size: inherit;
312
+ padding: 0;
313
+ word-break: normal;
314
+ writing-mode: inherit;
315
+ }
316
+ }
317
+
318
+
319
+ /* Text */
320
+ p {
321
+ font-size: inherit;
322
+ line-height: inherit;
323
+ margin-block: 1.25em;
324
+ text-wrap: pretty;
325
+ }
326
+
327
+ :is(h1, h2, h3, h4, h5, h6) {
328
+ color: var(--text-primary);
329
+ font-weight: 700;
330
+ text-wrap: pretty;
331
+
332
+ &+*:not(&) {
333
+ margin-block-start: 0;
334
+ }
335
+ }
336
+
337
+ h1 {
338
+ font-size: var(--font-size-h1, var(--font-size-7));
339
+ letter-spacing: -0.02em;
340
+ line-height: 1.1111111;
341
+ margin-block: 0 0.8888889em;
342
+ }
343
+
344
+ h2 {
345
+ font-size: var(--font-size-h2, var(--font-size-5, 2rem));
346
+ letter-spacing: -0.02em;
347
+ line-height: 1.3333333;
348
+ margin-block: 2em 1em;
349
+ }
350
+
351
+ h3 {
352
+ font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
353
+ letter-spacing: -0.01em;
354
+ line-height: 1.6;
355
+ margin-block: 1.6em 0.6em;
356
+ }
357
+
358
+ h4 {
359
+ font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
360
+ letter-spacing: -0.01em;
361
+ line-height: 1.5;
362
+ margin-block: 1.5em 0.5em;
363
+ }
364
+
365
+ h5 {
366
+ font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
367
+ line-height: 1;
368
+ margin-block: 0 var(--size-1);
369
+ }
370
+
371
+ h6 {
372
+ font-size: var(--font-size-h6, var(--font-size-1, 1rem));
373
+ line-height: 1;
374
+ margin-block: 0 var(--size-1);
375
+ }
376
+
377
+ /** Overline */
378
+ :is(.ui-overline, hgroup p:first-of-type:first-child) {
379
+ color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
380
+ oklch(from var(--text-muted) calc(l * 0.75) c h));
381
+ font-size: var(--font-size-0);
382
+ font-weight: 500;
383
+ letter-spacing: 0.06em;
384
+ text-transform: uppercase;
385
+ }
386
+
387
+ hgroup {
388
+ &>p {
389
+ margin: 0;
390
+ }
391
+
392
+ &> :where(h1, h2, h3, h4, h5, h6) {
393
+ margin-block: 0 0.4em;
394
+ }
395
+
396
+ &+* {
397
+ margin-block-start: 3em;
398
+ }
399
+
400
+ /* Body paragraphs after the heading */
401
+ &>p:not(:first-of-type:first-child) {
402
+ color: oklch(from currentColor l c h / 75%);
403
+ font-size: var(--font-size-3);
404
+ line-height: 1.6;
405
+ }
406
+
407
+ &>p+p {
408
+ margin-block-start: 0.75em;
409
+ }
410
+ }
411
+
412
+ /* Lists */
413
+ ul:not([class]) {
414
+ list-style-type: disc;
415
+ }
416
+
417
+ ol:not([class]) {
418
+ list-style-type: decimal;
419
+ }
420
+
421
+ :where(ul, ol):not([class]) {
422
+ display: grid;
423
+ font-size: inherit;
424
+ gap: 0.5em;
425
+ line-height: inherit;
426
+ margin-block-end: 1.25em;
427
+ margin-block-start: 1.25em;
428
+ padding-inline-start: 1.625em;
429
+
430
+ li {
431
+ padding-inline-start: 0.375em;
432
+ }
433
+ }
434
+
435
+ /* Nested lists */
436
+ :where(ul ul),
437
+ :where(ul ol),
438
+ :where(ol ul),
439
+ :where(ol ol) {
440
+ margin-block-end: 0.75em;
441
+ margin-block-start: 0.75em;
442
+ }
443
+
444
+ /* Description lists */
445
+ :where(dl) {
446
+ font-size: inherit;
447
+ line-height: inherit;
448
+ margin-block-end: 1.25em;
449
+ margin-block-start: 1.25em;
450
+
451
+ dt {
452
+ font-weight: 700;
453
+ margin-block-start: 1.25em;
454
+ }
455
+
456
+ dd {
457
+ margin-block-start: 0.5em;
458
+ padding-inline-start: 1.625em;
459
+ }
460
+ }
461
+
462
+ /* Figures */
463
+ figure {
464
+ display: grid;
465
+ gap: var(--size-2);
466
+ margin-block: var(--size-7);
467
+ place-items: center;
468
+
469
+ &>* {
470
+ margin-block: 0;
471
+ }
472
+
473
+ & figcaption {
474
+ font-size: var(--font-size-0);
475
+ text-wrap: pretty;
476
+ }
477
+ }
478
+
479
+ /* Remove top margin from first child */
480
+ &> :first-child {
481
+ margin-block-start: 0;
482
+ }
483
+
484
+ /* Remove bottom margin from last child */
485
+ &> :last-child {
486
+ margin-block-end: 0;
487
+ }
488
+
489
+ /* Horizontal rules */
490
+ hr {
491
+ &+* {
492
+ margin-block-start: 0;
493
+ }
494
+ }
495
+
496
+ /* Inline text elements */
497
+ :where(ins, u, abbr, dfn) {
498
+ text-decoration: underline;
499
+ text-underline-offset: 1px;
500
+
501
+ @supports (-moz-appearance: none) {
502
+ text-underline-offset: 2px;
503
+ }
504
+ }
505
+
506
+ :where(abbr, dfn) {
507
+ font-style: normal;
508
+ text-decoration: var(--color-9) underline dotted;
509
+
510
+ &[title] {
511
+ cursor: help;
512
+ text-underline-offset: 1px;
513
+ }
514
+
515
+ @supports (-moz-appearance: none) {
516
+ text-underline-offset: 2px;
517
+ }
518
+ }
519
+
520
+ sup {
521
+ font-size: 0.5em;
522
+ vertical-align: super;
523
+ }
524
+
525
+ :where(del, ins) {
526
+ color: var(--color-9);
527
+ }
528
+
529
+ small {
530
+ font-size: max(0.5em, var(--font-size-0, 0.75rem));
531
+ }
532
+
533
+ cite {
534
+ font-style: italic;
535
+ }
536
+
537
+ /* Code */
538
+ :where(code, kbd, samp, pre) {
539
+ font-family: var(--font-mono);
540
+ }
541
+
542
+ code {
543
+ background-color: oklch(0 0 0 / 18%);
544
+ border-radius: var(--border-size-3);
545
+ font-size: 0.9em;
546
+ padding: 0.1ex 0.3ex;
547
+ }
548
+
549
+ :where(kbd, var) {
550
+ background-color: var(--text-muted);
551
+ border-color: var(--text-muted);
552
+ border-radius: var(--radius-2);
553
+ border-width: var(--border-size-1);
554
+ color: var(--text-muted-contrast);
555
+ padding: 0.1ex 0.3ex;
556
+ }
557
+
558
+ :not(pre) code,
559
+ kbd {
560
+ word-break: break-word;
561
+ }
562
+
563
+ :not(pre) code {
564
+ border-radius: var(--border-radius, var(--radius-2));
565
+ padding: 0.5ex;
566
+ writing-mode: lr;
567
+ }
568
+
569
+ mark {
570
+ border-radius: var(--radius-2);
571
+ box-decoration-break: clone;
572
+ padding: .1ex .3ex;
573
+ vertical-align: baseline;
574
+ }
575
+
576
+ s {
577
+ text-decoration: line-through;
578
+ }
579
+
580
+ sub {
581
+ font-size: 0.75em;
582
+ vertical-align: sub;
583
+ }
584
+ }
585
+ }