Class: Sass::Tree::SupportsNode
- Inherits:
-
DirectiveNode
- Object
- Node
- DirectiveNode
- Sass::Tree::SupportsNode
- Defined in:
- lib/sass/tree/supports_node.rb
Overview
A static node representing a @supports
rule.
Instance Attribute Summary collapse
-
#condition ⇒ Sass::Supports::Condition
The supports condition.
-
#name ⇒ String
The name, which may include a browser prefix.
Attributes inherited from DirectiveNode
Attributes inherited from Node
#children, #filename, #has_children, #line, #options, #source_range
Instance Method Summary collapse
-
#initialize(name, condition) ⇒ SupportsNode
constructor
A new instance of SupportsNode.
-
#invisible? ⇒ Boolean
True when the directive has no visible children.
- #resolved_value
- #value
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.
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
#condition ⇒ Sass::Supports::Condition
The supports condition.
14 15 16 |
# File 'lib/sass/tree/supports_node.rb', line 14
def condition
@condition
end
|
#name ⇒ String
The name, which may include a browser prefix.
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.
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
24 |
# File 'lib/sass/tree/supports_node.rb', line 24
def value; raise NotImplementedError; end
|