Last active
December 11, 2015 06:08
-
-
Save rwillrich/4557000 to your computer and use it in GitHub Desktop.
Mixin that uses some Compass functions to fix vertical rhythm based on a fixed height and a font size.
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 fix-vertical-rhythm($height, $font-size: $base-font-size, $padding: true) { | |
@if $height > 0 { | |
$lines: lines-for-font-size($height); | |
$offset: rhythm($lines, $font-size, $height) / 2; | |
@if $padding { | |
padding-top: $offset; | |
padding-bottom: $offset; | |
} | |
@else { | |
margin-top: $offset; | |
margin-bottom: $offset; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment