0

为什么这在 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
}
4

1 回答 1

2

是的,确实如此。我很讨厌没有注意到这一点。这行得通。

gutter = 2
get(numerator, denominator)
    x = (numerator / denominator) * 100 // get(1, 4) returns 25% as it should
    width ((x) - (gutter))% // returns x as 24.5% wtf
span
    display inline-block
    height 40px
    get(1, 4)
于 2013-05-15T00:09:59.483 回答