Skip to content

Instantly share code, notes, and snippets.

@babsgosgens
Last active December 20, 2015 17:59
Show Gist options
  • Save babsgosgens/6172639 to your computer and use it in GitHub Desktop.
Save babsgosgens/6172639 to your computer and use it in GitHub Desktop.
Calculates a value based on the $column-spacing.
@function horizontal-rhythm($fraction: 1/2)
{
$value: return-unitless( $fraction * $column-spacing );
@if $column-spacing-unit == 1rem {
@return $value/10*1rem;
}
@if $column-spacing-unit == 1em {
@return $value/$base-font-size*1em;
}
@if $column-spacing-unit == 1px {
@return $value*1px;
}
@if $column-spacing-unit == 1% {
@return $value/$base-font-size*1em;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment