sseeeedd icon indicating copy to clipboard operation
sseeeedd copied to clipboard

Basic animations for details & popover

Open ffoodd opened this issue 1 year ago • 0 comments

@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;
  }
}

ffoodd avatar Jan 29 '25 09:01 ffoodd