The 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)

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c921cb36-b96f-4f66-84a5-93e0c4771088/Untitled.png

These parameters will be mapped to points which are part of a Bézier curve:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0602f3e1-804b-442e-bccc-38d095c4d914/Untitled.png

For CSS Bézier Curves, P0 and P3 are always in the same spot. P0 is at (0,0) and P3 is at (1,1), which menas that the parameters passed to the cubic-bezier function can only be between 0 and 1.

If you pass parameters which aren’t in this interval the function will default to a linear transition.

Since cubic-bezier is the most flexible transition in CSS, you can translate all other transition timing function to cubic-bezier functions:

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)