aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaĆ«l Poupard <[email protected]>2021-05-25 07:23:41 +0200
committerXhmikosR <[email protected]>2021-07-21 16:20:01 +0300
commitca3ff6dc29df09bb77321eacfb072be8c48c0c54 (patch)
tree6ca43365dc6c0655ace287eb7669f160d64d8932
parent0ef990f18eab840f0fa2cc4ff3b3f3ff01a3a87e (diff)
downloadbootstrap-ca3ff6dc29df09bb77321eacfb072be8c48c0c54.tar.xz
bootstrap-ca3ff6dc29df09bb77321eacfb072be8c48c0c54.zip
Handle complex expressions in add() & subtract() (#34047)
-rw-r--r--scss/_functions.scss16
1 files changed, 16 insertions, 0 deletions
diff --git a/scss/_functions.scss b/scss/_functions.scss
index 9c0660315..8abc31164 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);
}