CSS Transition Timing Functions
Apply CSS transitions with custom cubic-bezier timing functions for natural motion and interactive feedback.
Code
.btn {
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.smooth {
transition: opacity 0.3s ease, transform 0.3s ease;
}CSS Transition Timing Functions
Apply CSS transitions with custom cubic-bezier timing functions for natural motion and interactive feedback.
Code
.btn {
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.smooth {
transition: opacity 0.3s ease, transform 0.3s ease;
}
Explanation
transition pairs a property with a cubic-bezier timing function so state changes ease instead of jumping. Expected behavior: the browser interpolates the named property between its old and new values over the duration. Limitation: only animatable properties transition, and a very long duration can make an interface feel unresponsive.
Interactive Tools for This Topic
Aspect Ratio CalculatorSimplify a width-to-height ratio, show its decimal value, and derive a matching height for a new width.Border Radius PreviewPreview four-corner border-radius values on a live box and copy the generated shorthand border-radius CSS declaration.Box Shadow GeneratorBuild CSS box-shadow values with offset, blur, spread, color, opacity, and inset controls, with a live preview of the result.CSS Color Name LookupTranslate between CSS keyword color names and hex values with RGB and HSL conversions, exact name matching, and nearest-color suggestions.
Report a problem with this exampleOpens a pre-filled issue on GitHub.