postcss / postcss-nested

PostCSS plugin to unwrap nested rules like how Sass does it.
MIT License
1.15k stars 66 forks source link

Fixes #79. Adds support for params adjacent to nesting selector. #80

Closed benjamind closed 5 years ago

benjamind commented 5 years ago

This is the cleanest fix I could come up with.

The parsed selector nodes for nesting with parenthesis, e.g. &(:focus) end up coming out in the parsed node with the parens attached to the ampersand. So we have to clone the parent node, and then inject the parens back into the last selector in the cloned parent node.

Let me know if I'm missing something, but this seems to work.

ai commented 5 years ago

Thanks. The fix was released in 4.1.1.