allow-discrete: Animasi ke display:none

Wulan’s toast and the colour menu on the workshop’s order page: write the CSS, close and open, then read display, opacity and overlay every frame from the…

Why it matters

Toasts, dropdowns, dialogs and popovers all come and go. Without understanding discrete properties you are stuck between a broken fade and a transparent element that still blocks clicks. With allow-discrete, @starting-style and overlay, smooth entry and exit take only CSS.

The key idea

display is discrete: on or off, no value in between

Common mistakes

Try it in this playground