1.0.1 • Published 6 years ago
postcss-px-to-vw v1.0.1
postcss-px-to-vw
A plugin for PostCSS that converts pixel units to vw unit.
.title {
/* you can override pixel replacement by adding a "px" *
* comment after the declaration if you want to keep. */
font-size: 32px; /*px*/
padding: 16px 0 18px;
}
.title {
/* you can override pixel replacement by adding a "px" *
* comment after the declaration if you want to keep. */
font-size: 32px; /*px*/
padding: 4.444444444444445vw 0 5vw;
}
Usage
Plug it into your PostCSS configuration.
var option = {
uwUnit: 720, // Base designer size; 360px by default
};
postcss([require('postcss-px-to-vw')(option)])