lib/less/tree.rb
def to_css chain = :desc, css = []
      self.traverse :branch do |path, node|
        properties = node.inject("") do |s, (k, v)|          
          v.is_a?(String) ? (s + "#{k}: #{CGI.unescape(v)}; ") : s                # Add the property to the list
        end
        css << path * ( chain == :desc ? ' ' : ' > ') + " { " + properties + "}"  # Add the rule-set to the CSS
      end
      css.join "\n"
    end
#
# Convert the tree to css, using full paths
#
Convert the tree to css, using full paths
Convert the tree to css using full paths
def to_css chain = :desc, css = []
      self.traverse :branch do |path, node|
        properties = node.inject("") do |s, (k, v)|          
          v.is_a?(String) ? (s + "#{k}: #{CGI.unescape(v)}; ") : s                
        end
        css << path * ( chain == :desc ? ' ' : ' > ') + " { " + properties + "}"  
      end
      css.join "\n"
    end
def to_css chain = :desc , css = [ ] self . traverse :branch do | path , node | properties = node . inject ( "" ) do | s , ( k , v ) | v . is_a? ( String ) ? ( s + "#{k}: #{CGI.unescape(v)}; " ) : s end css << path * ( chain == :desc ? ' ' : ' > ' ) + " { " + properties + "}" end css . join "\n" end
Convert the tree to css, using full paths
Convert the tree to css using full paths
# Add the property to the list # Add the rule-set to the CSS
chain
css