Class | Less::Node::Element
In: | lib/sass/less.rb
Parent: | Object

### Methods

sass_selector_str to_sass_tree top

### Attributes

group | [RW] |

### Public Instance methods

sass_selector_str()

[Source]

         # File lib/sass/less.rb, line 185
    185:       def sass_selector_str
    186:         case @selector
    187:         when /[+>~]/; "#{@selector} #{@name}"
    188:         else @selector + @name
    189:         end
    190:       end

to_sass_tree()

[Source]

         # File lib/sass/less.rb, line 157
    157:       def to_sass_tree
    158:         if root?
    159:           root = Sass::Tree::RootNode.new("")
    160:           rules.each {|r| root << r.to_sass_tree}
    161:           return root
    162:         end
    163:         return if hide_in_sass
    164:         return if !self.equal?(group.first)
    165:
    166:         last_el = nil
    167:         sel = group.map do |el|
    168:           comma_sel = []
    169:           loop do
    170:             comma_sel << el.sass_selector_str
    171:             break unless el.rules.size == 1 && el.rules.first.is_a?(Element)
    172:             el = el.rules.first
    173:           end
    174:           last_el = el
    175:           comma_sel = comma_sel.join(' ').gsub(' :', ':')
    176:           comma_sel.gsub!(/^:/, '&:') unless parent.root?
    177:           comma_sel
    178:         end.join(', ')
    179:
    180:         rule = Sass::Tree::RuleNode.new([sel])
    181:         last_el.rules.each {|r| rule << r.to_sass_tree}
    182:         return rule
    183:       end

top(env)

[Source]

         # File lib/sass/less.rb, line 152
    152:       def top(env)
    153:         return self if parent.equal?(env)
    154:         return parent.top(env)
    155:       end

[Validate]