Last active
July 25, 2016 21:44
-
-
Save rogden/9745711 to your computer and use it in GitHub Desktop.
Rising Underline on Hover Effect (LESS Mixin)
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
// @example: http://jsbin.com/huharale/1/edit?html,css,output | |
.rising-underline(@color, @thickness, @distance: 3px) { | |
position: relative; | |
text-decoration: none; | |
&:after { | |
content: ""; | |
position: absolute; | |
bottom: -@distance; | |
left: 0; | |
width: 100%; | |
height: @thickness; | |
background-color: @color; | |
opacity: 0; | |
pointer-events: none; | |
transition: all .2s ease-out; | |
} | |
&:hover:after { | |
bottom: 0; | |
opacity: 1; | |
transition: all .15s ease-out; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See an example of usage here: http://jsbin.com/huharale/1/edit?html,css,output