Skip to content

CSS Transition Generator with Live Preview

Choose what transitions and how long it takes, describe the state the element moves to, then toggle the preview element and copy the two rules the generator exports.

Runs locally in your browser
· transition · timing-function · interactive state
CONTROL RACK
LIVE STAGE
EXPORT CSS

How to build a transition and its target state

The workbench returns a pair of CSS rules: a base rule that carries the transition shorthand — property, duration, easing and delay — and a target rule with the transform, opacity, background colour and filter the element changes to. Toggling the preview element runs that pair on a real DOM node, so the state change you see is the state change you copy.

Every control is exported exactly as the readout shows it. Values stay inside the range printed next to each field, and a cleared field returns to its last valid value instead of exporting a zero. The conversion runs in the page: nothing is uploaded and the tool keeps working offline.

  1. Start from a preset — Hover lift, Fade, Zoom, Color swap or Soft spin — or choose the transitioned property and set the values yourself. Editing any control switches the list back to Custom.
  2. Set the timing: duration and delay in milliseconds, plus one of the seven easing options, which include two cubic-bézier curves. The readout in the stage header names the duration and easing currently exported.
  3. Describe the target state with translateY, scale and rotation, then the opacity and colour the element turns. Each field keeps its own range: translateY −120 to 120 px, scale 0.2 to 2, rotation −360 to 360 degrees and opacity 0 to 1.
  4. Click the preview element, or the Toggle state button, to run the transition. Click again to return to the base state.
  5. Take the two rules with Copy CSS, and press Reset to return every control to the Hover lift defaults and clear the toggled state.

What the two exported rules do

Why the export is a pair of rules

The first rule holds the transition shorthand: which property animates, how long it takes, the easing curve and any delay. The second rule describes the target state — the transform, the opacity, the background colour and a slight brightness and saturation filter — and it is applied when you toggle the element.

Only the properties listed in the transition shorthand animate. If the list says opacity, the transform, colour and filter of the target rule are applied in one step; with all, every value that differs moves together. The preview behaves the same way.

Choosing the transitioned property

The property selector offers all, transform, opacity, background-color and filter — the five things the preview element changes. Naming one keeps the exported list short, which is usually what a hover or focus state needs; all is the safe choice while you are still experimenting.

The presets preload that choice: Hover lift animates all, Fade animates opacity, Zoom and Soft spin animate transform, and Color swap animates background-color. The remaining controls still describe the target state in every case, so you can edit a preset and keep the parts you like.

Ranges, easing and testing

Duration runs from 0 to 5000 ms and delay from 0 to 3000 ms; both are rounded to whole milliseconds. The easing list carries the five CSS keywords together with two cubic-bézier curves, and the readout always prints the value that appears in the exported rule.

Because the numbers are clamped to the range printed on the field, the exported rule never carries a value the browser would drop or reinterpret — a negative time, for example, is read as a delay rather than a duration. Test the copied rules on the element that will really animate: a transform on an ancestor composes with the one you animate.

Recent tools: