@editio-ui/react 0.0.0-stage → 0.1.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 (37) hide show
  1. package/dist/components/button/button.d.ts +17 -0
  2. package/dist/components/button/button.js +11 -0
  3. package/dist/components/button/index.d.ts +2 -0
  4. package/dist/components/checkbox/checkbox.d.ts +23 -0
  5. package/dist/components/checkbox/checkbox.js +19 -0
  6. package/dist/components/checkbox/index.d.ts +2 -0
  7. package/dist/components/input/index.d.ts +2 -0
  8. package/dist/components/input/input.d.ts +15 -0
  9. package/dist/components/input/input.js +14 -0
  10. package/dist/components/radio-group/index.d.ts +2 -0
  11. package/dist/components/radio-group/radio-group.d.ts +31 -0
  12. package/dist/components/radio-group/radio-group.js +47 -0
  13. package/dist/components/separator/index.d.ts +2 -0
  14. package/dist/components/separator/separator.d.ts +18 -0
  15. package/dist/components/separator/separator.js +13 -0
  16. package/dist/components/switch/index.d.ts +2 -0
  17. package/dist/components/switch/switch.d.ts +7 -0
  18. package/dist/components/switch/switch.js +12 -0
  19. package/dist/components/textarea/index.d.ts +2 -0
  20. package/dist/components/textarea/textarea.d.ts +15 -0
  21. package/dist/components/textarea/textarea.js +14 -0
  22. package/dist/editorial/backgrounds.css +201 -0
  23. package/dist/editorial/buttons.css +209 -0
  24. package/dist/editorial/choices.css +360 -0
  25. package/dist/editorial/disclosure.css +359 -0
  26. package/dist/editorial/feedback.css +272 -0
  27. package/dist/editorial/fields.css +205 -0
  28. package/dist/editorial/motion.css +184 -0
  29. package/dist/editorial/showcase.css +395 -0
  30. package/dist/editorial/tokens.css +129 -0
  31. package/dist/editorial/type.css +379 -0
  32. package/dist/editorial-fonts.css +4 -0
  33. package/dist/editorial.css +2704 -0
  34. package/dist/index.d.ts +14 -0
  35. package/dist/index.js +8 -0
  36. package/package.json +74 -4
  37. package/README.md +0 -3
