CSS transition
A CSS feature that animates a property smoothly from one value to another over a set time when it changes.
In more detail
Transitions and animations make interfaces feel responsive, but they must be turned down for people who ask for reduced motion and turned off during screenshot tests. Durations are often stored as tokens so they can be set to zero in one place.
Example
In the browser: You name the property to watch, the duration and an easing curve. transition: opacity 200ms ease makes any opacity change fade instead of jumping.Related terms
- prefers-reduced-motion — The CSS media feature that reports whether the user has asked their operating system to minimise animation.
- hardware acceleration — Letting the computer's graphics chip do drawing work, which makes animations of properties such as transform and opacity smooth.
- visual regression testing — Testing that takes screenshots of components and compares them pixel by pixel with approved baseline images to catch unintended visual changes.
- CSS animation — Changing an element's styles smoothly over time using @keyframes and the animation property, without JavaScript.
- interpolation — Calculating in-between values from a start value, an end value and progress, such as halfway between 0 and 20 being 10.
Taught in
- CSS Custom Properties & Dynamic Theming Architecture — Design Systems & Component Engineering
- Visual Contrast Auditing: Color Blindness & Reduced Motion — Design Systems & Component Engineering
- Visual Regression Testing: Playwright & Snapshot Differencing — Design Systems & Component Engineering
- Modern CSS Animations, Transitions And View Transitions API — Frontend Architecture & Web Platform