cubic-bezier() can overshoot once, but it cannot bounce back and settle. linear() takes a list of points and draws straight lines between them, and with enough points that becomes any curve you like.
.toast {
transition: translate 0.6s linear(0, 1.15 60%, 0.95 80%, 1);
}
Each number is the progress of the animation at a moment in time. Here it starts at 0, overshoots to 1.15 at 60 percent of the time, swings back under the target to 0.95 at 80 percent, and ends at 1. That is a small spring. Points without a percentage are spread out evenly.
With only a few points the motion looks a bit mechanical, because the segments are straight. For a smooth spring people generate a list of 20 to 40 points with an online generator and paste it in. I’d keep the long version in a custom property like --spring so the transition line stays readable.
Chrome 113, Firefox 112 and Safari 17.2 support it. In an older browser the whole transition declaration is invalid and is dropped, so declare a plain fallback with ease-out on the line before. And keep bounces short and small: a strong overshoot on every element gets tiring, and people who prefer reduced motion should not get it at all.
Further reading: MDN: linear() easing function