CSS @starting-style: Animating
Elements Into Existence
The enter animation problem has been with us since CSS transitions were invented. When you
append
an element to the DOM, the browser has no "previous" computed style to animate from,
so the transition is silently skipped. The workarounds — setTimeout,
requestAnimationFrame, forced reflows — all feel
like duct tape.
@starting-style finally gives us a clean,
declarative answer.