evrone / postcss-px-to-viewport

A plugin for PostCSS that generates viewport units (vw, vh, vmin, vmax) from pixel units. The best choice to create a scalable interface on different displays by one design size.
https://evrone.com/postcss-px-viewport
MIT License
2.99k stars 401 forks source link

Update to postcss8 #87

Open LiJiahaoCoder opened 3 years ago

LiJiahaoCoder commented 3 years ago

Some apis of postcss5 have been deprecated, and will console following warning:

postcss-px-to-viewport: postcss.plugin was deprecated.

I upgraded it from postcss5 to postcss8, and test cases are all passed.

The main modifications are to use exports.default = creator instead of exports.default = postcss.plugins(name, creator), and remove var postcss = require('postcss'); in index.js.

yangmingshan commented 3 years ago

Seems this PR can fix #73 #81 #83, @KODerFunk could you spent a little time to review it?