class Sass::CSS
def expand_commas(root)
Yes, this expands the amount of code,
color: blue
baz
color: blue
bar
color: blue
foo
into
color: blue
foo, bar, baz
Transform
def expand_commas(root) root.children.map! do |child| next child unless Tree::RuleNode === child && child.rule.include?(',') child.rule.split(',').map do |rule| node = Tree::RuleNode.new(rule, nil) node.children = child.children node end end root.children.flatten! end