Skip to content

Instantly share code, notes, and snippets.

@maxxscho
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxxscho/263d3f771c112aa3b051 to your computer and use it in GitHub Desktop.
Save maxxscho/263d3f771c112aa3b051 to your computer and use it in GitHub Desktop.
Animated underline on link hover mixin
/**
Adds an animated underline hover effect
a {
@include animated-underline(#000000);
// your styles here
}
*/
@mixin animated-underline($color: $color__link, $bottom: 3px, $height: 1px) {
position: relative;
display: inline-block;
&:after {
content: "";
position: absolute;
bottom: $bottom;
left: 0;
width: 100%;
height: $height;
background-color: $color;
visibility: hidden;
transform: scaleX(0);
transition: all 0.3s ease-in-out;
}
&:hover {
&:after {
visibility: visible;
transform: scaleX(1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment