diff options
| author | Gaƫl Poupard <[email protected]> | 2021-05-25 07:23:41 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-25 08:23:41 +0300 |
| commit | 50cf7f48ccf0e46ebc0968c1fc4db465db9f8b0d (patch) | |
| tree | 8e5e26f0b56a6038daeefff4cbbc7ac9881e2aa7 | |
| parent | b513a19003815b9c300df6b54419fa0123bff9c6 (diff) | |
| download | bootstrap-50cf7f48ccf0e46ebc0968c1fc4db465db9f8b0d.tar.xz bootstrap-50cf7f48ccf0e46ebc0968c1fc4db465db9f8b0d.zip | |
Handle complex expressions in add() & subtract() (#34047)
| -rw-r--r-- | scss/_functions.scss | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scss/_functions.scss b/scss/_functions.scss index 29114fc81..f92355f42 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); } |
