What is the CSS Transition Generator?
Generate CSS transition declarations for hover states, focus rings, and interactive elements. Set property, duration, easing, and delay visually.
Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.
Using the CSS Transition Generator
Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.
Select the CSS properties to transition
Pick the properties that change on hover or state: background-color, transform, opacity, box-shadow, border-color.
Set duration and easing
Enter the transition duration in ms. Choose an easing function: ease, ease-in-out, cubic-bezier, or a spring preset.
Copy the transition declaration
Click Copy to get the transition property value. Add your hover/focus state rules separately.
What the generated code looks like
Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.
/* Button with smooth transitions */
.button {
background: #6C2EF5;
color: white;
padding: 12px 24px;
border-radius: 8px;
transition:
background-color 200ms ease,
transform 150ms ease,
box-shadow 200ms ease;
}
.button:hover {
background: #5a26cc;
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(108, 46, 245, 0.35);
}List each property separately in transition for fine-grained control. Using transition: all risks transitioning unexpected properties.
Pro tips for better results
Never use transition: all in production
transition: all transitions every changed property, including ones you did not intend. It wastes performance and can cause unexpected visual effects. Always list specific properties.
Colour transitions should be slightly slower than transform
150-200ms for transform changes feels instant but smooth. Colour changes at 200-300ms give the eye time to register the shift. Mixing durations creates a layered feel.
ease-out feels most natural for interactive elements
ease-out starts fast and slows down, which matches how physical objects behave when stopping. Use ease-in for elements leaving the screen, ease-out for elements arriving.
Only transition opacity and transform for best performance
These two properties are GPU-composited and never cause layout reflow. Transitioning width, height, or padding forces the browser to recalculate layout on every animation frame.
Frequently asked questions
From the blog
Read more →CSS Animations: A Practical Guide to Keyframes and Transitions (2026)
Learn the difference between transitions and keyframe animations, how to write @keyframes, the properties worth animating for 60fps, and easing that actually looks good.
CSS clamp() and Fluid Typography: Stop Writing Font-Size Media Queries (2026)
Learn how CSS clamp() creates type that scales smoothly between screen sizes with a single line, the formula behind it, and how to build a fully fluid type scale without media queries.
The Complete Guide to CSS Gradients (2026)
Master linear, radial, and conic CSS gradients. Learn color stops, angles, hard stops for stripes, multi-layer gradients, and the tricks behind smooth, professional results.