Class Sass::Tree::IfNode
In: lib/sass/tree/if_node.rb
Parent: Node

A dynamic node representing a Sass `@if` statement.

{IfNode}s are a little odd, in that they also represent `@else` and `@else if`s. This is done as a linked list: each {IfNode} has a link (\{else}) to the next {IfNode}.

@see Sass::Tree

Methods

_perform   add_else   new   options=   to_src  

Attributes

else  [RW]  The next {IfNode} in the if-else list, or `nil`.

@return [IfNode]

Public Class methods

@param expr [Script::Expr] The conditional expression.

  If this is nil, this is an `@else` node, not an `@else if`

Public Instance methods

Append an `@else` node to the end of the list.

@param node [IfNode] The `@else` node to append

@see Node#options=

Protected Instance methods

Runs the child nodes if the conditional expression is true; otherwise, tries the \{else} nodes.

@param environment [Sass::Environment] The lexical environment containing

  variable and mixin values

@return [Array<Tree::Node>] The resulting static nodes @see Sass::Tree

[Validate]