Skip to content

Commit 96a0794

Browse files
committed
[css-animations-1] Fix example 3
This fixes w3c#4118.
1 parent 618beb7 commit 96a0794

File tree

1 file changed

+49
-45
lines changed

1 file changed

+49
-45
lines changed

css-animations-1/Overview.bs

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -248,31 +248,31 @@ Keyframes</h2>
248248
so the first will be ignored:
249249

250250
<pre class=lang-css>
251-
@keyframes foo { ... }
252-
@keyframes "foo" { ... }
251+
@keyframes foo { /* ... */ }
252+
@keyframes "foo" { /* ... */ }
253253
</pre>
254254

255255
On the other hand,
256256
the following ''@keyframes'' rule's name is <em>different</em> from the previous two rules:
257257

258258
<pre class=lang-css>
259-
@keyframes FOO { ... }
259+
@keyframes FOO { /* ... */ }
260260
</pre>
261261

262262
The following ''@keyframes'' rules are invalid
263263
because they use disallowed <<custom-ident>> values:
264264

265265
<pre class=lang-css>
266-
@keyframes initial { ... }
267-
@keyframes None { ... }
266+
@keyframes initial { /* ... */ }
267+
@keyframes None { /* ... */ }
268268
</pre>
269269

270-
However, those names *can* be specified with a <<string>>,
270+
However, those names <em>can</em> be specified with a <<string>>,
271271
so the following are both <em>valid</em>:
272272

273273
<pre class=lang-css>
274-
@keyframes "initial" { ... }
275-
@keyframes "None" { ... }
274+
@keyframes "initial" { /* ... */ }
275+
@keyframes "None" { /* ... */ }
276276
</pre>
277277
</div>
278278

@@ -295,58 +295,62 @@ Keyframes</h2>
295295
the last one in document order wins,
296296
and all preceding ones are ignored.
297297

298-
<div class='example'>
299-
<pre>
300-
div {
301-
animation-name: slide-right;
302-
animation-duration: 2s;
303-
}
298+
<div class='example'>
299+
<pre>
300+
div {
301+
animation-name: slide-right;
302+
animation-duration: 2s;
303+
}
304304

305-
@keyframes slide-right {
305+
@keyframes slide-right {
306306

307-
from {
308-
margin-left: 0px;
309-
}
307+
from {
308+
margin-left: 0px;
309+
}
310310

311-
50% {
312-
margin-left: 110px;
313-
opacity: 1;
314-
}
311+
50% {
312+
margin-left: 110px;
313+
opacity: 1;
314+
}
315315

316-
50% {
317-
opacity: 0.9;
318-
}
316+
50% {
317+
opacity: 0.9;
318+
}
319319

320-
to {
321-
margin-left: 200px;
322-
}
320+
to {
321+
margin-left: 200px;
322+
}
323323

324-
}
325-
</pre>
324+
}
325+
</pre>
326326

327-
At the 1s mark, the slide-right animation will have the same state as if we had defined the 50% rule like this:
327+
The two 50% rules from above can also be combined into an equivalent single rule
328+
as illustrated below:
328329

329-
<pre>
330+
<pre>
330331

331-
@keyframes slide-right {
332+
@keyframes slide-right {
332333

333-
50% {
334-
margin-left: 110px;
335-
opacity: 0.9;
336-
}
334+
from {
335+
margin-left: 0px;
336+
}
337337

338-
to {
339-
margin-left: 200px;
340-
}
338+
50% {
339+
margin-left: 110px;
340+
opacity: 0.9;
341+
}
341342

342-
}
343-
</pre>
343+
to {
344+
margin-left: 200px;
345+
}
344346

345-
</div>
347+
}
348+
</pre>
349+
</div>
346350

347351
To determine the set of keyframes, all of the values in the selectors are sorted in increasing order
348-
by time. The rules within the @keyframes rule then cascade; the properties of a keyframe may thus derive
349-
from more than one @keyframes rule with the same selector value.
352+
by time. The rules within the ''@keyframes'' rule then cascade; the properties of a keyframe may thus derive
353+
from more than one ''@keyframes'' rule with the same selector value.
350354

351355
If a property is not specified for a keyframe, or is specified but invalid, the animation of that
352356
property proceeds as if that keyframe did not exist. Conceptually, it is as if a set of keyframes is

0 commit comments

Comments
 (0)