CSS transition-behavior - Interactive CSS Lab | IconVault
Learn transition-behavior: allow-discrete with live side-by-side demos. Animate display and visibility transitions, copy the CSS.
CSS transition-behavior
allow-discrete: animate display and visibility
Discrete property
display is the hard one: the element is removed from rendering entirely.
5 of 5 free uses left. Toggling and sliders are unlimited.
display (default)
defaultWithout allow-discrete, display flips instantly and opacity never gets a chance to run.
display + allow-discrete
allow-discreteWith allow-discrete, the discrete flip happens at the 50% mark, so opacity and transform animate around it. Watch the hide: it fades first, then display flips.
.panel {
transition: opacity 500ms ease, transform 500ms ease, display 500ms;
transition-behavior: allow-discrete; /* the one line that changes everything */
}
/* Entry from display:none also needs a defined starting point */
@starting-style {
.panel {
opacity: 0;
transform: translateY(10px);
}
}Rules worth remembering
transition-behavior: allow-discretelets discrete properties (display,visibility) participate in transitions, flipping at 50%.- Exit animations work with
allow-discretealone. Entry fromdisplay: noneadditionally needs@starting-stylefor the from-values. - It also applies to discrete values of animatable properties, and to the new
overlayproperty used with popovers and dialogs.
About this tool
IconVault's CSS transition-behavior lab shows what one line of CSS changes. Two panes toggle display or visibility together: the default pane flips instantly, while the allow-discrete pane fades and slides around the flip, because discrete properties now participate in the transition and change at the 50% mark. A duration slider lets you slow the whole thing down and watch it happen.
The tool generates the complete recipe including the @starting-style block that entry-from-none needs, and it is free and runs fully in your browser. transition-behavior is Baseline new (Chrome 117+, Safari 18+, Firefox 129+), and the page spells out exactly which half of the animation each piece is responsible for.
Frequently asked questions
Popular searches
More tools
Algorithm Visualizer
Watch sorting and searching animate step by step
Alt Text Helper
Write better image alt text with live feedback
ARIA Reference
Searchable ARIA roles and attributes guide
Array Visualizer
Step through map, filter, reduce like a debugger
Coming soon
CLI
Coming soon
Figma plugin
Coming soon
VS Code extension
Coming soon
Chrome extension
Coming soon
AI icon generator
Coming soon
Team workspaces
Coming soon