webglToy/postcss.config.js
2021-12-24 19:18:22 +08:00

29 lines
1.6 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module.exports = {
plugins: {
autoprefixer: {},
'postcss-viewport-units': {
// 排除会产生警告的部份
filterRule: rule => rule.nodes.findIndex(i => i.prop === 'content') === -1
},
cssnano: {
preset: 'default',
autoprefixer: false, // 和autoprefixer同样具有autoprefixer保留一个
'postcss-zindex': false
},
"postcss-px2rem-exclude": {
remUnit: 75,//转换为rem的基准px
remPrecision: 8, //转换精度,小数点后保留位数
// exclude: /node_modules|folder_name/i
},
// postcss-px-to-viewport将px单位自动转换成viewport单位 和 px2rem 任选其一
// 'postcss-px-to-viewport': {
// viewportWidth: 375, // 视窗的宽度对应的是我们设计稿的宽度一般是750
// // viewportHeight: 1334, // 视窗的高度根据750设备的宽度来指定一般指定1334也可以不配置
// unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
// viewportUnit: 'vw', // 指定需要转换成的视窗单位建议使用vw
// selectorBlackList: ['.ignore', '.hairlines'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
// minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
// mediaQuery: false // 允许在媒体查询中转换`px`
// }
}
}