Slide 39
Slide 39 text
@function _vertical-rhythm($font-size, $coefficient: 1) {
$between-lines : _strip-unit(_rem2px($_between-lines));
$base-line-height: _strip-unit(_rem2px($_base-line-height));
$base-font-size : _strip-unit(_rem2px($_base-font-size));
$font-size : _strip-unit($font-size);
$line-height: $font-size + ($between-lines * $coefficient);
@if ($line-height < $font-size + ($between-lines * 2)) {
@return _vertical-rhythm($font-size, ($coefficient + 1));
} @else {
@if ($font-size % $base-font-size == 0 and $font-size > $base-font-size) {
@return $line-height - ($between-lines / 2);
}
@return $line-height;
}
}