0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-19 16:54:24 +01:00

Handle complex expressions in add() & subtract() (#34047)

This commit is contained in:
Gaël Poupard 2021-05-25 07:23:41 +02:00 committed by XhmikosR
parent 0ef990f18e
commit ca3ff6dc29

View File

@ -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);
}