Sha256: e7c9bb746ce1d9fbf8559b89012d4a25d945b6f9ae51715bfdc5a41a0b62cad4

Contents?: true

Size: 573 Bytes

Versions: 11

Compression:

Stored size: 573 Bytes

Contents

class SCSSBeautifier::Formatters::BangFormat < Sass::Tree::Visitors::Base
  # def visit_extend(node)
  #   format_bang(node)
  # end

  def visit_prop(node)
    node.value.each{ |item| format_bang(item) }
  end

  # def visit_variable(node)
  #   format_bang(node)
  # end

  def format_bang(item)
    if Sass::Script::Tree::Literal === item && Sass::Script::Value::String === item.value
      if item.value.value.include?("!")
        item.instance_variable_set(:@value, Sass::Script::Value::String.new(item.value.value.gsub(/\s*!\s*/, ' !')))
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
scss_beautifier-0.1.11 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.10 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.8 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.7 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.6 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.5 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.4 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.3 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.2 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.1 lib/scss_beautifier/formatters/bang_format.rb
scss_beautifier-0.1.0 lib/scss_beautifier/formatters/bang_format.rb