Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Mixin that uses some Compass functions to fix vertical rhythm based on a fixed height and a font size.
@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
You can’t perform that action at this time.