sseeeedd
sseeeedd copied to clipboard
Basic animations for details & popover
@starting-style unveils easy defaults for transitions of such native elements, as stated by Adam Argyle in 6 CSS snippets for 2025 post.
/* enable transitions, allow-discrete, define timing */
[popover], dialog, ::backdrop {
transition: display 1s allow-discrete, overlay 1s allow-discrete, opacity 1s;
opacity: 0;
}
/* ON STAGE */
:popover-open,
:popover-open::backdrop,
[open],
[open]::backdrop {
opacity: 1;
}
/* OFF STAGE */
/* starting-style for pre-positioning (enter stage from here) */
@starting-style {
:popover-open,
:popover-open::backdrop,
[open],
[open]::backdrop {
opacity: 0;
}
}