@@ -248,31 +248,31 @@ Keyframes
248
248
so the first will be ignored:
249
249
250
250
251
- @keyframes foo { ... }
252
- @keyframes "foo" { ... }
251
+ @keyframes foo { /* ... */ }
252
+ @keyframes "foo" { /* ... */ }
253
253
254
254
255
255
On the other hand,
256
256
the following ''@keyframes'' rule's name is different from the previous two rules:
257
257
258
258
259
- @keyframes FOO { ... }
259
+ @keyframes FOO { /* ... */ }
260
260
261
261
262
262
The following ''@keyframes'' rules are invalid
263
263
because they use disallowed <> values:
264
264
265
265
266
- @keyframes initial { ... }
267
- @keyframes None { ... }
266
+ @keyframes initial { /* ... */ }
267
+ @keyframes None { /* ... */ }
268
268
269
269
270
- However, those names * can* be specified with a <> ,
270
+ However, those names can be specified with a <> ,
271
271
so the following are both valid :
272
272
273
273
274
- @keyframes "initial" { ... }
275
- @keyframes "None" { ... }
274
+ @keyframes "initial" { /* ... */ }
275
+ @keyframes "None" { /* ... */ }
276
276
277
277
278
278
@@ -295,58 +295,62 @@ Keyframes
295
295
the last one in document order wins,
296
296
and all preceding ones are ignored.
297
297
298
-
299
-
300
- div {
301
- animation-name: slide-right;
302
- animation-duration: 2s;
303
- }
298
+
299
+
300
+ div {
301
+ animation-name: slide-right;
302
+ animation-duration: 2s;
303
+ }
304
304
305
- @keyframes slide-right {
305
+ @keyframes slide-right {
306
306
307
- from {
308
- margin-left: 0px;
309
- }
307
+ from {
308
+ margin-left: 0px;
309
+ }
310
310
311
- 50% {
312
- margin-left: 110px;
313
- opacity: 1;
314
- }
311
+ 50% {
312
+ margin-left: 110px;
313
+ opacity: 1;
314
+ }
315
315
316
- 50% {
317
- opacity: 0.9;
318
- }
316
+ 50% {
317
+ opacity: 0.9;
318
+ }
319
319
320
- to {
321
- margin-left: 200px;
322
- }
320
+ to {
321
+ margin-left: 200px;
322
+ }
323
323
324
- }
325
-
324
+ }
325
+
326
326
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:
328
329
329
-
330
+
330
331
331
- @keyframes slide-right {
332
+ @keyframes slide-right {
332
333
333
- 50% {
334
- margin-left: 110px;
335
- opacity: 0.9;
336
- }
334
+ from {
335
+ margin-left: 0px;
336
+ }
337
337
338
- to {
339
- margin-left: 200px;
340
- }
338
+ 50% {
339
+ margin-left: 110px;
340
+ opacity: 0.9;
341
+ }
341
342
342
- }
343
-
343
+ to {
344
+ margin-left: 200px;
345
+ }
344
346
345
-
347
+ }
348
+
349
+
346
350
347
351
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.
350
354
351
355
If a property is not specified for a keyframe, or is specified but invalid, the animation of that
352
356
property proceeds as if that keyframe did not exist. Conceptually, it is as if a set of keyframes is
0 commit comments