0
0
CSSmarkup~15 mins

Transition timing functions in CSS - Deep Dive

Choose your learning style9 modes available
Overview - Transition timing functions
What is it?
Transition timing functions control how the speed of a CSS transition changes over its duration. They define the pacing of the animation, making it feel smooth, fast, slow, or bouncy. Instead of moving at a constant speed, elements can accelerate, decelerate, or follow custom curves. This helps create natural and appealing visual effects on web pages.
Why it matters
Without timing functions, transitions would look mechanical and boring because they would change at a constant speed. Timing functions add life and realism to animations, improving user experience by making interactions feel responsive and polished. They help guide the user's attention and make interfaces easier to understand and enjoy.
Where it fits
Before learning transition timing functions, you should understand basic CSS properties and how CSS transitions work. After mastering timing functions, you can explore advanced animations with keyframes, JavaScript-driven animations, and performance optimization techniques.
Mental Model
Core Idea
Transition timing functions shape the speed curve of an animation, deciding how fast or slow it moves at each moment.
Think of it like...
It's like driving a car on a road: you don't always drive at the same speed. Sometimes you speed up, slow down, or cruise steadily. Timing functions tell the animation when to press the gas or brake.
Transition timing function curve:

Time (0% to 100%) →

Speed ↑
│       /\
│      /  \
│     /    \
│____/      \____
│
└─────────────────

The curve shows how speed changes over time during the transition.
Build-Up - 6 Steps
1
FoundationWhat is a transition timing function
🤔
Concept: Introduce the basic idea of timing functions controlling animation speed over time.
A transition timing function is a CSS property that changes how fast or slow a transition runs at different points. Instead of moving from start to end at a steady pace, timing functions let the animation speed up or slow down. The default is 'ease', which starts slow, speeds up, then slows down again.
Result
Animations feel smoother and more natural than a simple constant speed.
Understanding that timing functions control speed over time helps you see why animations can feel more alive and less robotic.
2
FoundationCommon built-in timing functions
🤔
Concept: Learn the names and effects of standard timing functions in CSS.
CSS offers several built-in timing functions: - linear: constant speed - ease: slow start, fast middle, slow end - ease-in: slow start, then fast - ease-out: fast start, then slow - ease-in-out: slow start and end, fast middle - step-start and step-end: jump instantly at start or end These cover most common animation pacing needs.
Result
You can quickly change animation feel by switching timing function names.
Knowing these presets lets you pick the right feel without complex math or custom curves.
3
IntermediateUsing cubic-bezier for custom curves
🤔Before reading on: do you think cubic-bezier curves can create any speed pattern you want? Commit to yes or no.
Concept: Learn how to create custom timing functions using cubic-bezier curves.
The cubic-bezier() function lets you define a custom curve with four numbers between 0 and 1. These numbers control the shape of the speed curve, allowing precise control over acceleration and deceleration. For example, cubic-bezier(0.25, 0.1, 0.25, 1) is the same as 'ease'. You can experiment with different values to create unique effects.
Result
Animations can have any speed pattern you design, from bouncy to slow-then-fast or even sudden jumps.
Understanding cubic-bezier empowers you to tailor animations exactly to your design vision.
4
IntermediateSteps timing function for jumpy animations
🤔Before reading on: do you think 'steps' timing functions create smooth or sudden changes? Commit to your answer.
Concept: Explore the steps() timing function that creates discrete jumps instead of smooth transitions.
The steps(n, direction) function divides the transition into n equal parts and jumps instantly between them. For example, steps(4, start) jumps 4 times evenly spaced. This is useful for frame-by-frame animations or blinking effects. The direction can be 'start' or 'end' to control when the jump happens.
Result
Animations appear as a sequence of sudden changes instead of smooth movement.
Knowing steps lets you create pixel-art style or mechanical animations that need clear frame changes.
5
AdvancedCombining timing functions with multiple properties
🤔Before reading on: do you think each CSS property in a transition can have its own timing function? Commit to yes or no.
Concept: Learn how to assign different timing functions to different properties in one transition.
When you transition multiple CSS properties at once, you can specify a timing function for each by listing them separated by commas. For example: transition-property: opacity, transform; transition-duration: 1s, 2s; transition-timing-function: ease-in, cubic-bezier(0.68, -0.55, 0.27, 1.55); This lets you control the pacing of each property independently for complex effects.
Result
Animations become richer and more dynamic by mixing different speeds and curves.
Understanding this prevents the common mistake of applying one timing function to all properties, which limits creativity.
6
ExpertPerformance impact and browser optimizations
🤔Before reading on: do you think complex timing functions always slow down animations? Commit to yes or no.
Concept: Understand how timing functions affect browser rendering and animation performance.
Browsers optimize animations by using the GPU and compositing layers. Simple timing functions like linear or ease are easy to optimize. Complex cubic-bezier curves or many simultaneous transitions can increase CPU load. Also, some timing functions can cause layout recalculations if they affect properties like width or height. Choosing timing functions wisely helps keep animations smooth and battery-friendly.
Result
You can create beautiful animations without hurting performance or causing jank.
Knowing the performance tradeoffs helps you balance visual polish with smooth user experience.
Under the Hood
Transition timing functions are mathematical curves that map the progress of time (from 0 to 1) to the progress of the animation (also 0 to 1). The browser calculates the current position of the animated property by evaluating this curve at each frame. This mapping controls acceleration and deceleration by changing how fast the animation value moves relative to time.
Why designed this way?
Timing functions were designed to give designers control over animation pacing without writing complex code. Using mathematical curves like cubic-bezier allows infinite customization while keeping the syntax simple. Early web animations were linear and mechanical, so timing functions evolved to make animations feel more natural and engaging.
Time (t) → Progress (p)

0.0 ┌─────────────────────────────┐ 1.0
     │                             │
     │      ●                      │
     │     / \                     │
     │    /   \                    │
     │   /     \                   │
     │  /       ●                  │
     │ /                          │
0.0 └─────────────────────────────┘ 1.0

At each time t, the curve gives progress p used to update the property.
Myth Busters - 4 Common Misconceptions
Quick: Does 'ease' mean the animation always moves slowly?
Common Belief:Ease means the animation moves slowly all the time.
Tap to reveal reality
Reality:'Ease' means the animation starts slow, speeds up in the middle, then slows down at the end.
Why it matters:Thinking ease is always slow leads to poor animation choices that feel sluggish or unnatural.
Quick: Can you use different timing functions for each property in one transition?
Common Belief:You can only use one timing function for all properties in a transition.
Tap to reveal reality
Reality:You can specify multiple timing functions, one per property, separated by commas.
Why it matters:Not knowing this limits animation creativity and can cause unexpected pacing when animating multiple properties.
Quick: Do complex cubic-bezier functions always cause slow animations?
Common Belief:Complex timing functions always make animations slower and less smooth.
Tap to reveal reality
Reality:Complex curves can be optimized by browsers and don't necessarily slow down animations if used wisely.
Why it matters:Avoiding complex timing functions out of fear can limit design possibilities unnecessarily.
Quick: Does the timing function affect the duration of the transition?
Common Belief:Timing functions change how long the transition lasts.
Tap to reveal reality
Reality:Timing functions only change the speed pattern, not the total duration of the transition.
Why it matters:Confusing timing functions with duration can cause misconfigured animations that don't behave as expected.
Expert Zone
1
Some cubic-bezier curves can produce overshoot or bounce effects by using control points outside the 0-1 range, creating lively animations without extra code.
2
When animating properties that trigger layout changes, timing functions can indirectly affect performance by causing reflows at different speeds.
3
The 'steps' timing function can be combined with negative delays to create looping frame animations without JavaScript.
When NOT to use
Avoid using complex timing functions for animations on properties that cause layout recalculations (like width or height) in performance-critical contexts. Instead, use transform and opacity with simple timing functions. For highly interactive or physics-based animations, consider JavaScript animation libraries that provide more control.
Production Patterns
In production, designers often use 'ease-in-out' for smooth entrances and exits, 'linear' for progress bars, and custom cubic-bezier curves for brand-specific animation feels. Multiple timing functions per property are common in UI libraries to create layered, natural motion. Steps() is popular for sprite animations and loading indicators.
Connections
Bezier curves in graphic design
Builds-on the same mathematical concept of cubic Bezier curves used in vector graphics.
Understanding Bezier curves in design helps grasp how timing functions shape animation speed with precise control points.
Physics of motion
Shares the idea of acceleration and deceleration patterns controlling movement over time.
Knowing basic physics concepts like velocity and acceleration clarifies why timing functions create natural-feeling animations.
Music tempo and rhythm
Analogous to how tempo changes affect the feel of music over time.
Recognizing timing functions as tempo curves helps appreciate how pacing influences emotional response in both animation and music.
Common Pitfalls
#1Using timing functions without specifying transition duration
Wrong approach:transition-timing-function: ease-in-out;
Correct approach:transition-duration: 0.5s; transition-timing-function: ease-in-out;
Root cause:Forgetting that timing functions only affect speed pattern, not duration, so without duration the transition won't run visibly.
#2Applying timing function to non-animatable properties
Wrong approach:transition-property: display; transition-timing-function: linear;
Correct approach:transition-property: opacity; transition-timing-function: linear;
Root cause:Misunderstanding which CSS properties can be transitioned causes no visible effect despite timing function.
#3Using multiple properties but one timing function without commas
Wrong approach:transition-property: opacity, transform; transition-timing-function: ease-in-out;
Correct approach:transition-property: opacity, transform; transition-timing-function: ease-in-out, cubic-bezier(0.68, -0.55, 0.27, 1.55);
Root cause:Assuming one timing function applies to all properties leads to unexpected animation pacing.
Key Takeaways
Transition timing functions control how animation speed changes over time, making animations feel natural and engaging.
CSS provides built-in timing functions like ease, linear, and steps, plus the ability to create custom curves with cubic-bezier.
You can assign different timing functions to different properties in a single transition for complex effects.
Understanding timing functions helps balance animation beauty with performance and user experience.
Misusing timing functions or confusing them with duration can cause animations to behave unexpectedly or not appear at all.