class Sass::Tree::RootNode

def _to_s(*args)

Other tags:
    See: Sass::Tree -

Returns:
  • (String) - The resulting CSS

Parameters:
  • args (Array) -- ignored
def _to_s(*args)
  result = String.new
  children.each do |child|
    next if child.invisible?
    child_str = child.to_s(1)
    result << child_str + (style == :compressed ? '' : "\n")
  end
  result.rstrip!
  return "" if result.empty?
  result << "\n"
  unless Sass::Util.ruby1_8? || result.ascii_only?
    if children.first.is_a?(CharsetNode)
      begin
        encoding = children.first.name
        # Default to big-endian encoding, because we have to decide somehow
        encoding << 'BE' if encoding =~ /\Autf-(16|32)\Z/i
        result = result.encode(Encoding.find(encoding))
      rescue EncodingError
      end
    end
    result = "@charset \"#{result.encoding.name}\";#{
      style == :compressed ? '' : "\n"
    }".encode(result.encoding) + result
  end
  result
end