Class: Sass::Tree::SupportsNode

Inherits:
DirectiveNode show all
Defined in:
lib/sass/tree/supports_node.rb

Overview

A static node representing a @supports rule.

See Also:

Instance Attribute Summary collapse

Attributes inherited from DirectiveNode

#group_end, #tabs

Attributes inherited from Node

#children, #filename, #has_children, #line, #options, #source_range

Instance Method Summary collapse

Methods inherited from DirectiveNode

#bubbles?, #normalized_name, resolved

Methods inherited from Node

#<<, #==, #balance, #bubbles?, #css, #css_with_sourcemap, #deep_copy, #each, #inspect, #style, #to_sass, #to_scss

Constructor Details

#initialize(name, condition) ⇒ SupportsNode

Returns a new instance of SupportsNode.

Parameters:



17
18
19
20
21
# File 'lib/sass/tree/supports_node.rb', line 17

def initialize(name, condition)
  @name = name
  @condition = condition
  super('')
end

Instance Attribute Details

#conditionSass::Supports::Condition

The supports condition.



14
15
16
# File 'lib/sass/tree/supports_node.rb', line 14

def condition
  @condition
end

#nameString

The name, which may include a browser prefix.

Returns:

  • (String)


9
10
11
# File 'lib/sass/tree/supports_node.rb', line 9

def name
  @name
end

Instance Method Details

#invisible?Boolean

True when the directive has no visible children.

Returns:

  • (Boolean)


34
35
36
# File 'lib/sass/tree/supports_node.rb', line 34

def invisible?
  children.all? {|c| c.invisible?}
end

#resolved_value



27
28
29
# File 'lib/sass/tree/supports_node.rb', line 27

def resolved_value
  @resolved_value ||= "@#{name} #{condition.to_css}"
end

#value

Raises:

  • (NotImplementedError)

See Also:



24
# File 'lib/sass/tree/supports_node.rb', line 24

def value; raise NotImplementedError; end