Sass编译并在变量之间添加空格

Sass compiling and adding spaces between variables

我有一些 Sass 代码:margin-top: -($height+40)#{$unit};

编译并输出“-140 vh”而不是“-140vh”。它基本上是添加一个 space。我想我正在使用一些旧代码。我应该怎么做?

最好用带单位的数字,比如下面的代码。更多信息:https://sass-lang.com/documentation/operators/numeric

$height: 100vh;
margin-top: -($height+40);

但如果有理由在单独的变量中使用单位,则以下代码可能会有用:

$height: 100;
$unit:vh;
margin-top: #{-($height+40)}#{$unit};