vertical rhythm function for calculating rhythms without returning a property

This commit is contained in:
Eric Meyer 2011-04-12 15:13:42 -06:00
parent e66c822503
commit bc4e3eeb44
2 changed files with 29 additions and 20 deletions

View File

@ -7,7 +7,7 @@ GIT
PATH
remote: .
specs:
compass (0.11.beta.6.7c5f831)
compass (0.11.beta.6.e66c822)
chunky_png (~> 1.1.0)
sass (>= 3.1.0.alpha.249)

View File

@ -51,9 +51,18 @@ $base-half-leader: $base-leader / 2;
line-height: 1em * $lines * $base-line-height / $font-size;
}
// Calculate rhythm units
@function rhythm(
$lines: 1,
$font-size: $base-font-size
) {
$rhythm: 1em * $lines * $base-line-height / $font-size;
@return $rhythm;
}
// Apply leading whitespace
@mixin leader($lines: 1, $font-size: $base-font-size, $property: margin) {
#{$property}-top: 1em * $lines * $base-line-height / $font-size;
#{$property}-top: rhythm($lines, $font-size);
}
@mixin padding-leader($lines: 1, $font-size: $base-font-size) {
@ -66,7 +75,7 @@ $base-half-leader: $base-leader / 2;
// Apply trailing whitespace
@mixin trailer($lines: 1, $font-size: $base-font-size, $property: margin) {
#{$property}-bottom: 1em * $lines * $base-line-height / $font-size;
#{$property}-bottom: rhythm($lines, $font-size);
}
@mixin padding-trailer($lines: 1, $font-size: $base-font-size) {