Created
October 13, 2016 10:07
-
-
Save arthurattwell/e5c790bd076966b00f39a29586a20d37 to your computer and use it in GitHub Desktop.
Sass mixin to control text underline (designed for use with PrinceXML)
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
@mixin underlined($thickness,$start-position,$end-position,$vertical-position) { | |
display: inline-block; | |
position: relative; | |
&:after { | |
content: ""; | |
position: absolute; | |
display: inline-block; | |
left: $start-position; // 0 is flush with start of text | |
right: $end-position; // 0 is flush with end of text | |
bottom: $vertical-position; // Positive units move underline closer to text, negative units further away | |
border-bottom: $thickness solid; // Will inherit font color | |
z-index: -1; // Underline falls beneath the text | |
} | |
} | |
// // Example usage: | |
// .underlined { | |
// @include underlined(0.02em,0.4em,0,0.3em); | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment