手写笔不能做简单的数学运算

时间:2013-05-14 18:27:22

标签: 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
}

1 个答案:

答案 0 :(得分: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)