CSS Tools

Discrete Transition Generator

Build CSS transitions for elements that toggle display, such as dialogs, popovers, disclosure panels, and menus. Uses transition-behavior: allow-discrete and @starting-style for smooth enter and exit animations.

Loading tool...

What is Discrete Transition Generator?

CSS traditionally cannot transition between display: none and display: block. The transition-behavior: allow-discrete property and @starting-style rule now enable smooth transitions for appearing and disappearing elements. This is essential for dialogs, popovers, tooltips, and disclosure panels.

Quick answer

Discrete transitions enable CSS transitions for display:none and other discrete properties when an element enters or leaves the DOM. Use @starting-style to define the initial state before the element appears.

Limitations

  • Discrete transitions for display require Chrome 117+ or Safari 17.5+. Firefox support is behind a flag as of early 2026.
  • @starting-style is required for the entry animation. Without it the element snaps into its final state before starting the transition.
  • Discrete transitions only animate the entry and exit where display changes. Mid-state transitions between intermediate values are not supported for discrete properties.

How to use this tool

  1. Choose the element type you want to animate: dialog, popover, or disclosure panel.
  2. Set enter and exit animation properties such as opacity and transform.
  3. The tool generates the @starting-style and transition CSS.
  4. Copy the CSS and apply it to your dialog, popover, or details element.

What you can use it for

  • Add a fade-in effect to a dialog modal when it opens.
  • Create a slide-down animation for disclosure panels.
  • Build smooth enter and exit animations for popovers.

Use cases

Practical examples

Example

Dialog fade-in animation

A dialog fades in with opacity and scales up from 0.9 to 1 using @starting-style. On close, it fades back out using the same transition.

Example

Popover slide transition

A popover slides in from the top with a smooth transition and fades out on close, using overlay and transition-behavior: allow-discrete.

Common mistakes

  • Forgetting to add transition-behavior: allow-discrete to the transitioning element.
  • Not accounting for the overlay property in dialog and popover transitions.
  • Creating animations that are too slow and frustrate users.

Verification

  1. Test the entry and exit transitions in Chrome or Safari and verify the animation plays in both directions.
  2. Check the browser console for any CSS transition warnings related to discrete properties.

FAQ

Questions about Discrete Transition Generator

What does transition-behavior: allow-discrete do?

It enables transitions for properties that normally cannot be transitioned, such as display and overlay.

Do I need @starting-style?

Yes. It defines the initial state of the element before it appears, such as opacity: 0 or transform values. Without it, the element appears at its final state first.

Related tools

More css tools

Also try

Also try