Class: Sass::Tree::RootNode

Inherits:
Node
  • Object
show all
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

ImportNode

Instance Attribute Summary

Instance Method Summary

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

Parameters:

  • (String) template — The Sass template from which this node was created


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

Parameters:

  • (String) template


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.

See Also:



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