Last active
August 30, 2025 18:12
-
-
Save Kcko/86a4484708ec269312719d5aa9407053 to your computer and use it in GitHub Desktop.
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
/* works in one direction, if both direction is needed, we need to use | |
@starting-style for second direction, @see: https://www.youtube.com/shorts/xVt8Foa2u7I (Kevin Powell) | |
/* toggle - two 2 , starting-style needed */ | |
/* https://jsbin.com/sokazavera/edit?html,css,output */ | |
.txt { | |
background-color: #eee; | |
padding: 20px; | |
margin-top: 15px; | |
border-radius: 4px; | |
border: 1px solid #ccc; | |
display: none; | |
opacity: 0; | |
transition-property: all; | |
transition-duration: 1s; | |
transition-behavior: allow-discrete; | |
} | |
.txt.show { | |
display: block; | |
opacity: 1; | |
@starting-style { | |
opacity: 0; | |
} | |
} | |
/* one way | |
https://jsfiddle.net/oz6m4ctd/9/ | |
*/ | |
box { | |
width: 20%; | |
height: auto; | |
aspect-ratio: 1/1; | |
display: block; | |
position: relative; | |
transition: all 0.25s; | |
transition-behavior: allow-discrete; | |
opacity: 1; | |
scale: 1; | |
} | |
.box.closed { | |
display: none; | |
opacity: 0; | |
scale: 0; | |
width: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment