It would be my deepest displeasure to bring a button toggle animation to production that requires more than CSS.
Quick example I found:
https://hudecz.medium.com/how-to-create-a-pure-css-toggle-bu...
Easing/Smoothing is possible with transition-timing-function.
https://www.w3schools.com/cssref/css3_pr_transition-timing-f....
Of course CSS could do it with less JS, but this would have been a totally different post.
It would be my deepest displeasure to bring a button toggle animation to production that requires more than CSS.
Quick example I found:
https://hudecz.medium.com/how-to-create-a-pure-css-toggle-bu...
Easing/Smoothing is possible with transition-timing-function.
https://www.w3schools.com/cssref/css3_pr_transition-timing-f....