MadLittleMods / postcss-css-variables

PostCSS plugin to transform CSS Custom Properties(CSS variables) syntax into a static representation
https://madlittlemods.github.io/postcss-css-variables/playground/
Other
536 stars 62 forks source link

#130 nested edge case #131

Closed marapper closed 1 year ago

marapper commented 2 years ago

Real edge case for #130 is comma-separated nested selectors inside another comma separated selectors, see example test.

Fix #130

Issue is about cloning nodes after traversing so lead to loosing links to cloned children nodes. My first approach is move cloning phase in tree traverse section (in hope that postcss walks to new nodes on next iteration) and it works fine.

marapper commented 2 years ago

58 and #110 still could be some issue with nested selectors (cssnano will merge only adjacent nodes with same rules) but still no idea how to solve it.

And actually postcss-merge-selectors can successfully merge all nested selectors successfully so maybe its not issue at all

MadLittleMods commented 1 year ago

Seems reasonable and given that the tests pass, good enough for me ⏩

Sorry for the review delay 🙇 Thanks for the contribution!