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.
pxtoviewport({
// import css form node_modules/@alife/wap-union-xman will be ignore.
blacklistPath: ['node_modules/@alife/wap-union-xman'],
viewportWidth: postcss.viewportWidth || 750, // (Number) The width of the viewport.
viewportHeight: 1334, // (Number) The height of the viewport.
unitPrecision: 3, // (Number) The decimal numbers to allow the REM units to grow to.
viewportUnit: 'vw', // (String) Expected units.
selectorBlackList: [/^\.bc-/, /^\.wlkeeppx/, /^\.xman/], // (Array) The selectors to ignore and leave as px.
minPixelValue: 1, // (Number) Set the minimum pixel value to replace.
mediaQuery: true, // (Boolean) Allow px to be converted in media queries.
})
add a feature, can't filter translate by path.