Sha256: 24a1d8eac0a783d4078045aaac31d5afc92f602af93b109377f13ed1d437981c

Contents?: true

Size: 633 Bytes

Versions: 3

Compression:

Stored size: 633 Bytes

Contents

class SCSSBeautifier::Convert < Sass::Tree::Visitors::Convert
  def visit_if(node, &block)
    if true
      visit_if_no_newline(node, &block)
    else
      super(node)
    end
  end
  # ElsePlacement
  def visit_if_no_newline(node)
    name =
      if !@is_else
        "if"
      elsif node.expr
        "else if"
      else
        "else"
      end
    @is_else = false
    str = "#{tab_str}@#{name}"
    str << " #{node.expr.to_sass(@options)}" if node.expr
    str << yield
    str.rstrip! if node.else
    @is_else = true
    str << ' ' + visit(node.else).lstrip! if node.else
    str
  ensure
    @is_else = false
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
scss_beautifier-0.1.2 lib/scss_beautifier/convert.rb
scss_beautifier-0.1.1 lib/scss_beautifier/convert.rb
scss_beautifier-0.1.0 lib/scss_beautifier/convert.rb