Most mobile and cross-platform web developers have encountered the problem at some point: you need your web app to scale neatly to the device screen size, regardless of which of the many thousands of devices there are out there, but your units only have one design layout width, mainly mobile. Or perhaps you need to create a per-device stylesheet for a truly scalable cross-platform UI, and want to use a scaled version of an original to base it upon. In either case, converting everything by hand is laborious and inconvenient.
Grappling with this problem in one of our projects, the Med.me app, our leading frontend developer Dmitriy Karpunin came up with the idea of using a post-processor to convert CSS values from one set of units to another, and thatโs how 
postcss-px-to-viewportvw, vhFor example, if you specify a notional horizontal resolution of 640 pixels and you specify a horizontal distance of 
32px5vwThe plug-in also has plenty of options for customization, to control exactly which values to convert, and where, and based upon which notional resolution.
Installation
Installation is straightforward with npm:
$ npm install postcss-px-to-viewport --save-devor with yarn, if you prefer:
$ yarn add -D postcss-px-to-viewportWidely used across Asia
One day in Summer 2018, we discovered an active community had sprung up around the plug-in in China โ suddenly, the issues, pull requests, and forks came flooding in.
Much of Asia, but China, in particular, suffers from an active proliferation of devices that developers are tasked with supporting, and 
postcss-px-to-viewportWe quickly realised that it would be helpful if the plug-in came with instructions in Chinese, not just English, and we were thrilled when a community volunteer answered our call and contributed a Chinese-language Readme for the project.
Find postcss-px-to-viewport on Github!
postcss-px-to-viewportPreviously published at https://evrone.com/postcss-px-viewport. The author of the story is the chief editor at Evrone.
