cubic-bezier
suggest changeThe cubic-bezier function is a transition timing function which is often used for custom and smooth transitions.
transition-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1);
The function takes four parameters:
cubic-bezier(P1_x, P1_y, P2_x, P2_y)
These parameters will be mapped to points which are part of a Bézier curve:
For CSS Bézier curves, P0 and P3 are fixed. P0 is at (0, 0) and P3 is at (1, 1). The two x coordinates passed to cubic-bezier() must each be between 0 and 1. The y coordinates may fall outside that range, which is how an easing can overshoot.
If an x coordinate is outside 0–1, the declaration is invalid and is ignored. It does not become linear.
cubic-bezier() can reproduce the other named timing functions:
ease: cubic-bezier(0.25, 0.1, 0.25, 1.0)
linear: cubic-bezier(0, 0, 1, 1)
ease-in: cubic-bezier(0.42, 0.0, 1.0, 1.0)
ease-out: cubic-bezier(0.0, 0.0, 0.58, 1.0)
ease-in-out: cubic-bezier(0.42, 0.0, 0.58, 1.0)