Open doin opened 6 years ago
body { -webkit-touch-callout: none; text-size-adjust: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
npm install postcss-pxtorem --save-dev
const postcss = require('postcss');
const pxtorem = require('postcss-pxtorem');
///。。。。。
{ test: /.css$/, use: [ require.resolve('style-loader'), { loader: require.resolve('css-loader'), options: { importLoaders: 1, }, }, { loader: require.resolve('postcss-loader'), options: { // Necessary for external CSS imports to work // https://github.com/facebookincubator/create-react-app/issues/2677 ident: 'postcss', plugins: () => [ require('postcss-flexbugs-fixes'), autoprefixer({ browsers: [ '>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9', // React doesn't support IE8 anyway ], flexbox: 'no-2009', }), pxtorem({ rootValue: 100, propWhiteList: [] }), //新增 ], }, }, ], },
* 参考
- https://www.npmjs.com/package/postcss-pxtorem
- http://blog.csdn.net/github_37519401/article/details/74536877 靠谱的文章
- http://npm.taobao.org/package/postcss
- https://github.com/ant-design/ant-design-mobile/wiki/HD 没有详细配置说明
- 2.X版demo - http://beta.mobile.ant.design/kitchen-sink/?lang=zh-CN
- 1.X版DEMO - https://mobile.ant.design/kitchen-sink/components/button?lang=zh-CN