CSS Transitions

Let's use CSS transitions in this lesson.

Transition Property

When we add the new CSS class to our elements in the previous example, the transform property changes the orientation of the element on the screen. We can change the element in other ways, however. Our new classes could specify a background color, change the margin, add a border, and so on. There are many properties of a DOM element that we can change with the addition of new CSS classes. Generically, we can call these property changes transitions.

CSS provides what we can think of as a meta-property called transition. The transition property allows us to describe the behavior of the CSS element when one of its display properties changes. The default behavior is that the property changes instantly.

Implementing Transitions

It doesn’t take much syntax to use the transition property to make our arrows move. All we need to do is add one new CSS class to our SCSS (again, Tailwind can do ...