Last active
March 25, 2024 10:58
-
-
Save lgk-bsw/fe2ce38fc28285950272478fc5152505 to your computer and use it in GitHub Desktop.
Click outside of dropdown menu to close it, CSS only
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
.dropdown-content { | |
visibility: hidden; | |
opacity: 0; | |
} | |
.dropdown.dropdown-open .dropdown-content, | |
.dropdown:not(.dropdown-hover):focus .dropdown-content, | |
.dropdown:focus-within .dropdown-content { | |
visibility: visible; | |
opacity: 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment