A worked example, rendered from real sample data. Sign in to run the tool on your own input.
property: all
duration: 0.3s
timing: ease-in-out
from: background:#fff; transform:scale(1)
to: background:#3b82f6; transform:scale(1.1).element {
background:#fff;
transform:scale(1);
transition: all 300ms ease-in-out;
}
.element:hover,
.element.is-active {
background:#3b82f6;
transform:scale(1.1);
}
@media (prefers-reduced-motion: reduce) {
.element {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Shorthand: transition: all 300ms ease-in-out; */
/* Cost: 0 of 1 animated property runs on the compositor. */
/* HTML: <div class="element" style="padding:24px 40px;border-radius:12px;background:#3b82f6;color:#fff;font:600 15px system-ui">Hover me</div> */
Build and preview CSS transitions with property, duration, and easing controls. Part of the DevTools Surf developer suite. Browse more tools in the Animation / CSS collection.