postcss-customize-plugin
1.0.0 • Public • Published postcss-customize-plugin
this plugin used to handle postcss ast, so you can modify postcss result but not must to publish an npm package
这个插件的目的是,在网上插件无法满足需求的情况下,对css结果进行简单的处理,而不需要发布一个新的npm包,或者postcss plugin
Install
npm install --save-dev postcss-customize-plugin
Basic usage
gulpfile.js
var myplugin = require('postcss-customize-plugin');
gulp.task('css', function () {
var processors = [
myplugin({
handle: function (css) {
css.walkAtRules(function (rule) {
if (rule.name === 'xxxxx') {
rule.remove()
}
});
}
})
];
return gulp.src('./src/*.css')
.pipe(postcss(processors))
.pipe(gulp.dest('./dest'));
});
or
postcss.config.js
let conf = {
'plugins': {
'postcss-customize-plugin': {
handle: function(css) {
}
}
}
}
module.exports = conf
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 1.0.0
0
Version History
- VersionDownloads (Last 7 Days)
- 1.0.0
0
Package Sidebar
Install
npm i postcss-customize-plugin
Weekly Downloads