Class: Sass::Tree::SupportsNode

Inherits:
DirectiveNode show all
Defined in:
/Users/ceppstei/Projects/sass-lang/.sass/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

- (SupportsNode) initialize(name, condition)

Returns a new instance of SupportsNode

Parameters:



17
18
19
20
21
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/supports_node.rb', line 17

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

Instance Attribute Details

- (Sass::Supports::Condition) condition

The supports condition.



14
15
16
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/supports_node.rb', line 14

def condition
  @condition
end

- (String) name

The name, which may include a browser prefix.

Returns:

  • (String)


9
10
11
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/supports_node.rb', line 9

def name
  @name
end

Instance Method Details

- (Boolean) invisible?

True when the directive has no visible children.

Returns:

  • (Boolean)


34
35
36
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/supports_node.rb', line 34

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

- resolved_value



27
28
29
# File '/Users/ceppstei/Projects/sass-lang/.sass/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 '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/tree/supports_node.rb', line 24

def value; raise NotImplementedError; end