Table 5.5. Animation properties
Propertya Description Initial value
0s (executes
immediately)How long to wait before executing the
animationanimation-delay0s (no animation
occurs)How long the cycle of an animation
should lastanimation-durationanimation-name The name of a @keyframes rule none
How to calculate the values between the ease
start and end statesanimation-timing-functionanimation-iteration-count How many times to repeat the animation^1
normal (no
reverse)Whether or not the animation should
ever play in reverseanimation-directionWhether the animation is running or running
pausedanimation-play-stateSpecifies what property values are none
applied when the animation isn’t
runninganimation-fill-modeaTodate,thesepropertiesmustbeprefixedforWebKit/Blink-basedbrowsers(thatis,-webkit-anim-
ation-nameand-webkit-animation-duration).
Theanimation-delayandanimation-durationpropertiesfunctionliketrans-
ition-delayandtransition-duration.Bothaccepttimeunitsasavalue,either
inseconds(s)ormilliseconds(ms)units.Negativetimevaluesarevalidforanima-
tion-delay,butnotanimation-duration.
Let’srewriteour.pulserulesetusinglonghandproperties.Doingsogivesusthe
following:
.pulse {
animation-name: pulse;
animation-duration: 500ms;
}Theanimation-namepropertyisfairlystraightforward.Itsvaluecanbeeithernone,
orthenameofthe@keyframesrule.Animationnameshavefewrestrictions.CSS
keywordssuchasinitial,inherit,default,andnoneareforbidden.Mostpunc-
tuationcharacterswon’twork,whileletters,underscores,digits,andemoji(and
Transitions and Animation 213