It is possible to animate the transition between DOM states using CSS and JavaScript.
Buttons with hover animations using only CSS