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

Add conditional preservation behavior #116

Closed ekatioz closed 4 years ago

ekatioz commented 4 years ago

My goal was to give the user a more granular controll over the preservation behavior.

Initially I needed to find a way to preserve colors and fonts, but don't preserve URLs. Relative URLs are resolved differently in Safari and Chrome.

Now the user could define a callback for the "preserve" option: cssvariables({ preserve: decl => shouldPreserve(decl) })

I would be open and grateful for suggestions for improvement.

MadLittleMods commented 4 years ago

Thanks for the contribution @ekatioz! Sorry for the delay ❤️

This is now part of v0.16.0 🚀