Skip to content

Instantly share code, notes, and snippets.

@hendriklammers
Created November 8, 2012 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hendriklammers/4037649 to your computer and use it in GitHub Desktop.
Save hendriklammers/4037649 to your computer and use it in GitHub Desktop.
Sass: underline mixin
/* Replace default underline on a link with a bottom border */
@mixin underline($color, $width: 1px) {
text-decoration: none;
display: block-inline;
position: relative;
&:before {
content: '';
display: block-inline;
position: absolute;
left: 0;
width: 100%;
height: 1em;
margin-top: 0.3em;
border-bottom: $width solid $color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment