animation-timing-function

Term side of the Card.
Topic: Animations
Unit title: animation-timing-function
Categories: Property
Explanation side of the Card

Explanation: The property that defines how the animation progresses over time, controlling the speed at which it changes from one style to another. Options like 'ease', 'linear', 'ease-in' and 'ease-out' create different pacing effects for the animation.

Browser compatibility:
  • The chrome browser supports this feature starting from version 43.
  • The edge browser supports this feature starting from version 12.
  • The firefox browser supports this feature starting from version 16.
  • The safari browser supports this feature starting from version 9.
Availability: 

Example

Wrongcss
.spinner {
  animation: spin 1s infinite;
}
Rightcss
.spinner {
  animation: spin 1s linear infinite;
}

'linear' keeps the rotation speed constant, while the default 'ease' slows down at the start and end of each turn.

Common mistakes

  • A spinner speeds up and slows down on each turn because the default is 'ease'.
  • Expecting one easing curve across all keyframes, while it repeats between each pair.

Key points

  • Spinners and progress loops use 'linear', so the speed doesn't pulse on each cycle.
  • Custom curves use cubic-bezier() or linear(), not extra keyframes that fake easing.
  • Easing is understood to apply to each segment between keyframes, not across the whole animation.

Interview questions

What is the default animation-timing-function?

'ease', which starts slowly, speeds up and slows down again at the end.

Can I use steps() for sprite animations?

Yes. steps(8) jumps between 8 frames with no values in between, which suits sprite sheets and typing effects.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy