Class: Sass::Tree::RootNode
- Inherits:
-
Node
- Object
- Node
- Sass::Tree::RootNode
- Defined in:
- /var/www/sass-pages/.sass/lib/sass/tree/root_node.rb
Overview
A static node that is the root node of the Sass document.
Direct Known Subclasses
Instance Attribute Summary
- - template readonly The Sass template from which this node was created.
Instance Method Summary
- - (RootNode) initialize(template) 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
- (RootNode) initialize(template)
A new instance of RootNode
11 12 13 14 |
# File '/var/www/sass-pages/.sass/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 '/var/www/sass-pages/.sass/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 '/var/www/sass-pages/.sass/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
|