为什么这在 Stylus 中不起作用?
gutter = 2%
get(numerator, denominator)
x = (numerator / denominator) * 100% // get(1, 4) returns 25% as it should
(x) - gutter // returns x as 24.5% wtf
在 Sass 中运行良好
$gutter: 2%;
@function foo($numerator, $denominator) {
$x: ($numerator / $denominator) * 100%;
@return $x - $gutter;
}
foo {
width: foo(1, 4); // returns 23% as it should
}