Class: Sass::Tree::RootNode
Overview
A static node that is the root node of the Sass document.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#template
readonly
The Sass template from which this node was created.
Attributes inherited from Node
#children, #filename, #has_children, #line, #options
Instance Method Summary collapse
-
#initialize(template) ⇒ RootNode
constructor
A new instance of RootNode.
-
#render
Runs the dynamic Sass code and computes the CSS for the tree.
Methods inherited from Node
#<<, #==, #balance, #deep_copy, #do_extend, #each, #invisible?, #style, #to_s, #to_sass, #to_scss
Constructor Details
#initialize(template) ⇒ RootNode
Returns a new instance of RootNode.
11 12 13 14 |
# File 'lib/sass/tree/root_node.rb', line 11
def initialize(template)
super()
@template = template
end
|
Instance Attribute Details
#template (readonly)
The Sass template from which this node was created
8 9 10 |
# File 'lib/sass/tree/root_node.rb', line 8
def template
@template
end
|
Instance Method Details
#render
Runs the dynamic Sass code and computes the CSS for the tree.
18 19 20 21 22 23 24 25 |
# File 'lib/sass/tree/root_node.rb', line 18
def render
Visitors::CheckNesting.visit(self)
result = Visitors::Perform.visit(self)
Visitors::CheckNesting.visit(result) # Check again to validate mixins
result, extends = Visitors::Cssize.visit(result)
result = result.do_extend(extends) unless extends.empty?
result.to_s
end
|