lily-white / js-daily-learning

0 stars 0 forks source link

[learn-mint-ui]2.加入cssnext bem #2

Open lily-white opened 6 years ago

lily-white commented 6 years ago

1.安装 npm install postcss-cssnext --save-dev 2.在vue-loader.conf.js里去掉autoprefixer,加入require('postcss-cssnext')({ browsers: ['last 10 Chrome versions', 'last 5 Firefox versions', 'Safari >= 6', 'ie > 8','Android >= 4.0'] }) 3.安装npm install postcss-bem postcss-nested --save-dev 4.在vue-loader.conf.js里加入require('postcss-bem')(), require('postcss-nested')() 5.bem参考文章

lily-white commented 6 years ago

用原生的postcss-bem,用内嵌的@descendent等,会出现生成的css类里是空的情况。不知道怎么解决,所以将第3,4步换成npm install postcss-salad --save-dev, require('postcss-salad')()

lily-white commented 6 years ago

使用@when 时,在class里加上is-css类名

lily-white commented 6 years ago

把原来的import进来的reset.css 替换成 @reset-global mobile;