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.
@supports
rules behave differently from other directives
in that when they're nested within rules,
they bubble up to top-level.
Instance Attribute Summary collapse
-
#condition ⇒ Sass::Supports::Condition
The supports condition.
- #group_end
-
#name ⇒ String
The name, which may include a browser prefix.
- #tabs
Attributes inherited from Node
#children, #filename, #has_children, #line, #options
Instance Method Summary collapse
- #bubbles? ⇒ Boolean
-
#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
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.
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
#condition ⇒ Sass::Supports::Condition
The supports condition.
17 18 19 |
# File 'lib/sass/tree/supports_node.rb', line 17
def condition
@condition
end
|
#group_end
23 24 25 |
# File 'lib/sass/tree/supports_node.rb', line 23
def group_end
@group_end
end
|
#name ⇒ String
The name, which may include a browser prefix.
12 13 14 |
# File 'lib/sass/tree/supports_node.rb', line 12
def name
@name
end
|
#tabs
20 21 22 |
# File 'lib/sass/tree/supports_node.rb', line 20
def tabs
@tabs
end
|
Instance Method Details
#bubbles? ⇒ Boolean
49 |
# File 'lib/sass/tree/supports_node.rb', line 49
def bubbles?; true; end
|
#invisible? ⇒ Boolean
True when the directive has no visible children.
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
34 |
# File 'lib/sass/tree/supports_node.rb', line 34
def value; raise NotImplementedError; end
|