Igosuki / compass-mixins

A collection of compass' stylesheet for bower dependencies and libsass
Other
592 stars 197 forks source link

@function rhythm behaves differently than compass #69

Open jasunde opened 8 years ago

jasunde commented 8 years ago

When using $font-unit: 1rem the rhythm function still outputs a calculation like what is need when using ems for the rhythm unit. I'm a n00b here so I'm not sure the proper way to make this suggestion:

// Calculate rhythm units. @function rhythm( $lines: 1, $font-size: $base-font-size, $offset: 0 ) { @if not($relative-font-sizing) and $font-size != $base-font-size { @warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function"; }

// Suggestion // @if $font-unit == 1rem { $font-size: $font-unit; }

$rhythm: $font-unit * ($lines * $base-line-height - $offset) / $font-size; // Round the pixels down to nearest integer. @if unit($rhythm) == px { $rhythm: floor($rhythm); } @return $rhythm; }