moblie-website/postcss.config.cjs
2025-02-24 23:56:41 +08:00

17 lines
700 B
JavaScript
Raw 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.

// postcss.config.js
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
require('postcss-pxtorem')({
rootValue: 16, // 设置根字体大小,通常为 16px你可以根据设计稿的基准修改
unitPrecision: 5, // 设置转换后的 rem 单位的精度
propList: ['*'], // 可以设置哪些属性需要转换,*表示所有属性
selectorBlackList: [], // 不需要转换的类名数组,可以为空
replace: true, // 是否直接替换原有的 px 单位
mediaQuery: false, // 是否转换媒体查询中的 px 单位
minPixelValue: 0, // 小于该值的 px 单位不进行转换
})
]
};