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: v4.6.1~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca3ff6dc29df09bb77321eacfb072be8c48c0c54;p=thirdparty%2Fbootstrap.git Handle complex expressions in add() & subtract() (#34047) --- diff --git a/scss/_functions.scss b/scss/_functions.scss index 9c06603150..8abc31164e 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -120,6 +120,14 @@ @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); } @@ -140,5 +148,13 @@ @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); }