Skip to content

Instantly share code, notes, and snippets.

@iamkeir
Last active October 5, 2021 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamkeir/e3828ae1b1885c57f53555033e5a9575 to your computer and use it in GitHub Desktop.
Save iamkeir/e3828ae1b1885c57f53555033e5a9575 to your computer and use it in GitHub Desktop.
Fade in/out - CSS only
.thing {
transform: scale(0);
opacity: 0;
/* closing: delay transform scale by the duration of opacity fade */
transition: opacity 0.2s ease-in-out, transform 0s 0.2s;
}
.thing-show {
transform: none;
opacity: 1;
/* opening: transform scale immediately, then opacity fade */
transition: opacity 0.2s ease-in-out, transform 0s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment