Closed anotherso1a closed 3 years ago
Thank you for your pr! I really need this feature!
I am going to close this pr, because postcss itself supports multiple calls to the same plugin.
see code:
const autoprefixer = require('autoprefixer')
const px2viewport = require('postcss-px-to-viewport')
module.exports = {
plugins: [
autoprefixer({}),
px2viewport({
unitToConvert: 'px',
viewportWidth: 375,
unitPrecision: 3,
viewportUnit: "vw"
}),
px2viewport({
unitToConvert: 'rem',
viewportWidth: 750,
unitPrecision: 3,
viewportUnit: "vw",
include: 'src'
})
]
}
When we have two or more units in our CSS files, they need to be all converted to
vw
.And it has no performance impact on the original function.
using example: