2013-10-16 56 views
0

我知道,在PHP我可以做這樣的事情:在Sass中,如何比較if語句中的兩個或更多值?

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

我怎麼能做到這一點在薩斯?或者,我可以......該文檔是關於這一主題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 
} 

謝謝!

回答

0

§6.4.4 - Boolean Operations

SassScript支持andor,並not運營商布爾值。

+0

謝謝先生,我不知道我是怎麼錯過的。 –