diff --git a/_typesettings.scss b/_typesettings.scss index d6b7c40..b9d820e 100644 --- a/_typesettings.scss +++ b/_typesettings.scss @@ -105,8 +105,8 @@ $not-integer-txt: ' value breaks vertical rhythm. Use an interger (whole number) // Returns an EM value that is a multiple of our defined base vertical unit. For // example 3 becomes 1.125em -@function emRhythm($lines: $base-vertical-unit, $font-size: $base-em-font-size) { - @if is-int($lines) == false { +@function emRhythm($lines: $base-vertical-unit, $font-size: $base-em-font-size, $slient: false) { + @if is-int($lines) == false and $slient == false { @warn #{$lines} + $not-integer-txt; } @return (stripUnits($lines) * stripUnits($base-vertical-unit)) / (stripUnits($font-size) * stripUnits($base-font-size)) + 0em; @@ -114,8 +114,8 @@ $not-integer-txt: ' value breaks vertical rhythm. Use an interger (whole number) // Returns a unitless number that is a multiple of our defined base vertical unit. // For example 3 becomes 1.125 -@function unitlessRhythm($lines: $base-line-multi, $font-size: $base-em-font-size) { - @if is-int($lines) == false { +@function unitlessRhythm($lines: $base-line-multi, $font-size: $base-em-font-size, $slient: false) { + @if is-int($lines) == false and $slient == false { @warn #{$lines} + $not-integer-txt; } @return ($lines * stripUnits($base-vertical-unit)) / (stripUnits($font-size) * stripUnits($base-font-size)); diff --git a/test/test.css b/test/test.css index a8dd60f..78b6968 100644 --- a/test/test.css +++ b/test/test.css @@ -160,4 +160,7 @@ hr { padding-top: 1.4375em; } .div { - margin-bottom: 0.45em; } + margin-bottom: 0.1125em; } + +.div { + margin-bottom: 0.215625em; } diff --git a/test/test.scss b/test/test.scss index eb55087..2e753f0 100644 --- a/test/test.scss +++ b/test/test.scss @@ -1,5 +1,9 @@ @import "../typesettings"; .div { - margin-bottom: emRhythm(1.2); + margin-bottom: emRhythm(1.2, 4, true); +} + +.div { + margin-bottom: emRhythm(2.3, 4, false); }