Skip to content

Instantly share code, notes, and snippets.

@mattbrett
Created May 4, 2020 17:57
Show Gist options
  • Save mattbrett/258953b3b84640206c628cb8cb68cfe6 to your computer and use it in GitHub Desktop.
Save mattbrett/258953b3b84640206c628cb8cb68cfe6 to your computer and use it in GitHub Desktop.
Animated Bottom Border on Hover for Text Links
.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