transition-timing-function maps elapsed time to progress during a transition. It changes pacing, not the transition’s total duration.
Compare linear with ease-in
Both squares move the same distance over one second. Linear progresses steadily; ease-in begins slowly and accelerates.
HTML and CSS
HTML
<input class="change" id="change" type="checkbox" /><label for="change"
>Move the square</label
>
<div class="stage">
<p>Linear</p>
<div class="box linear" aria-hidden="true"></div>
<p>Ease-in</p>
<div class="box eased" aria-hidden="true"></div>
</div>
CSS
.stage {
padding: 1rem;
background: #eff6ff;
min-height: 60px;
}
.box {
width: 60px;
height: 45px;
background: #2563eb;
}
label {
display: inline-block;
padding: 0.75rem;
}
.box {
margin-block: 0.5rem;
transition-property: transform;
transition-duration: 1s;
}
.linear {
transition-timing-function: linear;
}
.eased {
transition-timing-function: ease-in;
}
.change:checked ~ .stage .box {
transform: translateX(100px);
}
@media (prefers-reduced-motion: reduce) {
.box {
transition-duration: 0s;
transition-delay: 0s;
}
}
Edit HTML or CSS to update the preview as you type. Copy code snippet copies the selected tab. Preview spacing and font defaults are not included.
Use four visible steps
Steps(4,end) holds each position until the next interval ends. It changes the progress curve; the underlying transform is still an interpolable property.
HTML and CSS
HTML
<input class="change" id="change" type="checkbox" /><label for="change"
>Move the square</label
>
<div class="stage"><div class="box" aria-hidden="true"></div></div>
CSS
.stage {
padding: 1rem;
background: #eff6ff;
min-height: 60px;
}
.box {
width: 60px;
height: 45px;
background: #2563eb;
}
label {
display: inline-block;
padding: 0.75rem;
}
.box {
transition-property: transform;
transition-duration: 1s;
transition-timing-function: steps(4, end);
}
.change:checked ~ .stage .box {
transform: translateX(100px);
}
@media (prefers-reduced-motion: reduce) {
.box {
transition-duration: 0s;
transition-delay: 0s;
}
}
Edit HTML or CSS to update the preview as you type. Copy code snippet copies the selected tab. Preview spacing and font defaults are not included.
Values and defaults
The initial value is ease and the property is not inherited. Common keywords are linear, ease, ease-in, ease-out, and ease-in-out. Cubic-bezier(x1,y1,x2,y2) requires x1/x2 in 0–1; y values may go outside that range for overshoot. Steps() takes a valid step count and position. The newer linear() function supplies piecewise-linear stops and has its own support history.
Common mistakes
A timing function cannot create a state change. Comma-separated functions map to transition-property order and shorter lists repeat. Easing does not automatically make motion comfortable; respect reduced-motion preferences and keep essential feedback immediate. A later transition shorthand resets easing.
Learn transition-duration, animation-timing-function, and transition.
Sources and browser support
MDN: transition-timing-function describes the syntax and links to the specification and compatibility data. Check individual values in that table when supporting older browsers.