CSS·Advanced·Coding·1 min read
Why are transform and opacity considered compositor-friendly?
Short interview answer
Under common browser optimizations, changes to these properties can often be handled entirely by the compositor thread using an existing layer, skipping layout and much of paint, which keeps the animation smooth even if the main thread is busy.
Example
/* smooth even under main-thread load */.drawer { transition: transform 250ms ease; transform: translateX(-100%); }.drawer.open { transform: translateX(0); }Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.