mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Handle complex expressions in add() & subtract() (#34047)
This commit is contained in:
parent
b513a19003
commit
50cf7f48cc
1 changed files with 16 additions and 0 deletions
|
@ -181,6 +181,14 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
|
||||||
@return $value1 + $value2;
|
@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);
|
@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;
|
@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);
|
@return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue