Created
February 9, 2017 10:04
-
-
Save lukasholzer/76a4f48f7a80cfab2a5c01096e8e5975 to your computer and use it in GitHub Desktop.
Fancy Link hover 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
$fh_line_height: 1.5em !default; | |
$fh_border_thickness: 1px !default; | |
/* * | |
* Uses Classes .is-mobile and .is-desktop on the body Element | |
* to determine if you browse on a mobile device or not. | |
*/ | |
@mixin fancy-hover($fh_border_color) { | |
position: relative; | |
display: inline-block; | |
cursor: pointer; | |
line-height: $fh_line_height; | |
&:after { | |
content: ' '; | |
position: absolute; | |
left: 0; | |
bottom: 0.1em; | |
width: 0%; | |
height: $fh_border_thickness; | |
background: $fh_border_color; | |
transition: width 150ms ease-out; | |
.is-mobile &.link--underline { | |
width:100%; | |
} | |
} | |
&:hover:after { | |
.is-desktop & { | |
width: 100%; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment