CSS transform
The CSS property that moves, rotates, scales or skews an element without changing the layout around it.
In more detail
transform is cheap to animate, but it also creates a stacking context and a containing block, which can clip or misplace overlays inside it. It is also the property that the reduced-motion guidance most often targets, because large movements and zooms are made with it.
Example
In the browser: transform: translateY(20px) shifts an element down on screen while surrounding elements stay where they are. Because it skips layout and paint, it is the preferred property for smooth animation.Related terms
- stacking context — A group of elements that the browser layers together, so their z-index values only compete with each other and not with the rest of the page.
- hardware acceleration — Letting the computer's graphics chip do drawing work, which makes animations of properties such as transform and opacity smooth.
- opacity — The CSS property that sets how see-through an element is, from 0 for invisible to 1 for fully solid.
- compositing — The final rendering stage, in which separately painted layers are stacked and drawn together on screen, usually by the GPU.
- CSS animation — Changing an element's styles smoothly over time using @keyframes and the animation property, without JavaScript.
- list virtualization — Rendering only the rows of a long list that are currently visible, plus a few extra, instead of creating DOM nodes for every item.
Taught in
- Overlay Architecture: Portals, Stacking Contexts & Backdrops — Design Systems & Component Engineering
- Visual Contrast Auditing: Color Blindness & Reduced Motion — Design Systems & Component Engineering
- Layout, Reflow, Paint And GPU Compositing Layers — Frontend Architecture & Web Platform
- Modern CSS Animations, Transitions And View Transitions API — Frontend Architecture & Web Platform
- Virtualization: Rendering Infinite Datasets Efficiently — React 19 & Modern Component Architecture