Transformations
Tailwind lets you create certain transformations using a number of tags.
Transform
transform transform-gpu transform-none
There are three main transformation classes. It sets up the element so that it can be transform and acts as a reset for all of the transformation properties like translate, rotate, skew and scale.
The transform class is the base class and there's an optional class that tries to use the GPU or Graphical User Processor if it's available. That can yield faster animations.
The last class will ignore transforms if they exist.
Rotate
(-)rotate(-DEG)- AMT
01236124590180
- AMT
Since we already looked at rotation, let's take a look at the options there. You can rotate on 9 different angles. Rotation happens clockwise by default, but you can add a negative sign at the beginning so that it goes counter clockwise.
Scale
scale(-DIR)(-SIZ)- DIR
xy - SIZ
050759095100
105110125150
- DIR
Scaling will allow you to resize elements. You can scale horizontally (in the x direction), vertically or both.
There's really just a handful of sizes here and honestly, they seem inadequate.
Skew
(-)skew(-DIR)(-DEG)- DIR
xy - DEG
0123612
- DIR
Another transformation you can perform is a skew that takes in an angle, direction and can optionally take in a negative value.
Translate
(-)translate(-DIR)(-AMT)- DIR
xy - AMT
00.511.522.533.5456
789101112141620242832
3640444852566064728096
1/21/32/31/42/43/4pxfull
- DIR
Translating means moving the object in a certain direction from it's origin. You can go in the x or y direction and also move in a negative direction with a full compliment of amounts from 0 to 96, fractions, px which is one pixel and full which is the full width.
Transform Origin
origin(-DIR)- DIR
centertoptop-rightrightbottom-rightbottom
bottom-leftlefttop-left
- DIR
These classes will let you set the origin for transformations. The names are pretty self explanatory.