Last active
July 4, 2016 20:06
-
-
Save donmccurdy/a4421e7d9980d024d910d12580ef2512 to your computer and use it in GitHub Desktop.
Fancy Underline (LESS 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
/** | |
* Based on work by Jonathan Neal. | |
* https://codepen.io/jonneal/pen/PzGYEE | |
*/ | |
@textUnderlineFade: 20%; | |
@textUnderlineColor: currentColor; | |
@textUnderlineBackgroundColor: #FFF; | |
@textUnderlinePosition: -.14em; | |
@textUnderlineSize: .05em; | |
@textUnderlineGap: .05em; | |
@textUnderlineGapMinimum: 2px; | |
.underline (@bgColor: @textUnderlineBackgroundColor) { | |
box-shadow: | |
inset 0 calc(@textUnderlinePosition + @textUnderlineSize) 0 0 @bgColor, | |
inset 0 @textUnderlinePosition 0 0 fade(@bgColor, @textUnderlineFade), | |
inset 0 @textUnderlinePosition 0 0 @textUnderlineColor; | |
text-decoration: none; | |
text-shadow: | |
@textUnderlineGap 0 @bgColor, | |
-@textUnderlineGap 0 @bgColor, | |
@textUnderlineGapMinimum 0 @bgColor, | |
-@textUnderlineGapMinimum 0 @bgColor; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment