postcss

PostCSS is a tool for transforming styles with JS plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS syntax, inline images, and more.

大白话就是:通过适当的插件,你只需要写标准(现在的标准、未来的标准、或你期望的标准)的样式即可

一些插件

在 webpack 中使用

webpackConfig = {
module: {
loaders: [
test: /\.css$/,
loaders: 'style!css?sourceMap!postcss'
},
postcss: [
require('postcss-import'),
require('postcss-nested'),
require('postcss-mixins'),
require('postcss-sprites')['default']({...}),
...
]
}