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
3k stars 405 forks source link

Is there a extension #5

Closed TongDaDa closed 5 years ago

TongDaDa commented 6 years ago

Excuse me, is there a regressive solution, for example input width: 37.5 px; output: width: 37.5 px; width: 1 rem; width: 10vw;

chernobelenkiy commented 5 years ago

@TongDaD you can use it together with https://github.com/cuth/postcss-pxtorem with the flag replace: false. For example in your postcss.config.js:

module.exports = {
  plugins: {
   'postcss-pxtorem': {
      replace: false
    },
    'postcss-px-to-viewport': {
      replace: false
    }
  }
}