Last active
October 5, 2021 17:08
-
-
Save iamkeir/e3828ae1b1885c57f53555033e5a9575 to your computer and use it in GitHub Desktop.
Fade in/out - CSS only
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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