Transform
Base utilities for transforming elements.
Usage
Hardware acceleration
Use transform-gpu to force GPU acceleration for better performance:
<div class="scale-150 transform-gpu">
GPU-accelerated transform
</div>CPU rendering
Use transform-cpu to force CPU rendering if needed:
<div class="scale-150 transform-cpu">
CPU-rendered transform
</div>Removing transforms
Use transform-none to remove all transforms:
<div class="skew-y-3 md:transform-none">
Skewed on mobile, normal on desktop
</div>Custom transforms
Use arbitrary values for custom transform functions:
<div class="transform-[matrix(1,2,3,4,5,6)]">
Custom matrix transform
</div>
<div class="transform-[perspective(1000px)_rotateX(45deg)]">
Custom 3D transform
</div>Key Points
transform-gpuenables hardware acceleration withtranslateZ(0)transform-cpuforces CPU rendering (removes GPU acceleration)transform-noneremoves all transforms at once- Use
transform-gpufor better animation performance - Custom transforms use arbitrary values:
transform-[...] - Transform utilities (translate, rotate, scale, skew) automatically enable transform
- Hardware acceleration is usually beneficial for animations