Created
May 4, 2020 17:57
-
-
Save mattbrett/258953b3b84640206c628cb8cb68cfe6 to your computer and use it in GitHub Desktop.
Animated Bottom Border on Hover for Text Links
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
.content a { | |
&:link, | |
&:visited, | |
&:active { | |
position: relative; | |
color: $grey-dark; | |
text-decoration: none; | |
transition: color 0.2s ease-out; | |
} | |
&:before, | |
&:after { | |
position: absolute; | |
display: block; | |
content: ''; | |
width: 100%; | |
height: 2px; | |
left: 0; | |
bottom: -2px; | |
background-color: $grey-lightest; | |
} | |
&:after { | |
background-color: $pink; | |
transform: scaleX(0); | |
transition: transform 0.2s ease-in-out; | |
} | |
&:hover:after, | |
&:focus:after { | |
transform: scaleX(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment