0

我知道在 PHP 中我可以做这样的事情:

if ($foo == true && $bar == true) {
    // Both true
} elseif ($foo == false && $bar == false) {
    // Both false
}

我怎么能在 Sass 中做到这一点?或者我可以...关于这个主题的文档很少http://sass-lang.com/documentation/file.SASS_REFERENCE.html#_6

我试过这样的事情:

@if $foo == false $bar == false {
    // Both false
}

不给出错误,但它只评估$foo.

这也行不通:

@if $foo == false && $bar == false {
    // Both false
}

也不是这个:

@if $foo == false AND $bar == false {
    // Both false
}

谢谢!

4

1 回答 1

0

§6.4.4 - 布尔运算

SassScript 支持布尔值的 、 和 运算andornot

于 2013-10-16T15:15:45.740 回答