Last active
October 25, 2022 08:48
-
-
Save ryanand26/7118582 to your computer and use it in GitHub Desktop.
CSS keyframe animation for use with display:none
This file contains 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
@include keyframes(slideInAccordion) { | |
0% { | |
min-height: 0; | |
max-height: 0; | |
display: none; | |
} | |
1% { | |
min-height: 0; | |
max-height: 0; | |
display: block; | |
} | |
99% { | |
min-height:none; | |
max-height:50em; | |
display: block; | |
} | |
100% { | |
min-height:none; | |
max-height:none; | |
display: block; | |
} | |
} | |
.accordion-content { | |
display:none; | |
min-height: 0; | |
max-height: 0; | |
overflow:hidden; | |
@include animation-name(slideInAccordion); | |
&.accordion-open { | |
display:block; | |
min-height:none; | |
max-height:none; | |
@include animation-duration(500ms); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment