mirror of
https://github.com/danog/sass-site.git
synced 2024-12-02 09:27:59 +01:00
1.0 KiB
1.0 KiB
title | introduction |
---|---|
Boolean Operators | Unlike languages like JavaScript, Sass uses words rather than symbols for its [boolean](/documentation/values/booleans) operators. |
not <expression>
returns the opposite of the expression's value: it turnstrue
intofalse
andfalse
intotrue
.<expression> and <expression>
returnstrue
if both expressions' values aretrue
, andfalse
if either isfalse
.<expression> or <expression>
returnstrue
if either expression's value istrue
, andfalse
if both arefalse
.
{% codeExample 'boolean', false %} @debug not true; // false @debug not false; // true
@debug true and true; // true @debug true and false; // false
@debug true or false; // true @debug false or false; // false
@debug not true // false @debug not false // true
@debug true and true // true @debug true and false // false
@debug true or false // true @debug false or false // false {% endcodeExample %}
{% render 'doc_snippets/truthiness-and-falsiness' %}