Created
November 22, 2015 12:18
-
-
Save sambaldwin/ac6af25c781f2b283c3b to your computer and use it in GitHub Desktop.
Sass mixin for visible baseline grid
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 baseline-grid( | |
$line-height: false, | |
$offset: false, | |
$element: html, | |
$colour: rgba(0,0,0,.2) | |
) { | |
#{$element} { | |
&:after { | |
content: ""; | |
position: absolute; | |
top: $offset; | |
height: 100%; | |
width: 100%; | |
background-image: | |
linear-gradient( | |
180deg, | |
$colour, | |
$colour 1px, | |
transparent 1px, | |
transparent | |
); | |
background-size: $line-height $line-height; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
or without all the options: