Transitions interpolate property values over time for smoother state changes.
Transition components
transition-propertytransition-durationtransition-timing-functiontransition-delay
Production checklist
- Animate only meaningful properties.
- Keep durations short for UI feedback (~120-250ms typical).
- Respect reduced motion preferences.
Important interview questions and answers
- Q: Why avoid
transition: all?
A: It may animate unintended properties and hurt performance predictability. - Q: Transition vs animation?
A: Transition responds to state changes; animation can run independently with keyframes. - Q: Good transition timing for buttons?
A: Fast, subtle easing to reinforce feedback without lag.
Practice: Change one property in the playground and observe cascade + layout in DevTools.