Class: Sass::Tree::SupportsNode

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

Overview

A static node representing a @supports rule. @supports rules behave differently from other directives in that when they're nested within rules, they bubble up to top-level.

See Also:

Instance Attribute Summary collapse

Attributes inherited from Node

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

Instance Method Summary collapse

Methods inherited from DirectiveNode

resolved

Methods inherited from Node

#<<, #==, #balance, #deep_copy, #each, #inspect, #style, #to_s, #to_sass, #to_scss

Constructor Details

#initialize(name, condition) ⇒ SupportsNode

Returns a new instance of SupportsNode.

Parameters:



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

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

Instance Attribute Details

#conditionSass::Supports::Condition

The supports condition.



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

def condition
  @condition
end

#group_end

See Also:



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

def group_end
  @group_end
end

#nameString

The name, which may include a browser prefix.

Returns:

  • (String)


12
13
14
# File 'lib/sass/tree/supports_node.rb', line 12

def name
  @name
end

#tabs

See Also:



20
21
22
# File 'lib/sass/tree/supports_node.rb', line 20

def tabs
  @tabs
end

Instance Method Details

#bubbles?Boolean

Returns:

  • (Boolean)

See Also:



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

def bubbles?; true; end

#invisible?Boolean

True when the directive has no visible children.

Returns:

  • (Boolean)


44
45
46
# File 'lib/sass/tree/supports_node.rb', line 44

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

#resolved_value



37
38
39
# File 'lib/sass/tree/supports_node.rb', line 37

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

#value

Raises:

  • (NotImplementedError)

See Also:



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

def value; raise NotImplementedError; end