@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.
- package/dist/components/button/button.d.ts +17 -0
- package/dist/components/button/button.js +11 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/checkbox/checkbox.d.ts +23 -0
- package/dist/components/checkbox/checkbox.js +19 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input.d.ts +15 -0
- package/dist/components/input/input.js +14 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/radio-group.d.ts +31 -0
- package/dist/components/radio-group/radio-group.js +47 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/separator.d.ts +18 -0
- package/dist/components/separator/separator.js +13 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/switch.d.ts +7 -0
- package/dist/components/switch/switch.js +12 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea.d.ts +15 -0
- package/dist/components/textarea/textarea.js +14 -0
- package/dist/editorial/backgrounds.css +201 -0
- package/dist/editorial/buttons.css +209 -0
- package/dist/editorial/choices.css +360 -0
- package/dist/editorial/disclosure.css +359 -0
- package/dist/editorial/feedback.css +272 -0
- package/dist/editorial/fields.css +205 -0
- package/dist/editorial/motion.css +184 -0
- package/dist/editorial/showcase.css +395 -0
- package/dist/editorial/tokens.css +129 -0
- package/dist/editorial/type.css +379 -0
- package/dist/editorial-fonts.css +4 -0
- package/dist/editorial.css +2704 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +8 -0
- package/package.json +74 -4
- package/README.md +0 -3
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Text fields, textareas, rules
|
|
3
|
+
========================================================================== */
|
|
4
|
+
|
|
5
|
+
/* @variant fields/base */
|
|
6
|
+
.ed-label {
|
|
7
|
+
display: block;
|
|
8
|
+
margin-bottom: 0.45rem;
|
|
9
|
+
font: 800 0.6875rem/1 var(--ed-font-display);
|
|
10
|
+
font-stretch: 105%;
|
|
11
|
+
letter-spacing: 0.15em;
|
|
12
|
+
text-transform: uppercase;
|
|
13
|
+
color: var(--ed-ink-2);
|
|
14
|
+
}
|
|
15
|
+
.ed-input,
|
|
16
|
+
.ed-textarea {
|
|
17
|
+
appearance: none;
|
|
18
|
+
-webkit-appearance: none;
|
|
19
|
+
display: block;
|
|
20
|
+
width: 100%;
|
|
21
|
+
margin: 0;
|
|
22
|
+
padding: 0.7em 0.1em;
|
|
23
|
+
font: 500 1.125rem/1.35 var(--ed-font-text);
|
|
24
|
+
color: var(--ed-ink);
|
|
25
|
+
background: transparent;
|
|
26
|
+
border: 0;
|
|
27
|
+
border-radius: var(--ed-radius);
|
|
28
|
+
transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
|
|
29
|
+
}
|
|
30
|
+
.ed-input::placeholder,
|
|
31
|
+
.ed-textarea::placeholder { color: var(--ed-ink-2); font-style: italic; opacity: 0.75; }
|
|
32
|
+
.ed-input:focus-visible,
|
|
33
|
+
.ed-textarea:focus-visible { outline: 2px solid var(--ed-accent); outline-offset: 3px; }
|
|
34
|
+
.ed-input:disabled,
|
|
35
|
+
.ed-textarea:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
36
|
+
.ed-input:user-invalid,
|
|
37
|
+
.ed-textarea:user-invalid { border-color: var(--ed-hot); }
|
|
38
|
+
/* @end */
|
|
39
|
+
|
|
40
|
+
/* @variant fields/underline */
|
|
41
|
+
/* Print-form field. A heavy rule thickens under the caret. */
|
|
42
|
+
.ed-input[data-variant="underline"] { border-bottom: 1.5px solid var(--ed-ink); border-radius: 0; }
|
|
43
|
+
.ed-input[data-variant="underline"]:focus-visible { outline: 0; box-shadow: 0 2px 0 0 var(--ed-ink); }
|
|
44
|
+
/* @end */
|
|
45
|
+
|
|
46
|
+
/* @variant fields/notch */
|
|
47
|
+
/* Label cut into the top border, like a fieldset legend. */
|
|
48
|
+
.ed-notch { position: relative; display: block; }
|
|
49
|
+
.ed-notch > span {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: -0.5em;
|
|
52
|
+
left: 0.9rem;
|
|
53
|
+
padding: 0 0.45em;
|
|
54
|
+
font: 800 0.625rem/1 var(--ed-font-display);
|
|
55
|
+
letter-spacing: 0.15em;
|
|
56
|
+
text-transform: uppercase;
|
|
57
|
+
color: var(--ed-ink);
|
|
58
|
+
background: var(--ed-paper);
|
|
59
|
+
}
|
|
60
|
+
.ed-input[data-variant="notch"] { padding: 0.95em 1rem; border: 1.5px solid var(--ed-ink); }
|
|
61
|
+
.ed-input[data-variant="notch"]:focus-visible { outline: 0; box-shadow: 4px 4px 0 var(--ed-accent); }
|
|
62
|
+
/* @end */
|
|
63
|
+
|
|
64
|
+
/* @variant fields/subscribe */
|
|
65
|
+
/* Oversized newsletter line with the button locked to it. */
|
|
66
|
+
.ed-subscribe { display: flex; align-items: stretch; width: 100%; border-bottom: var(--ed-thick) solid var(--ed-ink); }
|
|
67
|
+
.ed-input[data-variant="subscribe"] { flex: 1; min-width: 0; padding: 0.45em 0.1em; font: italic 500 clamp(1.3rem, 2.6vw, 1.9rem)/1.1 var(--ed-font-swash); }
|
|
68
|
+
.ed-input[data-variant="subscribe"]:focus-visible { outline: 0; background: var(--ed-accent-tint); }
|
|
69
|
+
.ed-subscribe .ed-btn { border: 0; border-radius: 0; background: var(--ed-ink); color: var(--ed-paper); padding-inline: 1.6em; }
|
|
70
|
+
.ed-subscribe .ed-btn:hover { background: var(--ed-accent); color: var(--ed-on-accent); }
|
|
71
|
+
/* @end */
|
|
72
|
+
|
|
73
|
+
/* @variant fields/giant */
|
|
74
|
+
/* Masthead-scale search. Big enough to be the page. */
|
|
75
|
+
.ed-input[data-variant="giant"] {
|
|
76
|
+
padding: 0.15em 0;
|
|
77
|
+
font: 800 clamp(2rem, 6vw, 3.6rem)/1.05 var(--ed-font-display);
|
|
78
|
+
font-stretch: 112%;
|
|
79
|
+
letter-spacing: -0.02em;
|
|
80
|
+
text-transform: uppercase;
|
|
81
|
+
border-bottom: var(--ed-thick) solid var(--ed-ink);
|
|
82
|
+
border-radius: 0;
|
|
83
|
+
}
|
|
84
|
+
.ed-input[data-variant="giant"]::placeholder { color: var(--ed-ink); opacity: 0.18; font-style: normal; }
|
|
85
|
+
.ed-input[data-variant="giant"]:focus-visible { outline: 0; border-bottom-color: var(--ed-accent); }
|
|
86
|
+
/* @end */
|
|
87
|
+
|
|
88
|
+
/* @variant fields/typewriter */
|
|
89
|
+
/* Monospace, dotted rule, block caret where the browser allows. */
|
|
90
|
+
.ed-input[data-variant="typewriter"] {
|
|
91
|
+
font: 500 1rem/1.4 var(--ed-font-mono);
|
|
92
|
+
border-bottom: 2px dotted var(--ed-ink);
|
|
93
|
+
border-radius: 0;
|
|
94
|
+
caret-color: var(--ed-accent);
|
|
95
|
+
caret-shape: block;
|
|
96
|
+
}
|
|
97
|
+
.ed-input[data-variant="typewriter"]:focus-visible { outline: 0; border-bottom-style: solid; background: var(--ed-accent-tint); }
|
|
98
|
+
/* @end */
|
|
99
|
+
|
|
100
|
+
/* @variant textareas/ruled */
|
|
101
|
+
/* Letters to the editor. Ruled lines scroll with the text; margin line in hot. */
|
|
102
|
+
.ed-textarea[data-variant="ruled"] {
|
|
103
|
+
min-height: 11rem;
|
|
104
|
+
padding: 0 1rem 0 3.9rem;
|
|
105
|
+
line-height: 2rem;
|
|
106
|
+
border: 1px solid var(--ed-ink);
|
|
107
|
+
background:
|
|
108
|
+
linear-gradient(90deg, transparent 3.1rem, var(--ed-hot) 3.1rem calc(3.1rem + 1.5px), transparent calc(3.1rem + 1.5px)),
|
|
109
|
+
repeating-linear-gradient(transparent 0 calc(2rem - 1px), var(--ed-tint) calc(2rem - 1px) 2rem);
|
|
110
|
+
background-attachment: local;
|
|
111
|
+
resize: vertical;
|
|
112
|
+
}
|
|
113
|
+
/* @end */
|
|
114
|
+
|
|
115
|
+
/* @variant textareas/double */
|
|
116
|
+
/* Classic double-rule box. */
|
|
117
|
+
.ed-textarea[data-variant="double"] {
|
|
118
|
+
min-height: 9rem;
|
|
119
|
+
padding: 0.9rem 1rem;
|
|
120
|
+
border: 6px double var(--ed-ink);
|
|
121
|
+
background: var(--ed-paper-2);
|
|
122
|
+
resize: vertical;
|
|
123
|
+
}
|
|
124
|
+
.ed-textarea[data-variant="double"]:focus-visible { outline-offset: 4px; }
|
|
125
|
+
/* @end */
|
|
126
|
+
|
|
127
|
+
/* ---------- rules ---------- */
|
|
128
|
+
|
|
129
|
+
/* @variant rules/base */
|
|
130
|
+
.ed-rule { display: block; margin: 0; border: 0; color: var(--ed-ink); }
|
|
131
|
+
/* @end */
|
|
132
|
+
|
|
133
|
+
/* @variant rules/double */
|
|
134
|
+
/* Thick over thin. The newspaper column head. */
|
|
135
|
+
.ed-rule[data-variant="double"] {
|
|
136
|
+
height: 7px;
|
|
137
|
+
background:
|
|
138
|
+
linear-gradient(currentColor 0 0) 0 0 / 100% var(--ed-thick) no-repeat,
|
|
139
|
+
linear-gradient(currentColor 0 0) 0 100% / 100% var(--ed-hair) no-repeat;
|
|
140
|
+
}
|
|
141
|
+
/* @end */
|
|
142
|
+
|
|
143
|
+
/* @variant rules/masthead */
|
|
144
|
+
/* Heavy bar, gap, hairline. Goes under a masthead. */
|
|
145
|
+
.ed-rule[data-variant="masthead"] {
|
|
146
|
+
height: 13px;
|
|
147
|
+
background:
|
|
148
|
+
linear-gradient(currentColor 0 0) 0 0 / 100% 8px no-repeat,
|
|
149
|
+
linear-gradient(currentColor 0 0) 0 100% / 100% var(--ed-hair) no-repeat;
|
|
150
|
+
}
|
|
151
|
+
/* @end */
|
|
152
|
+
|
|
153
|
+
/* @variant rules/dotted */
|
|
154
|
+
/* Dot leader. */
|
|
155
|
+
.ed-rule[data-variant="dotted"] {
|
|
156
|
+
height: 4px;
|
|
157
|
+
background: radial-gradient(circle at center, currentColor 1.4px, transparent 1.8px) 0 50% / 8px 4px repeat-x;
|
|
158
|
+
}
|
|
159
|
+
/* @end */
|
|
160
|
+
|
|
161
|
+
/* @variant rules/ornament */
|
|
162
|
+
/* Hairline broken by a diamond. */
|
|
163
|
+
.ed-rule[data-variant="ornament"] { position: relative; height: var(--ed-hair); background: currentColor; overflow: visible; }
|
|
164
|
+
.ed-rule[data-variant="ornament"]::after {
|
|
165
|
+
content: "";
|
|
166
|
+
position: absolute;
|
|
167
|
+
left: 50%;
|
|
168
|
+
top: 50%;
|
|
169
|
+
width: 0.7rem;
|
|
170
|
+
height: 0.7rem;
|
|
171
|
+
background: var(--ed-paper);
|
|
172
|
+
border: var(--ed-hair) solid currentColor;
|
|
173
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
174
|
+
box-shadow: 0 0 0 0.6rem var(--ed-paper);
|
|
175
|
+
}
|
|
176
|
+
/* @end */
|
|
177
|
+
|
|
178
|
+
/* @variant rules/label */
|
|
179
|
+
/* Section rule with its name sitting on it. Set data-label. */
|
|
180
|
+
.ed-rule[data-variant="label"] {
|
|
181
|
+
height: auto;
|
|
182
|
+
background: linear-gradient(currentColor 0 0) 0 50% / 100% var(--ed-hair) no-repeat;
|
|
183
|
+
}
|
|
184
|
+
.ed-rule[data-variant="label"]::before {
|
|
185
|
+
content: attr(data-label);
|
|
186
|
+
display: inline-block;
|
|
187
|
+
padding-right: 0.9rem;
|
|
188
|
+
font: 800 0.75rem/1 var(--ed-font-display);
|
|
189
|
+
font-stretch: 105%;
|
|
190
|
+
letter-spacing: 0.15em;
|
|
191
|
+
text-transform: uppercase;
|
|
192
|
+
background: var(--ed-paper);
|
|
193
|
+
}
|
|
194
|
+
/* @end */
|
|
195
|
+
|
|
196
|
+
/* @variant rules/column */
|
|
197
|
+
/* Vertical column rule. Editio's vertical Separator sets aria-orientation. */
|
|
198
|
+
.ed-rule[data-variant="column"] {
|
|
199
|
+
width: var(--ed-hair);
|
|
200
|
+
align-self: stretch;
|
|
201
|
+
min-height: 3rem;
|
|
202
|
+
background: currentColor;
|
|
203
|
+
}
|
|
204
|
+
.ed-rule[data-variant="column"][data-weight="heavy"] { width: var(--ed-thick); }
|
|
205
|
+
/* @end */
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Motion: type in movement. Reveals, tickers, counters, highlighters.
|
|
3
|
+
CSS keyframes only. Each piece falls back to its finished state under
|
|
4
|
+
prefers-reduced-motion, so nothing is ever hidden.
|
|
5
|
+
========================================================================== */
|
|
6
|
+
|
|
7
|
+
/* @variant motion/rise */
|
|
8
|
+
/* Headline whose words rise out of a clipped line, one after another.
|
|
9
|
+
Wrap each word in .ed-rise__w > span and number them with --i. */
|
|
10
|
+
.ed-rise {
|
|
11
|
+
margin: 0;
|
|
12
|
+
font: 900 clamp(2.2rem, 6vw, 4.2rem)/0.95 var(--ed-font-display);
|
|
13
|
+
font-stretch: 116%;
|
|
14
|
+
letter-spacing: -0.02em;
|
|
15
|
+
text-transform: uppercase;
|
|
16
|
+
color: var(--ed-ink);
|
|
17
|
+
}
|
|
18
|
+
.ed-rise__w { display: inline-block; padding-bottom: 0.14em; margin-bottom: -0.14em; overflow: clip; vertical-align: top; }
|
|
19
|
+
.ed-rise__w > span {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
transform: translateY(112%);
|
|
22
|
+
animation: ed-rise-up 1s var(--ed-ease) forwards;
|
|
23
|
+
animation-delay: calc(var(--i, 0) * 0.1s + 0.1s);
|
|
24
|
+
}
|
|
25
|
+
@keyframes ed-rise-up { to { transform: none; } }
|
|
26
|
+
@media (prefers-reduced-motion: reduce) { .ed-rise__w > span { transform: none; animation: none; } }
|
|
27
|
+
/* @end */
|
|
28
|
+
|
|
29
|
+
/* @variant motion/marquee */
|
|
30
|
+
/* Giant type on a belt. Two copies of the set (the second aria-hidden) make
|
|
31
|
+
the loop seamless. Rows can run opposite ways and pause on hover. */
|
|
32
|
+
.ed-marq { overflow: hidden; color: var(--ed-ink); border-block: var(--ed-thick) solid currentColor; }
|
|
33
|
+
.ed-marq__row { display: flex; width: max-content; animation: ed-marq 30s linear infinite; }
|
|
34
|
+
.ed-marq__row + .ed-marq__row { border-top: var(--ed-hair) solid currentColor; }
|
|
35
|
+
.ed-marq__row[data-dir="reverse"] { animation-direction: reverse; animation-duration: 38s; }
|
|
36
|
+
.ed-marq:hover .ed-marq__row { animation-play-state: paused; }
|
|
37
|
+
.ed-marq__set { display: flex; flex: none; align-items: center; gap: 1.6rem; margin: 0; padding: 0.3rem 1.6rem 0.3rem 0; }
|
|
38
|
+
.ed-marq__set span {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 1.6rem;
|
|
42
|
+
font: 900 clamp(2.6rem, 8vw, 5.5rem)/1 var(--ed-font-display);
|
|
43
|
+
font-stretch: 118%;
|
|
44
|
+
letter-spacing: -0.03em;
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
}
|
|
48
|
+
.ed-marq__set span::after { content: ""; width: 0.28em; height: 0.28em; background: var(--ed-accent); rotate: 45deg; }
|
|
49
|
+
.ed-marq__row[data-style="outline"] .ed-marq__set span { color: transparent; -webkit-text-stroke: 1.5px var(--ed-ink); }
|
|
50
|
+
@keyframes ed-marq { to { transform: translateX(-50%); } }
|
|
51
|
+
@media (prefers-reduced-motion: reduce) { .ed-marq__row { animation: none; } }
|
|
52
|
+
/* @end */
|
|
53
|
+
|
|
54
|
+
/* @variant motion/cycle */
|
|
55
|
+
/* A word that swaps inside a sentence. Four words, then the first again so the
|
|
56
|
+
loop has no jump. Edit the keyframes if you want a different count. */
|
|
57
|
+
.ed-cycle-line { margin: 0; font: 400 clamp(1.7rem, 4vw, 2.8rem)/1.15 var(--ed-font-text); color: var(--ed-ink); }
|
|
58
|
+
.ed-cycle { display: inline-block; height: 1.15em; overflow: hidden; vertical-align: bottom; }
|
|
59
|
+
.ed-cycle__list { display: block; animation: ed-cycle 11s var(--ed-ease) infinite; }
|
|
60
|
+
.ed-cycle__list > * { display: block; height: 1.15em; width: fit-content; font: italic 500 1em/1.15 var(--ed-font-swash); background: linear-gradient(var(--ed-accent), var(--ed-accent)) 0 88% / 100% 0.08em no-repeat; }
|
|
61
|
+
@keyframes ed-cycle {
|
|
62
|
+
0%, 20% { transform: translateY(0); }
|
|
63
|
+
25%, 45% { transform: translateY(-20%); }
|
|
64
|
+
50%, 70% { transform: translateY(-40%); }
|
|
65
|
+
75%, 95% { transform: translateY(-60%); }
|
|
66
|
+
100% { transform: translateY(-80%); }
|
|
67
|
+
}
|
|
68
|
+
@media (prefers-reduced-motion: reduce) { .ed-cycle__list { animation: none; } }
|
|
69
|
+
/* @end */
|
|
70
|
+
|
|
71
|
+
/* @variant motion/count */
|
|
72
|
+
/* Figures that count up. A registered custom property is animated and shown
|
|
73
|
+
through a CSS counter. Set --ed-to and data-sfx; describe it with aria-label. */
|
|
74
|
+
@property --ed-n { syntax: "<integer>"; inherits: false; initial-value: 0; }
|
|
75
|
+
.ed-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1.6rem 2rem; max-width: 46rem; padding-top: 1rem; color: var(--ed-ink); border-top: var(--ed-thick) solid currentColor; }
|
|
76
|
+
.ed-counts > div { display: grid; gap: 0.55rem; align-content: start; }
|
|
77
|
+
.ed-count {
|
|
78
|
+
--ed-to: 48;
|
|
79
|
+
--ed-n: var(--ed-to);
|
|
80
|
+
margin: 0;
|
|
81
|
+
font: 900 clamp(2.8rem, 7vw, 4.4rem)/0.9 var(--ed-font-display);
|
|
82
|
+
font-stretch: 116%;
|
|
83
|
+
font-variant-numeric: tabular-nums;
|
|
84
|
+
letter-spacing: -0.03em;
|
|
85
|
+
counter-reset: ed-n var(--ed-n);
|
|
86
|
+
animation: ed-count 2s var(--ed-ease) both;
|
|
87
|
+
}
|
|
88
|
+
.ed-count::before { content: counter(ed-n); }
|
|
89
|
+
.ed-count::after { content: attr(data-sfx); font-size: 0.5em; font-weight: 600; letter-spacing: 0; margin-left: 0.08em; }
|
|
90
|
+
.ed-counts__label { margin: 0; font: 700 0.6875rem/1.3 var(--ed-font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ed-ink-2); }
|
|
91
|
+
@keyframes ed-count { from { --ed-n: 0; } to { --ed-n: var(--ed-to); } }
|
|
92
|
+
@media (prefers-reduced-motion: reduce) { .ed-count { animation: none; } }
|
|
93
|
+
/* @end */
|
|
94
|
+
|
|
95
|
+
/* @variant motion/sweep */
|
|
96
|
+
/* Highlighter that sweeps across <mark> text. Number them with --i for a
|
|
97
|
+
stagger. Plays once on load. Add data-scroll to the paragraph and each
|
|
98
|
+
sweep follows the page as you scroll instead. */
|
|
99
|
+
.ed-sweep { max-width: 38rem; margin: 0; font: 400 1.375rem/1.7 var(--ed-font-text); color: var(--ed-ink); }
|
|
100
|
+
.ed-sweep mark {
|
|
101
|
+
--ed-hl: color-mix(in srgb, var(--ed-accent) 62%, transparent);
|
|
102
|
+
padding: 0 0.1em;
|
|
103
|
+
margin: 0 -0.1em;
|
|
104
|
+
color: inherit;
|
|
105
|
+
background: linear-gradient(var(--ed-hl), var(--ed-hl)) 0 60% / 0% 0.9em no-repeat;
|
|
106
|
+
animation: ed-sweep 0.9s var(--ed-ease) forwards;
|
|
107
|
+
animation-delay: calc(var(--i, 0) * 0.75s + 0.3s);
|
|
108
|
+
}
|
|
109
|
+
.ed-sweep mark[data-style="under"] {
|
|
110
|
+
background-image: linear-gradient(var(--ed-ink), var(--ed-ink));
|
|
111
|
+
background-position: 0 96%;
|
|
112
|
+
background-size: 0% 0.12em;
|
|
113
|
+
animation-name: ed-sweep-under;
|
|
114
|
+
}
|
|
115
|
+
@keyframes ed-sweep { to { background-size: 100% 0.9em; } }
|
|
116
|
+
@keyframes ed-sweep-under { to { background-size: 100% 0.12em; } }
|
|
117
|
+
@supports (animation-timeline: view()) {
|
|
118
|
+
.ed-sweep[data-scroll] mark { animation-timeline: view(); animation-range: entry 10% cover 40%; animation-delay: 0s; animation-duration: auto; }
|
|
119
|
+
}
|
|
120
|
+
@media (prefers-reduced-motion: reduce) {
|
|
121
|
+
.ed-sweep mark { animation: none; background-size: 100% 0.9em; }
|
|
122
|
+
.ed-sweep mark[data-style="under"] { background-size: 100% 0.12em; }
|
|
123
|
+
}
|
|
124
|
+
/* @end */
|
|
125
|
+
|
|
126
|
+
/* @variant motion/type */
|
|
127
|
+
/* Typewriter line. Set --ed-ch to the number of characters. It needs a
|
|
128
|
+
monospaced face, which the mono token is, and it stays on one line. */
|
|
129
|
+
.ed-typed {
|
|
130
|
+
--ed-ch: 24;
|
|
131
|
+
box-sizing: content-box;
|
|
132
|
+
display: block;
|
|
133
|
+
width: calc(var(--ed-ch) * 1ch);
|
|
134
|
+
max-width: 100%;
|
|
135
|
+
margin: 0;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
font: 500 clamp(1.15rem, 3.2vw, 2rem)/1.35 var(--ed-font-mono);
|
|
138
|
+
letter-spacing: 0;
|
|
139
|
+
white-space: nowrap;
|
|
140
|
+
color: var(--ed-ink);
|
|
141
|
+
border-right: 0.12em solid var(--ed-accent);
|
|
142
|
+
animation: ed-typing calc(var(--ed-ch) * 0.075s) steps(var(--ed-ch)) 0.4s both, ed-caret 0.85s steps(1) infinite;
|
|
143
|
+
}
|
|
144
|
+
@keyframes ed-typing { from { width: 0; } }
|
|
145
|
+
@keyframes ed-caret { 50% { border-right-color: transparent; } }
|
|
146
|
+
@media (prefers-reduced-motion: reduce) { .ed-typed { animation: none; } }
|
|
147
|
+
/* @end */
|
|
148
|
+
|
|
149
|
+
/* @variant motion/correct */
|
|
150
|
+
/* Corrections: the wrong figure is struck out, then the right one drops in.
|
|
151
|
+
Plain <s> and <ins>, so the change is also marked up for readers. The
|
|
152
|
+
strike sits on the middle of the figures: line-height 1 makes the box the
|
|
153
|
+
type's own height, and the nudge lifts it from the middle of that box to the
|
|
154
|
+
middle of the digits. Tune --ed-strike-nudge if you swap the text face. */
|
|
155
|
+
.ed-correct { max-width: 34rem; margin: 0; font: 400 clamp(1.35rem, 3vw, 1.9rem)/1.5 var(--ed-font-text); color: var(--ed-ink); }
|
|
156
|
+
.ed-correct s { position: relative; display: inline-block; line-height: 1; text-decoration: none; color: var(--ed-ink-2); }
|
|
157
|
+
.ed-correct s::after {
|
|
158
|
+
content: "";
|
|
159
|
+
position: absolute;
|
|
160
|
+
inset: calc(50% - 0.045em + var(--ed-strike-nudge, -0.12em)) -0.06em auto;
|
|
161
|
+
height: 0.09em;
|
|
162
|
+
background: var(--ed-hot);
|
|
163
|
+
transform: scaleX(0);
|
|
164
|
+
transform-origin: left;
|
|
165
|
+
animation: ed-strike 0.5s var(--ed-ease) 0.7s forwards;
|
|
166
|
+
}
|
|
167
|
+
.ed-correct ins {
|
|
168
|
+
display: inline-block;
|
|
169
|
+
padding: 0.04em 0.15em;
|
|
170
|
+
line-height: 1.1;
|
|
171
|
+
font-weight: 700;
|
|
172
|
+
text-decoration: none;
|
|
173
|
+
background: color-mix(in srgb, var(--ed-accent) 34%, transparent);
|
|
174
|
+
animation: ed-correct-in 0.55s var(--ed-ease) 1.15s both;
|
|
175
|
+
}
|
|
176
|
+
.ed-correct s:nth-of-type(2)::after { animation-delay: 1.9s; }
|
|
177
|
+
.ed-correct ins:nth-of-type(2) { animation-delay: 2.35s; }
|
|
178
|
+
@keyframes ed-strike { to { transform: scaleX(1); } }
|
|
179
|
+
@keyframes ed-correct-in { from { opacity: 0; transform: translateY(0.45em); } }
|
|
180
|
+
@media (prefers-reduced-motion: reduce) {
|
|
181
|
+
.ed-correct s::after { animation: none; transform: scaleX(1); }
|
|
182
|
+
.ed-correct ins { animation: none; }
|
|
183
|
+
}
|
|
184
|
+
/* @end */
|