From 7341f36377752f6b1cbae1350d4cb3d5bdbd0cd9 Mon Sep 17 00:00:00 2001 From: Black Mirror Date: Mon, 5 Mar 2018 18:04:21 +0100 Subject: [PATCH] is-length with zero value bugfix --- scss/types/_common.scss | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scss/types/_common.scss b/scss/types/_common.scss index cfd5fec..ff7f263 100644 --- a/scss/types/_common.scss +++ b/scss/types/_common.scss @@ -8,10 +8,6 @@ $css-default-modes: (initial, inherit); @return is-defined($cd) and array-contains($css-default-modes, $cd); } -@function is-not-unitless-or-zero($v) { - @return not(unitless($v)) or (unitless($v) and $v==0); -} - @function is-calc-length($cl) { @return is-defined($cl) and string-starts-with($cl + '', 'calc(') and string-ends-with($cl + '', ')'); } @@ -25,13 +21,13 @@ $length-modes: array-concat((auto), $css-default-modes); $relative-length-units: (em, ex, ch, rem, vw, vh, vmin, vmax); @function is-relative-length($l) { - @return is-number($l) and is-not-unitless-or-zero($l) and (array-contains($relative-length-units, unit($l)) or is-percentage($l)); + @return is-number($l) and ($l==0 or (not(unitless($l) and (array-contains($relative-length-units, unit($l)) or is-percentage($l))))); } $absolute-length-units: (cm, mm, in, px, pt, pc); @function is-absolute-length($l) { - @return is-number($l) and is-not-unitless-or-zero($l) and array-contains($absolute-length-units, unit($l)); + @return is-number($l) and ($l==0 or (not(unitless($l) and (array-contains($absolute-length-units, unit($l)))))); } /// Checks is a value is a valid CSS length