@@ -0,0 +1,359 @@
1
+ /* ==========================================================================
2
+ Disclosure: things that open, close and switch. Native elements
3
+ (<details>, radios, links) plus CSS. No JavaScript.
4
+ Every piece respects prefers-reduced-motion.
5
+ ========================================================================== */
6
+
7
+ /* @variant ui/base */
8
+ /* Shared helper: hides text visually but keeps it for screen readers. */
9
+ .ed-vh {
10
+ position: absolute;
11
+ width: 1px;
12
+ height: 1px;
13
+ margin: -1px;
14
+ padding: 0;
15
+ overflow: hidden;
16
+ clip-path: inset(50%);
17
+ white-space: nowrap;
18
+ border: 0;
19
+ }
20
+ /* @end */
21
+
22
+ /* @variant disclosure/accordion */
23
+ /* Numbered accordion on <details>. Give every <details> the same name
24
+ attribute and only one stays open at a time. */
25
+ .ed-accordion {
26
+ max-width: 42rem;
27
+ margin: 0;
28
+ padding: 0;
29
+ color: var(--ed-ink);
30
+ border-top: var(--ed-thick) solid var(--ed-ink);
31
+ counter-reset: ed-acc;
32
+ }
33
+ .ed-accordion details {
34
+ border-bottom: var(--ed-hair) solid var(--ed-ink);
35
+ counter-increment: ed-acc;
36
+ interpolate-size: allow-keywords;
37
+ }
38
+ .ed-accordion summary {
39
+ display: flex;
40
+ align-items: center;
41
+ gap: 1.1rem;
42
+ padding: 1.15rem 0;
43
+ font: italic 500 1.5rem/1.15 var(--ed-font-swash);
44
+ list-style: none;
45
+ cursor: pointer;
46
+ transition: padding-left 0.35s var(--ed-ease);
47
+ }
48
+ .ed-accordion summary::-webkit-details-marker { display: none; }
49
+ .ed-accordion summary::before {
50
+ content: counter(ed-acc, decimal-leading-zero);
51
+ flex: none;
52
+ font: normal 600 0.75rem/1 var(--ed-font-mono);
53
+ letter-spacing: 0.06em;
54
+ color: var(--ed-ink-2);
55
+ }
56
+ .ed-accordion summary::after {
57
+ content: "";
58
+ flex: none;
59
+ width: 1.1rem;
60
+ height: 1.1rem;
61
+ margin-left: auto;
62
+ background:
63
+ linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
64
+ linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
65
+ transition: background-size 0.35s var(--ed-ease), transform 0.4s var(--ed-ease);
66
+ }
67
+ .ed-accordion summary:hover { padding-left: 0.5rem; }
68
+ .ed-accordion summary:focus-visible { outline: 2px solid var(--ed-accent); outline-offset: 2px; }
69
+ .ed-accordion details[open] > summary::after { background-size: 100% 2px, 2px 0; transform: rotate(180deg); }
70
+ .ed-accordion__body {
71
+ max-width: 36rem;
72
+ padding: 0 2.6rem 1.4rem;
73
+ font: 400 1.0625rem/1.6 var(--ed-font-text);
74
+ color: var(--ed-ink-2);
75
+ }
76
+ .ed-accordion__body > :first-child { margin-top: 0; }
77
+ .ed-accordion__body > :last-child { margin-bottom: 0; }
78
+ .ed-accordion details[open] .ed-accordion__body { animation: ed-acc-in 0.5s var(--ed-ease) both; }
79
+ @keyframes ed-acc-in { from { opacity: 0; transform: translateY(-0.5rem); } }
80
+ @supports selector(::details-content) {
81
+ .ed-accordion details::details-content {
82
+ block-size: 0;
83
+ overflow: clip;
84
+ transition: block-size 0.4s var(--ed-ease), content-visibility 0.4s allow-discrete;
85
+ }
86
+ .ed-accordion details[open]::details-content { block-size: auto; }
87
+ }
88
+ @media (prefers-reduced-motion: reduce) {
89
+ .ed-accordion summary,
90
+ .ed-accordion summary::after,
91
+ .ed-accordion details::details-content { transition: none; }
92
+ .ed-accordion details[open] .ed-accordion__body { animation: none; }
93
+ }
94
+ /* @end */
95
+
96
+ /* @variant disclosure/tabs */
97
+ /* Tabs from radios. The underline slides to the chosen tab and its panel
98
+ fades in. Set --ed-tabs to the number of tabs (up to six). */
99
+ .ed-tabs { --ed-tabs: 3; --ed-tab: 0; max-width: 40rem; color: var(--ed-ink); }
100
+ .ed-tabs__list { position: relative; display: grid; grid-template-columns: repeat(var(--ed-tabs), 1fr); border-bottom: var(--ed-hair) solid var(--ed-ink); }
101
+ .ed-tabs__list::after {
102
+ content: "";
103
+ position: absolute;
104
+ left: 0;
105
+ bottom: -1px;
106
+ width: calc(100% / var(--ed-tabs));
107
+ height: 4px;
108
+ background: var(--ed-accent);
109
+ transform: translateX(calc(var(--ed-tab) * 100%));
110
+ transition: transform 0.45s var(--ed-ease);
111
+ pointer-events: none;
112
+ }
113
+ .ed-tabs .ed-choice { display: block; }
114
+ .ed-tabs .ed-radio[data-variant="slide"] { width: 100%; height: 100%; border: 0; border-radius: 0; opacity: 0; }
115
+ .ed-tabs .ed-radio[data-variant="slide"] + span {
116
+ display: block;
117
+ padding: 0.95em 0.4em 0.9em;
118
+ text-align: center;
119
+ font: 800 0.8125rem/1 var(--ed-font-display);
120
+ font-stretch: 105%;
121
+ letter-spacing: 0.1em;
122
+ text-transform: uppercase;
123
+ color: var(--ed-ink-2);
124
+ transition: color 0.25s;
125
+ }
126
+ .ed-tabs .ed-choice:hover > .ed-radio[data-variant="slide"] + span,
127
+ .ed-tabs .ed-radio[data-variant="slide"]:checked + span { color: var(--ed-ink); }
128
+ .ed-tabs__panel { display: none; padding-top: 1.5rem; font: 400 1.0625rem/1.6 var(--ed-font-text); }
129
+ .ed-tabs__panel > :first-child { margin-top: 0; }
130
+ .ed-tabs__panel > :last-child { margin-bottom: 0; }
131
+
132
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(1) input:checked) { --ed-tab: 0; }
133
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(2) input:checked) { --ed-tab: 1; }
134
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(3) input:checked) { --ed-tab: 2; }
135
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(4) input:checked) { --ed-tab: 3; }
136
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(5) input:checked) { --ed-tab: 4; }
137
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(6) input:checked) { --ed-tab: 5; }
138
+
139
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(1) input:checked) > .ed-tabs__panel:nth-child(2),
140
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(2) input:checked) > .ed-tabs__panel:nth-child(3),
141
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(3) input:checked) > .ed-tabs__panel:nth-child(4),
142
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(4) input:checked) > .ed-tabs__panel:nth-child(5),
143
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(5) input:checked) > .ed-tabs__panel:nth-child(6),
144
+ .ed-tabs:has(.ed-tabs__list .ed-choice:nth-child(6) input:checked) > .ed-tabs__panel:nth-child(7) {
145
+ display: block;
146
+ animation: ed-tab-in 0.5s var(--ed-ease) both;
147
+ }
148
+ @keyframes ed-tab-in { from { opacity: 0; transform: translateY(0.6rem); } }
149
+ /* Without :has() every panel stays visible rather than hiding the content. */
150
+ @supports not selector(:has(*)) { .ed-tabs__panel { display: block; } }
151
+ @media (prefers-reduced-motion: reduce) {
152
+ .ed-tabs__list::after { transition: none; }
153
+ .ed-tabs__panel { animation: none !important; }
154
+ }
155
+ /* @end */
156
+
157
+ /* @variant disclosure/tooltip */
158
+ /* Tooltip from a data-tip attribute. Wrap the trigger in .ed-tip. Shows on hover
159
+ and keyboard focus. Keep it to short hints: it is not read as a description. */
160
+ .ed-tip { position: relative; display: inline-flex; }
161
+ .ed-tip::before,
162
+ .ed-tip::after {
163
+ position: absolute;
164
+ left: 50%;
165
+ z-index: 5;
166
+ opacity: 0;
167
+ pointer-events: none;
168
+ translate: -50% 0.35rem;
169
+ transition: opacity 0.2s, translate 0.3s var(--ed-ease);
170
+ }
171
+ .ed-tip::after {
172
+ content: attr(data-tip);
173
+ bottom: calc(100% + 0.7rem);
174
+ width: max-content;
175
+ max-width: 16rem;
176
+ padding: 0.6em 0.8em 0.55em;
177
+ font: 500 0.6875rem/1.35 var(--ed-font-mono);
178
+ letter-spacing: 0.04em;
179
+ text-align: center;
180
+ color: var(--ed-paper);
181
+ background: var(--ed-ink);
182
+ border-radius: var(--ed-radius);
183
+ }
184
+ .ed-tip::before {
185
+ content: "";
186
+ bottom: calc(100% + 0.3rem);
187
+ border: 0.4rem solid transparent;
188
+ border-bottom: 0;
189
+ border-top-color: var(--ed-ink);
190
+ }
191
+ .ed-tip:hover::before, .ed-tip:hover::after,
192
+ .ed-tip:focus-within::before, .ed-tip:focus-within::after { opacity: 1; translate: -50% 0; transition-delay: 0.1s; }
193
+ .ed-tip[data-side="bottom"]::after { bottom: auto; top: calc(100% + 0.7rem); }
194
+ .ed-tip[data-side="bottom"]::before { bottom: auto; top: calc(100% + 0.3rem); border-top: 0; border-bottom: 0.4rem solid var(--ed-ink); border-top-color: transparent; }
195
+ /* Inline glossary term. Give it tabindex="0" so keyboards can reach it. */
196
+ .ed-tip[data-inline] { display: inline; cursor: help; border-bottom: 1.5px dotted currentColor; }
197
+ @media (prefers-reduced-motion: reduce) { .ed-tip::before, .ed-tip::after { transition: opacity 0.1s; translate: -50% 0; } }
198
+ /* @end */
199
+
200
+ /* @variant disclosure/dropdown */
201
+ /* Dropdown menu on <details>. The panel wipes open and its links rise in turn.
202
+ Style the summary with any .ed-btn variant. */
203
+ .ed-drop { position: relative; display: inline-block; color: var(--ed-ink); }
204
+ .ed-drop > summary { list-style: none; }
205
+ .ed-drop > summary::-webkit-details-marker { display: none; }
206
+ .ed-drop__panel {
207
+ position: absolute;
208
+ top: calc(100% + 0.7rem);
209
+ left: 0;
210
+ z-index: 10;
211
+ min-width: 15rem;
212
+ margin: 0;
213
+ padding: 0.35rem 0;
214
+ list-style: none;
215
+ background: var(--ed-paper);
216
+ border: 1.5px solid var(--ed-ink);
217
+ box-shadow: 5px 5px 0 var(--ed-accent);
218
+ animation: ed-drop-in 0.4s var(--ed-ease) both;
219
+ }
220
+ .ed-drop__panel a {
221
+ display: flex;
222
+ align-items: baseline;
223
+ justify-content: space-between;
224
+ gap: 1.5rem;
225
+ padding: 0.8rem 1rem;
226
+ font: 700 0.8125rem/1 var(--ed-font-display);
227
+ letter-spacing: 0.08em;
228
+ text-transform: uppercase;
229
+ text-decoration: none;
230
+ color: inherit;
231
+ background: linear-gradient(var(--ed-ink), var(--ed-ink)) 0 0 / 0 100% no-repeat;
232
+ transition: background-size 0.3s var(--ed-ease), color 0.3s;
233
+ }
234
+ .ed-drop__panel a:hover,
235
+ .ed-drop__panel a:focus-visible { color: var(--ed-paper); background-size: 100% 100%; outline: none; }
236
+ .ed-drop__panel small { font: 500 0.6875rem/1 var(--ed-font-mono); letter-spacing: 0.04em; opacity: 0.7; }
237
+ .ed-drop__panel li { animation: ed-rise-in 0.45s var(--ed-ease) both; }
238
+ .ed-drop__panel li:nth-child(1) { animation-delay: 0.05s; }
239
+ .ed-drop__panel li:nth-child(2) { animation-delay: 0.1s; }
240
+ .ed-drop__panel li:nth-child(3) { animation-delay: 0.15s; }
241
+ .ed-drop__panel li:nth-child(4) { animation-delay: 0.2s; }
242
+ .ed-drop__panel li:nth-child(5) { animation-delay: 0.25s; }
243
+ .ed-drop__panel li:nth-child(6) { animation-delay: 0.3s; }
244
+ @keyframes ed-drop-in { from { opacity: 0; clip-path: inset(0 -8px 100% -8px); } to { opacity: 1; clip-path: inset(0 -8px -8px -8px); } }
245
+ @keyframes ed-rise-in { from { opacity: 0; transform: translateY(0.5rem); } }
246
+ @media (prefers-reduced-motion: reduce) { .ed-drop__panel, .ed-drop__panel li { animation: none; } .ed-drop__panel a { transition: none; } }
247
+ /* @end */
248
+
249
+ /* @variant disclosure/redact */
250
+ /* Redaction bar. Wipes away on hover, focus or tap. Add tabindex="0".
251
+ The text is always in the page, so do not use it to hide anything private. */
252
+ .ed-redact { position: relative; display: inline-block; cursor: pointer; }
253
+ .ed-redact::after {
254
+ content: "";
255
+ position: absolute;
256
+ inset: 0.08em -0.14em 0.02em;
257
+ background: var(--ed-ink);
258
+ transform-origin: right center;
259
+ transition: transform 0.6s var(--ed-ease);
260
+ pointer-events: none;
261
+ }
262
+ .ed-redact:hover::after,
263
+ .ed-redact:focus::after { transform: scaleX(0); }
264
+ .ed-redact:focus-visible { outline: 2px solid var(--ed-accent); outline-offset: 3px; }
265
+ @media (prefers-reduced-motion: reduce) { .ed-redact::after { transition: none; } }
266
+ /* @end */
267
+
268
+ /* @variant disclosure/more */
269
+ /* "Continue reading" on <details>. The teaser fades out while closed and
270
+ the label and arrow swap when open. */
271
+ .ed-more { max-width: 36rem; color: var(--ed-ink); font: 400 1.0625rem/1.6 var(--ed-font-text); }
272
+ .ed-more p { margin: 0 0 1em; }
273
+ .ed-more:has(details:not([open])) > p:first-child {
274
+ -webkit-mask-image: linear-gradient(#000 45%, transparent);
275
+ mask-image: linear-gradient(#000 45%, transparent);
276
+ }
277
+ .ed-more summary {
278
+ display: inline-flex;
279
+ align-items: center;
280
+ gap: 0.6em;
281
+ padding: 0.5em 0;
282
+ font: 800 0.75rem/1 var(--ed-font-display);
283
+ letter-spacing: 0.12em;
284
+ text-transform: uppercase;
285
+ list-style: none;
286
+ cursor: pointer;
287
+ background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
288
+ transition: background-size 0.3s var(--ed-ease);
289
+ }
290
+ .ed-more summary::-webkit-details-marker { display: none; }
291
+ .ed-more summary::after {
292
+ content: "";
293
+ width: 1.1em;
294
+ height: 1.1em;
295
+ background: currentColor;
296
+ -webkit-mask: var(--ed-i-arrow) center / contain no-repeat;
297
+ mask: var(--ed-i-arrow) center / contain no-repeat;
298
+ transform: rotate(90deg);
299
+ transition: transform 0.45s var(--ed-ease);
300
+ }
301
+ .ed-more summary:hover { background-size: 100% 5px; }
302
+ .ed-more summary:focus-visible { outline: 2px solid var(--ed-accent); outline-offset: 4px; }
303
+ .ed-more details[open] > summary::after { transform: rotate(-90deg); }
304
+ .ed-more details:not([open]) .ed-more__close,
305
+ .ed-more details[open] .ed-more__open { display: none; }
306
+ .ed-more details[open] > :not(summary) { animation: ed-more-in 0.55s var(--ed-ease) both; }
307
+ .ed-more details > summary + p { margin-top: 1em; }
308
+ @keyframes ed-more-in { from { opacity: 0; transform: translateY(0.5rem); } }
309
+ @media (prefers-reduced-motion: reduce) { .ed-more summary::after { transition: none; } .ed-more details[open] > :not(summary) { animation: none; } }
310
+ /* @end */
311
+
312
+ /* @variant radios/segment */
313
+ /* Segmented control. A solid block slides to the chosen segment.
314
+ Set --ed-seg to the number of segments (up to six). */
315
+ .ed-segment {
316
+ --ed-seg: 3;
317
+ --ed-i: 0;
318
+ position: relative;
319
+ display: inline-grid;
320
+ grid-template-columns: repeat(var(--ed-seg), 1fr);
321
+ color: var(--ed-ink);
322
+ border: 1.5px solid var(--ed-ink);
323
+ border-radius: var(--ed-radius);
324
+ isolation: isolate;
325
+ }
326
+ .ed-segment::before {
327
+ content: "";
328
+ position: absolute;
329
+ z-index: -1;
330
+ inset: 0 auto 0 0;
331
+ width: calc(100% / var(--ed-seg));
332
+ background: var(--ed-ink);
333
+ border-radius: calc(var(--ed-radius) - 1px);
334
+ transform: translateX(calc(var(--ed-i) * 100%));
335
+ transition: transform 0.45s var(--ed-ease);
336
+ }
337
+ .ed-segment .ed-choice { display: block; }
338
+ .ed-segment .ed-radio[data-variant="segment"] { width: 100%; height: 100%; border: 0; border-radius: 0; opacity: 0; }
339
+ .ed-segment .ed-radio[data-variant="segment"] + span {
340
+ display: block;
341
+ padding: 0.9em 1.3em;
342
+ text-align: center;
343
+ font: 800 0.75rem/1 var(--ed-font-display);
344
+ font-stretch: 105%;
345
+ letter-spacing: 0.1em;
346
+ text-transform: uppercase;
347
+ white-space: nowrap;
348
+ color: var(--ed-ink);
349
+ transition: color 0.3s;
350
+ }
351
+ .ed-segment .ed-radio[data-variant="segment"]:checked + span { color: var(--ed-paper); }
352
+ .ed-segment:has(.ed-choice:nth-child(1) input:checked) { --ed-i: 0; }
353
+ .ed-segment:has(.ed-choice:nth-child(2) input:checked) { --ed-i: 1; }
354
+ .ed-segment:has(.ed-choice:nth-child(3) input:checked) { --ed-i: 2; }
355
+ .ed-segment:has(.ed-choice:nth-child(4) input:checked) { --ed-i: 3; }
356
+ .ed-segment:has(.ed-choice:nth-child(5) input:checked) { --ed-i: 4; }
357
+ .ed-segment:has(.ed-choice:nth-child(6) input:checked) { --ed-i: 5; }
358
+ @media (prefers-reduced-motion: reduce) { .ed-segment::before { transition: none; } }
359
+ /* @end */
@@ -0,0 +1,272 @@
1
+ /* ==========================================================================
2
+ Feedback: notices, progress and loading states. Plain elements, one
3
+ class each. Motion stops under prefers-reduced-motion.
4
+ ========================================================================== */
5
+
6
+ /* @variant feedback/note */
7
+ /* Editor's note. A heavy rule draws down the side when it appears.
8
+ data-tone: correction, solid. */
9
+ .ed-note {
10
+ position: relative;
11
+ max-width: 36rem;
12
+ padding: 1.05rem 1.25rem 1.15rem 1.65rem;
13
+ color: var(--ed-ink);
14
+ background: var(--ed-paper-2);
15
+ }
16
+ .ed-note::before {
17
+ content: "";
18
+ position: absolute;
19
+ inset: 0 auto 0 0;
20
+ width: 5px;
21
+ background: var(--ed-accent);
22
+ transform-origin: top;
23
+ animation: ed-note-draw 0.7s var(--ed-ease) both;
24
+ }
25
+ .ed-note__label {
26
+ display: flex;
27
+ align-items: center;
28
+ gap: 0.65em;
29
+ margin: 0 0 0.55rem;
30
+ font: 700 0.6875rem/1 var(--ed-font-mono);
31
+ letter-spacing: 0.12em;
32
+ text-transform: uppercase;
33
+ }
34
+ .ed-note__label::before { content: ""; width: 0.5rem; height: 0.5rem; background: currentColor; rotate: 45deg; }
35
+ .ed-note p:not(.ed-note__label) { margin: 0; font: 400 1.0625rem/1.55 var(--ed-font-text); }
36
+ .ed-note[data-tone="correction"]::before { background: var(--ed-hot); }
37
+ .ed-note[data-tone="solid"] { color: var(--ed-paper); background: var(--ed-ink); }
38
+ @keyframes ed-note-draw { from { transform: scaleY(0); } }
39
+ @media (prefers-reduced-motion: reduce) { .ed-note::before { animation: none; } }
40
+ /* @end */
41
+
42
+ /* @variant feedback/live */
43
+ /* Live banner. The dot gives off a ring every couple of seconds. */
44
+ .ed-live {
45
+ display: flex;
46
+ flex-wrap: wrap;
47
+ align-items: center;
48
+ gap: 0.5rem 1.1rem;
49
+ padding: 0.75rem 1.1rem;
50
+ color: var(--ed-paper);
51
+ background: var(--ed-ink);
52
+ }
53
+ .ed-live__tag {
54
+ display: inline-flex;
55
+ align-items: center;
56
+ gap: 0.6em;
57
+ font: 800 0.6875rem/1 var(--ed-font-display);
58
+ letter-spacing: 0.16em;
59
+ text-transform: uppercase;
60
+ }
61
+ .ed-live__tag::before {
62
+ content: "";
63
+ width: 0.6rem;
64
+ height: 0.6rem;
65
+ border-radius: 50%;
66
+ background: var(--ed-accent);
67
+ animation: ed-live-ring 1.9s ease-out infinite;
68
+ }
69
+ .ed-live__text { flex: 1; min-width: 12rem; margin: 0; font: 600 0.95rem/1.3 var(--ed-font-text); }
70
+ .ed-live a { color: inherit; text-underline-offset: 0.2em; }
71
+ .ed-live time { font: 500 0.6875rem/1 var(--ed-font-mono); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
72
+ @keyframes ed-live-ring { 0% { box-shadow: 0 0 0 0 var(--ed-accent); } 70%, 100% { box-shadow: 0 0 0 0.7rem transparent; } }
73
+ @media (prefers-reduced-motion: reduce) { .ed-live__tag::before { animation: none; } }
74
+ /* @end */
75
+
76
+ /* @variant feedback/toast */
77
+ /* Toast. Rises in, waits, leaves, with a hairline counting down. It pauses
78
+ while hovered or focused. Remove "infinite" in real use: one run is enough. */
79
+ .ed-toast {
80
+ position: relative;
81
+ display: grid;
82
+ grid-template-columns: auto 1fr auto;
83
+ align-items: center;
84
+ gap: 0.9rem;
85
+ width: min(100%, 25rem);
86
+ padding: 1rem 1.15rem 1.2rem;
87
+ overflow: hidden;
88
+ color: var(--ed-paper);
89
+ background: var(--ed-ink);
90
+ box-shadow: 5px 5px 0 var(--ed-accent);
91
+ animation: ed-toast 7s var(--ed-ease) var(--ed-loop, 1) both;
92
+ }
93
+ .ed-toast::before { content: ""; width: 0.55rem; height: 0.55rem; background: var(--ed-accent); rotate: 45deg; }
94
+ .ed-toast::after {
95
+ content: "";
96
+ position: absolute;
97
+ inset: auto 0 0;
98
+ height: 3px;
99
+ background: var(--ed-accent);
100
+ transform-origin: left;
101
+ animation: ed-toast-bar 7s linear var(--ed-loop, 1) both;
102
+ }
103
+ .ed-toast p { margin: 0; font: 500 0.9375rem/1.35 var(--ed-font-text); }
104
+ .ed-toast b { display: block; font: 800 0.6875rem/1.2 var(--ed-font-display); letter-spacing: 0.14em; text-transform: uppercase; }
105
+ .ed-toast button {
106
+ padding: 0.3em 0;
107
+ font: 700 0.6875rem/1 var(--ed-font-mono);
108
+ letter-spacing: 0.08em;
109
+ text-transform: uppercase;
110
+ color: inherit;
111
+ background: none;
112
+ border: 0;
113
+ border-bottom: 1.5px solid currentColor;
114
+ cursor: pointer;
115
+ }
116
+ .ed-toast button:focus-visible { outline: 2px solid var(--ed-accent); outline-offset: 3px; }
117
+ .ed-toast:hover, .ed-toast:hover::after,
118
+ .ed-toast:focus-within, .ed-toast:focus-within::after { animation-play-state: paused; }
119
+ @keyframes ed-toast {
120
+ 0% { opacity: 0; transform: translateY(1.2rem); }
121
+ 6%, 90% { opacity: 1; transform: none; }
122
+ 100% { opacity: 0; transform: translateY(0.6rem); visibility: hidden; }
123
+ }
124
+ @keyframes ed-toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
125
+ @media (prefers-reduced-motion: reduce) { .ed-toast, .ed-toast::after { animation: none; } }
126
+ /* @end */
127
+
128
+ /* @variant feedback/progress */
129
+ /* Progress bar on a plain element with role="progressbar". Set --v from 0 to
130
+ 100. data-state="busy" is the unknown-length version: drop the aria-value
131
+ attributes and it slides back and forth. */
132
+ .ed-meter { display: grid; gap: 0.55rem; max-width: 28rem; color: var(--ed-ink); }
133
+ .ed-meter__row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; font: 600 0.75rem/1 var(--ed-font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
134
+ .ed-bar { --v: 64; position: relative; height: 0.95rem; overflow: hidden; border: 1.5px solid currentColor; border-radius: var(--ed-radius); }
135
+ .ed-bar > span {
136
+ position: absolute;
137
+ inset: 0;
138
+ background: linear-gradient(135deg, var(--ed-ink) 25%, color-mix(in srgb, var(--ed-ink) 65%, var(--ed-paper)) 25% 50%, var(--ed-ink) 50% 75%, color-mix(in srgb, var(--ed-ink) 65%, var(--ed-paper)) 75%) 0 0 / 0.9rem 0.9rem;
139
+ clip-path: inset(0 calc(100% - var(--v) * 1%) 0 0);
140
+ animation: ed-bar-grow 1.2s var(--ed-ease) both, ed-bar-run 0.9s linear infinite;
141
+ }
142
+ .ed-bar[data-state="busy"] > span { width: 34%; clip-path: none; animation: ed-bar-slide 1.5s var(--ed-ease) infinite alternate, ed-bar-run 0.9s linear infinite; }
143
+ @keyframes ed-bar-grow { from { clip-path: inset(0 100% 0 0); } }
144
+ @keyframes ed-bar-run { to { background-position: 0.9rem 0; } }
145
+ @keyframes ed-bar-slide { from { transform: translateX(0); } to { transform: translateX(194%); } }
146
+ @media (prefers-reduced-motion: reduce) { .ed-bar > span { animation: none; } }
147
+ /* @end */
148
+
149
+ /* @variant feedback/reading */
150
+ /* Reading progress. The bar is driven by scroll with CSS alone. Browsers
151
+ without scroll-driven animations simply do not draw it. Add data-page to
152
+ pin it to the top of the window instead of a scroll box. */
153
+ .ed-reader { position: relative; max-height: 17rem; overflow-y: auto; color: var(--ed-ink); border: var(--ed-hair) solid var(--ed-ink); }
154
+ .ed-reader:focus-visible { outline: 2px solid var(--ed-accent); outline-offset: 3px; }
155
+ .ed-reader__bar { position: sticky; top: 0; z-index: 2; height: 4px; margin-bottom: -4px; background: var(--ed-accent); transform: scaleX(0); transform-origin: left; }
156
+ .ed-reader__body { padding: 1.1rem 1.25rem 1.4rem; font: 400 1.0625rem/1.6 var(--ed-font-text); }
157
+ .ed-reader__body > :first-child { margin-top: 0; }
158
+ .ed-reader__body > :last-child { margin-bottom: 0; }
159
+ .ed-reader__bar[data-page] { position: fixed; inset: 0 0 auto; margin: 0; }
160
+ @supports (animation-timeline: scroll()) {
161
+ .ed-reader__bar { animation: ed-read linear both; animation-timeline: scroll(nearest block); }
162
+ .ed-reader__bar[data-page] { animation-timeline: scroll(root block); }
163
+ }
164
+ @keyframes ed-read { to { transform: scaleX(1); } }
165
+ /* @end */
166
+
167
+ /* @variant feedback/skeleton */
168
+ /* Loading placeholder. Dot-screen picture, ruled lines, one soft sweep of
169
+ light. Put aria-busy="true" on it and keep a hidden "Loading" label. */
170
+ .ed-skel { display: grid; gap: 0.8rem; width: 22rem; max-width: 100%; color: var(--ed-ink); }
171
+ .ed-skel > :not(.ed-vh) { position: relative; overflow: hidden; background-color: var(--ed-paper-2); }
172
+ .ed-skel > :not(.ed-vh)::after {
173
+ content: "";
174
+ position: absolute;
175
+ inset: 0;
176
+ background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--ed-paper) 85%, transparent) 50%, transparent 70%);
177
+ transform: translateX(-100%);
178
+ animation: ed-shimmer 1.7s ease-in-out infinite;
179
+ }
180
+ .ed-skel__img { aspect-ratio: 4 / 3; background-image: radial-gradient(circle, var(--ed-tint) 1.3px, transparent 1.6px); background-size: 7px 7px; }
181
+ .ed-skel__line { height: 0.8rem; }
182
+ .ed-skel__line[data-size="lg"] { height: 1.5rem; }
183
+ .ed-skel__line[data-w="60"] { width: 60%; }
184
+ .ed-skel__line[data-w="35"] { width: 35%; }
185
+ @keyframes ed-shimmer { to { transform: translateX(100%); } }
186
+ @media (prefers-reduced-motion: reduce) { .ed-skel > :not(.ed-vh)::after { animation: none; } }
187
+ /* @end */
188
+
189
+ /* @variant feedback/loader */
190
+ /* Three small loaders: a tapering ring, three halftone dots and a type cursor.
191
+ Give each role="status" and a hidden label. */
192
+ .ed-ring {
193
+ display: inline-block;
194
+ width: 2.6rem;
195
+ aspect-ratio: 1;
196
+ border-radius: 50%;
197
+ color: var(--ed-ink);
198
+ background: conic-gradient(from 0deg, transparent 0 15%, currentColor);
199
+ -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
200
+ mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
201
+ animation: ed-ring-spin 0.95s linear infinite;
202
+ }
203
+ .ed-dots-load { display: inline-flex; gap: 0.5rem; color: var(--ed-ink); }
204
+ .ed-dots-load span { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: currentColor; animation: ed-dot-pulse 1.2s ease-in-out infinite; }
205
+ .ed-dots-load span:nth-child(2) { animation-delay: 0.16s; }
206
+ .ed-dots-load span:nth-child(3) { animation-delay: 0.32s; }
207
+ .ed-caret-load { display: inline-flex; align-items: center; gap: 0.5em; font: 500 0.875rem/1 var(--ed-font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ed-ink); }
208
+ .ed-caret-load::after { content: ""; width: 0.6em; height: 1.15em; background: currentColor; animation: ed-caret-blink 1s steps(1) infinite; }
209
+ @keyframes ed-ring-spin { to { transform: rotate(360deg); } }
210
+ @keyframes ed-dot-pulse { 0%, 80%, 100% { transform: scale(0.35); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
211
+ @keyframes ed-caret-blink { 50% { opacity: 0; } }
212
+ @media (prefers-reduced-motion: reduce) {
213
+ .ed-ring { animation-duration: 3s; }
214
+ .ed-dots-load span { animation: none; opacity: 0.7; transform: none; }
215
+ .ed-caret-load::after { animation: none; }
216
+ }
217
+ /* @end */
218
+
219
+ /* @variant feedback/steps */
220
+ /* Steps in an <ol>. data-state="done" fills and draws its rule forward;
221
+ aria-current="step" marks where you are. */
222
+ .ed-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(5.5rem, 1fr); max-width: 44rem; margin: 0; padding: 0; overflow-x: auto; list-style: none; counter-reset: ed-step; }
223
+ .ed-steps li {
224
+ position: relative;
225
+ display: grid;
226
+ justify-items: start;
227
+ gap: 0.75rem;
228
+ counter-increment: ed-step;
229
+ font: 800 0.6875rem/1.2 var(--ed-font-display);
230
+ letter-spacing: 0.12em;
231
+ text-transform: uppercase;
232
+ color: var(--ed-ink-2);
233
+ }
234
+ .ed-steps li::before {
235
+ content: counter(ed-step, decimal-leading-zero);
236
+ position: relative;
237
+ z-index: 1;
238
+ display: grid;
239
+ place-items: center;
240
+ width: 2.3rem;
241
+ height: 2.3rem;
242
+ font: 600 0.75rem/1 var(--ed-font-mono);
243
+ letter-spacing: 0.04em;
244
+ background: var(--ed-paper);
245
+ border: 1.5px solid currentColor;
246
+ border-radius: 50%;
247
+ transition: background-color 0.3s, color 0.3s;
248
+ }
249
+ .ed-steps li::after {
250
+ content: "";
251
+ position: absolute;
252
+ top: 1.15rem;
253
+ left: 2.3rem;
254
+ right: 0;
255
+ height: 1.5px;
256
+ background: linear-gradient(var(--ed-ink), var(--ed-ink)) 0 0 / 0 100% no-repeat, var(--ed-tint);
257
+ }
258
+ .ed-steps li:last-child::after { display: none; }
259
+ .ed-steps li[data-state="done"] { color: var(--ed-ink); }
260
+ .ed-steps li[data-state="done"]::before { color: var(--ed-paper); background: var(--ed-ink); border-color: var(--ed-ink); }
261
+ .ed-steps li[data-state="done"]::after { background-size: 100% 100%, auto; animation: ed-step-draw 0.9s var(--ed-ease) 0.2s both; }
262
+ .ed-steps li[aria-current="step"] { color: var(--ed-ink); }
263
+ .ed-steps li[aria-current="step"]::before {
264
+ color: var(--ed-on-accent);
265
+ background: var(--ed-accent);
266
+ border-color: var(--ed-ink);
267
+ animation: ed-step-ring 2.2s ease-out infinite;
268
+ }
269
+ @keyframes ed-step-draw { from { background-size: 0 100%, auto; } }
270
+ @keyframes ed-step-ring { 0% { box-shadow: 0 0 0 0 var(--ed-accent-tint); } 70%, 100% { box-shadow: 0 0 0 0.6rem transparent; } }
271
+ @media (prefers-reduced-motion: reduce) { .ed-steps li::after, .ed-steps li::before { animation: none !important; } }
272
+ /* @end */