class Less::Node::Element

def sass_selector_str

def sass_selector_str
  case @selector
  when /[+>~]/; "#{@selector} #{@name}"
  else @selector + @name
  end
end

def to_sass_tree

def to_sass_tree
  if root?
    root = Sass::Tree::RootNode.new("")
    rules.each {|r| root << r.to_sass_tree}
    return root
  end
  return if hide_in_sass
  return if !self.equal?(group.first)
  last_el = nil
  sel = group.map do |el|
    comma_sel = []
    loop do
      comma_sel << el.sass_selector_str
      break unless el.rules.size == 1 && el.rules.first.is_a?(Element)
      el = el.rules.first
    end
    last_el = el
    comma_sel = comma_sel.join(' ').gsub(' :', ':')
    comma_sel.gsub!(/^:/, '&:') unless parent.root?
    comma_sel
  end.join(', ')
  rule = Sass::Tree::RuleNode.new([sel])
  last_el.rules.each {|r| rule << r.to_sass_tree}
  return rule
end

def top(env)

def top(env)
  return self if parent.equal?(env)
  return parent.top(env)
end