Created
June 15, 2015 20:11
-
-
Save ffub/1062d270e50279ebbe60 to your computer and use it in GitHub Desktop.
Consistent underlines using gradients
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
/* | |
* Consistent underlines using gradients | |
* https://medium.com/designing-medium/crafting-link-underlines-on-medium-7c03a9274f9 | |
*/ | |
@mixin underline($colour:currentColor, $line-offset:1, $line-size:0.1) { | |
text-decoration: none; | |
background-repeat: repeat-x; | |
background-size: #{$line-size}em #{$line-size}em; | |
background-position: 0 #{$line-offset}em; | |
background-image: -webkit-linear-gradient(top, transparent 50%, $colour 50%); | |
background-image: linear-gradient(top, transparent 50%, $colour 50%); | |
// IE < 10 doesn't get it | |
.lt-ie10 & { | |
background: none; | |
text-decoration: underline; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment