A Pen by Yvain Liechti on CodePen.
Created
August 26, 2015 09:10
-
-
Save ryuran/b7ed19b350c972e6489f to your computer and use it in GitHub Desktop.
gpVyNb
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
<div>hover</div> |
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
div { | |
position: relative; | |
padding: 10px; | |
margin: 10px; | |
display: inline-block; | |
&:before, | |
&:after { | |
content: ''; | |
display: block; | |
position: absolute; | |
border: 1px solid transparent; | |
box-sizing: border-box; | |
height: 0; | |
width: 0; | |
transition: width 1s ease 0s, height 1s ease 1s; | |
} | |
&:before { | |
left: 0; | |
top: 0; | |
border-width: 1px 0 0 1px; | |
} | |
&:after { | |
right: 0; | |
bottom: 0; | |
border-width: 0 1px 1px 0; | |
} | |
&:hover { | |
color: red; | |
&:before, | |
&:after { | |
border-color: #000; | |
height: 100%; | |
width: 100%; | |
transition: width 1s ease 1s, height 1s ease 0s; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment