Home API system postcss-preset-env – CodePen Blog

postcss-preset-env – CodePen Blog

49
0
Norway


I was upgrading our version of PostCSS and PostCSS add-ons the other day. Truth be told, it’s because Jon Neal let us know that there is such a thing as postcss-preset-env now, and it’s the sucessor to the now-deprecated postcss-cssnext (which succeeded cssnext).

We offer postcss-cssnext, so it was something we needed to address. All your postcss-cssnext Pens will be fine, but you should probably use postcss-preset-env from now on.

The spirit of the project is to provide likely-future CSS syntax and compile it down to old CSS where it can. The beauty of postcss-preset-env is that it does it based on a browserslist. That’s like Autoprefixer… it makes decisions on what to do based on what browsers you want to support. For example, if you only support pretty new browsers, your CSS custom properties may not need to be compiled at all. Support older browsers, then they do.

Here’s the demo from the README working on :

See the Pen postcss-preset-env by Chris Coyier (@chriscoyier) on CodePen.



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here