If statement 在Sass中,如何比较if语句中的两个或多个值?
我知道,在PHP中,我可以执行以下操作:If statement 在Sass中,如何比较if语句中的两个或多个值?,if-statement,sass,If Statement,Sass,我知道,在PHP中,我可以执行以下操作: if ($foo == true && $bar == true) { // Both true } elseif ($foo == false && $bar == false) { // Both false } @if $foo == false $bar == false { // Both false } 我怎么能在Sass中做到这一点?或者我可以。。。关于这个话题的文档很少 我试过这
if ($foo == true && $bar == true) {
// Both true
} elseif ($foo == false && $bar == false) {
// Both false
}
@if $foo == false $bar == false {
// Both false
}
我怎么能在Sass中做到这一点?或者我可以。。。关于这个话题的文档很少
我试过这样的方法:
if ($foo == true && $bar == true) {
// Both true
} elseif ($foo == false && $bar == false) {
// Both false
}
@if $foo == false $bar == false {
// Both false
}
不会给出错误,但它只计算$foo
这也行不通:
@if $foo == false && $bar == false {
// Both false
}
这也不是:
@if $foo == false AND $bar == false {
// Both false
}
谢谢 来自:
SassScript支持布尔值的和
、或
、和非
运算符
谢谢你,先生,我不知道我怎么错过了。