Animation Properties
Learn about the animation utilities to transform, scale, rotate, skew, and translate the elements.
We'll cover the following...
Transformation
CSS allows us to transform the box of an element in various ways, changing its size, location, rotation, or skew. Tailwind provides some reasonable defaults that are combined with transitions and animation to easily build some great effects.
All of these transformation utilities need to be combined with .transform
, which in turn needs to be declared as a class in the same element—for example, "transform scale-100"
.
Changing the scale
Tailwind lets us change the scale of an element with the .scale-{percentage}
family, where the suffix is the percentage to scale. The options are 0
, 50
, 75
, 90
, 95
, 100
, 105
, 110
, 125
, and 150
. These are designed to allow for subtle effects, such as "transform transition duration-1000 hover:scale-110"
. These are used to make an element get slightly bigger on hover over the course of a second. When we add in ...