From: Gaƫl Poupard Date: Tue, 25 May 2021 05:23:41 +0000 (+0200) Subject: Handle complex expressions in add() & subtract() (#34047) X-Git-Tag: v5.0.2~68 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=50cf7f48ccf0e46ebc0968c1fc4db465db9f8b0d;p=thirdparty%2Fbootstrap.git Handle complex expressions in add() & subtract() (#34047) --- diff --git a/scss/_functions.scss b/scss/_functions.scss index 29114fc816..f92355f422 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -181,6 +181,14 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 @return $value1 + $value2; } + @if type-of($value1) != number { + $value1: unquote("(") + $value1 + unquote(")"); + } + + @if type-of($value2) != number { + $value2: unquote("(") + $value2 + unquote(")"); + } + @return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2); } @@ -201,5 +209,13 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 @return $value1 - $value2; } + @if type-of($value1) != number { + $value1: unquote("(") + $value1 + unquote(")"); + } + + @if type-of($value2) != number { + $value2: unquote("(") + $value2 + unquote(")"); + } + @return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2); }