zhgdyun/postcss.config.js

20 lines
731 B
JavaScript
Raw Normal View History

2024-10-30 18:26:33 +08:00
// module.exports = {
// plugins: {
// autoprefixer: {},
// "postcss-pxtorem": {
// rootValue: 192, // 根据设计图尺寸写设计图是1920就写192
// propList: ['*'], // 需要被转换的属性
// // selectorBlackList: ['el'] // 不进行px转换的选择器不转换element的标签样式根据自己项目需求来定义
// }
// }
// }
module.exports = {
plugins: [
require("postcss-px2rem-exclude")({
2025-03-24 18:19:54 +08:00
remUnit: 16, // 基准单位(设计稿 1rem = 16px
remPrecision: 6, // 保留 6 位小数
exclude: /node_modules/,
minPixelValue: 1 // 大于 1px 才转换
2024-10-30 18:26:33 +08:00
}),
]
}