CSS transition on <dialog> backdrop-filter
Hi! I have managed to add a
backdrop-filter
of blur to a <dialog>
element, but I cannot seem to figure out how to fade it in. One StackOverflow thread mentioned using opacity()
but the below CSS just snaps in the blur (And it seems that Safari doesn't support the :open
tag so that isn't great). Any help would be appreciated :)
Here's a minimum reproduction Codepen that I've set up, most of this is just copy paste from the mdn docs, my real code is quite different but the CSS is identical.
https://codepen.io/Zax71/pen/MYwvLwd8 Replies
You could try using
@starting-style{}
It won’t work on all browsers so it would be progressive enhancement.Ooh, seems like it is avaliable on all now

This doesn't work for me, maybe I'm missing something with the syntax
I've changed the CSS to work in a similar style to Kevin's video on it (https://www.youtube.com/watch?v=vmDEHAzj2XE) and that doesn't fix this either
The problem here is you are only changing the
::backdrop
, which is a child of the dialog
. When you close the dialog
, it instantly goes away.
You only need to do the display and overlay transitions on the dialog itself, not the backdrop:
I added a dark bg to the backdrop to make it more obvious here, you can remove/change that obviously 🙂Ah, thank you for the help :) That fades in the content of the
<dialog>
but not the background blur. Would you know why that is?
Ah, it's a browser thing. I think you did mention this in the video but I assumed it would have changed after a year
It works correctly in Chromium but my primary browser is Firefox (and upon installing Chrome it forces itself as the default browser so I don't have it installed most of the time)Firefox supports
allow-discrete
, but not for the display property yet :\ - https://caniuse.com/mdn-css_properties_display_is_transitionableYep, iirc that’s exactly what you mentioned in the video
https://bugzilla.mozilla.org/show_bug.cgi?id=1834877 there’s the bug report
1834877 - [css-display] allow 'display' to be animated; and when an...
NEW (nobody) in Core - CSS Transitions and Animations. Last updated 2025-06-03.