class Sass::CSS

def expand_commas(root)

Parameters:
  • root (Tree::Node) -- The parent node
def expand_commas(root)
  root.children.map! do |child|
    next child unless Tree::RuleNode === child && child.rules.first.include?(',')
    child.rules.first.split(',').map do |rule|
      node = Tree::RuleNode.new(rule.strip)
      node.children = child.children
      node
    end
  end
  root.children.flatten!
end