Most devs don't know CSS can do spring animations.
This linear function does the trick:
.btn {
...
transition: all 800ms linear(
0,
0.7 10%,
/* overshoot → spring pop */
1.2 20%,
0.9 40%,
/* another small overshoot for realism */
1.05 70%,
1
);
}
.btn:hover {
transform: scale(1.2);
}
The key is those 2 overshoot values.
Going past 1 twice snapping back below 1 is what creates the spring feel on hover.
Have you used linear() before? 👀