postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
596 stars 77 forks source link

Ignore option #171

Closed Antonio-Laguna closed 5 years ago

Antonio-Laguna commented 5 years ago

Hi here!

Much like Autoprefixer I thought this could be beneficial to custom properties as well. The main reason being that preserve went a bit aggressive and there could be instances in which we could need a block/declaration not to be processed.

Generally, I think preserve option can lead to bloating your final CSS which you might not need but there could be specific instances (I certainly have such projects) in which you still want the custom property to remain as is to be able to control it via JavaScript (for supported browsers) and that's something that can't be done right now.

I kind of thought this could be beneficial to the whole postcss-preset-env ecosystem but I found out that right now it wouldn't be possible since the code base is given to each plugin in order and that's it.

Please do let me know if there's anything you'd like to change or if you'd approach this differently.

Thanks

Antonio-Laguna commented 5 years ago

Hey @jonathantneal @MoOx did you ever have the chance to look at this?

I want to ditch postcss-cssnext since it has been deprecated but it seems like I can't move forward with it. I think this could be beneficial for developers too since it gives you more flexibility with little to no cost.

MoOx commented 5 years ago

Sorry but I don't maintain any postcss thing anymore.

jonathantneal commented 5 years ago

I’m merging this because it’s a really clean PR and it follows the conventions establish in Autoprefixer. Well done, @Antonio-Laguna. I wasn’t interested in complicating the polyfill, but you’ve done an amazing job working this functionality in perfectly without making it difficult to follow or maintain the additions.

Antonio-Laguna commented 5 years ago

Thanks a lot @jonathantneal !

Any ETA on releasing to NPM? Oddly I can't seem to be able to install from Git as only 4 files out of 12 files plus 2 dirs come. Only package, changelog, license, and readme coming down.