We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
用的postcss-loader,在postcss.config.js里面加入 module.exports = { plugins: [ require('autoprefixer'), require('postcss-px2rem') ] }。 webpack配置 { test: /.css$/, use: ExtractTextPlugin.extract({ fallback: "style-loader", use: [ {loader: "css-loader"}, {loader:"postcss-loader"} ] }) } 怎么去配置remUnit这个参数呢
The text was updated successfully, but these errors were encountered:
你可以试试创建一个postcss.config.js,然后用
module.exports = { plugins: [ require('postcss-px2rem')({ remUnit: 75 }) ] }
可以参考我的半成品示例postcss学习
或者不通过postcss直接单独用px2rem-loader,例如:
{ test: /\.scss$/, use: ExtractTextPlugin.extract({ fallback: "style-loader", use: [{ loader: "css-loader" }, { loader: "px2rem-loader", options: { remUnit: 75 } }, { loader: "sass-loader" }, ] }) }
可参考我最近也在看这块 px2rem插件示例
Sorry, something went wrong.
如果设计稿时640的时候 怎么去换算这个remUnit 的值呢
No branches or pull requests
用的postcss-loader,在postcss.config.js里面加入
module.exports = {
plugins: [
require('autoprefixer'),
require('postcss-px2rem')
]
}。
webpack配置
{
test: /.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
{loader: "css-loader"},
{loader:"postcss-loader"}
]
})
}
怎么去配置remUnit这个参数呢
The text was updated successfully, but these errors were encountered: