Last active
August 29, 2015 14:14
-
-
Save maxxscho/263d3f771c112aa3b051 to your computer and use it in GitHub Desktop.
Animated underline on link hover mixin
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
/** | |
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