class SCSSBeautifier::Formatters::LeadingZero < SCSSBeautifier::Formatters::Base LEADING_ZERO_REGEX = /\b0+\./ # ExcludeZero Only def visit_prop(node) if Sass::Script::Tree::Literal === node.value && Sass::Script::Value::String === node.value.value node_value = node.value.value if node.value.value.to_s.match(LEADING_ZERO_REGEX) node.instance_variable_set(:@value, Sass::Script::Value::String.new(node.value.value.to_s.gsub(LEADING_ZERO_REGEX, '.'))) end end end end