Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
eoefans-landing/postcss.config.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16 lines (16 sloc)
585 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 参考:https://github.com/cuth/postcss-pxtorem | |
module.exports = { | |
plugins: { | |
'postcss-pxtorem': { | |
// rootValue: 75, // 设计稿的十分之一 | |
rootValue({ file }) { | |
return file.indexOf('vant') !== -1 ? 37.5 : 75 | |
}, | |
unitPrecision: 7, // 保留7位小数位 | |
minPixelValue: 0, // 设置要转换的最小像素值 | |
propList: ['*'], // 可以从px更改为rem的属性 | |
selectorBlackList: ['html', '#app', '.ignore-rem-'], // 不会被转换的选择器 | |
mediaQuery: false // 不允许在媒体查询中转换px | |
} | |
} | |
} |