function pickDeclarations (child) {
var result = []
var next = child.next()
while (next && next.type === 'decl') {
result.push(next)
next = next.next()
}
return result
}
function processRule (rule, bubble, unwrap, preserveEmpty) {
...
if (child.type === 'rule') {
unwrapped = true
child.selectors = selectors(rule, child)
after = pickComment(child.prev(), after)
var decls = pickDeclarations(child)
after.after(child)
after = child
if (decls.length) {
var parent = postcss.rule({
selector: rule.selector,
nodes: []
})
for (var i = 0; i < decls.length; i++) {
parent.append(decls[i])
}
after.after(parent)
after = parent
}
}
...
There's also another possible solution: