Created
December 3, 2014 15:15
-
-
Save joar/7587734076d9f4692425 to your computer and use it in GitHub Desktop.
LESSCSS: Better underlines
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
/* Adapted to LESS from https://github.com/at-import/toolkit/blob/2.x.x/stylesheets/toolkit/_underline.scss */ | |
.better-underline(@background; @color; @underline-width: 3; @underline-distance: 2) { | |
@px: .0625em; | |
text-decoration: none; | |
background-image: linear-gradient(to top, @background 75%, @color 75%); | |
background-size: (2 * @px) ((1 + @underline-width) * @px); | |
background-position: 0 ((@underline-width) * @px) + @underline-distance; | |
background-repeat: repeat-x; | |
/* Original text shadow */ | |
// text-shadow: (1 * @px) (1 * @px) 0 @background, (-1 * @px) 0 0 @background; | |
/* Improved (?) text shadow */ | |
text-shadow: (1 * @px) 0 0 @background, (-1 * @px) 0 0 @background, 0 (1 * @px) 0 @background, 0 (-1 * @px) 0 @background; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment