Created
April 16, 2019 06:28
-
-
Save justmarkup/993efabc8cceef238a65f5a25fcd609e to your computer and use it in GitHub Desktop.
:focus-within example
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
form { | |
padding: 10px; | |
position: relative; | |
overflow: hidden; | |
} | |
form:before { | |
content:""; | |
background: #ddd; | |
position: absolute; | |
left: 0; | |
right: 0; | |
top: 0; | |
bottom: 0; | |
z-index: -1; | |
transform: translateY(-100%); | |
transition: transform 260ms ease-out; | |
} | |
form:focus-within:before { | |
transform: translateY(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment