Transitions and animations in CSS
To understand how Vue.js deals with transitions and animations, we will first need to have a quick refresher on how they work in CSS. We will focus on the bare basics, with the goal of revisiting the principles that govern transitions and animations. We will also look at their differences. The goal is to be able to understand better how Vue helps, rather than dive deep into the nuances of transitions and animations.
How CSS transitions work
When we hover over an element, we put that element in a hover state. When the user triggers a hover state through their interaction with our web page, we might want to emphasize that this change of state has occurred.
To emphasize that change of state, we could, for example, change the CSS background-color
property on that element when the user hovers over it.
This is where CSS transitions come in. When we write code for CSS transitions, we instruct the browser on how it will display changes made to that specific CSS property...