Animation Beginner

Independent transforms without the shorthand

transform was one shorthand. To change only rotation you had to repeat translate and scale. Now translate, rotate, and scale are separate properties you can animate on their own.

8 lines
1.icon {
2  translate: 10px 0;
3  rotate: 45deg;
4  scale: 1.2;
5}
6.icon:hover {
7  rotate: 90deg;
8}
Old 6 lines
1.icon {
2  transform: translateX(10px) rotate(45deg) scale(1.2);
3}
4.icon:hover {
5  transform: translateX(10px) rotate(90deg) scale(1.2);
6  /* must repeat translate and scale */
Widely available Since 2022 92% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2022.

104+
72+
14.1+
104+
each transform is independent
✦
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more
⚑

Change one, keep the rest

Update only rotate or scale. No copying the whole transform string.

✦

Easier animation

Animate translate and rotate in different keyframes or with different timing.

∞

Same order

translate, rotate, scale always apply in that order. No shorthand order gotchas.

Lines Saved
Less repetition
No duplicate transform values
Old Approach
Single transform
Rewrite all to change one
Modern Approach
Separate properties
translate, rotate, scale

How it works

With transform: translateX(10px) rotate(45deg) scale(1.2), changing just the angle on hover meant repeating the whole list. Easy to get out of sync or miss a value.

The individual properties translate, rotate, and scale do the same thing but live on their own. You can set or animate any one without touching the others. They still combine into one transform in a fixed order: translate, then rotate, then scale.

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC