W3cubDocs

/Sass

Boolean<T>

Sass's boolean type.

Custom functions should respect Sass’s notion of truthiness by treating false and null as falsey and everything else as truthy.

Boolean values can’t be constructed, they can only be accessed through the TRUE and FALSE constants.

Type Parameters

  • T extends boolean = boolean

Hierarchy

  • Boolean

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • T extends boolean = boolean

    Returns Boolean<T>

Properties

FALSE: Boolean<false>

Sass's false value.

TRUE: Boolean<true>

Sass's true value.

Methods

  • Returns true if this is Sass's true value and false if this is Sass's false value.

    Example

    // boolean is `true`.
    boolean.getValue(); // true
    boolean === sass.types.Boolean.TRUE; // true

    // boolean is `false`.
    boolean.getValue(); // false
    boolean === sass.types.Boolean.FALSE; // true

    Returns T

© 2006–2025 the Sass team, and numerous contributors
Licensed under the MIT License.
https://sass-lang.com/documentation/js-api/classes/types.Boolean