1.0.2 • Published 9 years ago
postcss-optional-comments v1.0.2
postcss-optional-comments
Support for conditional comments using PostCSS.
What does this do?
This plugin allows you to choose which comments will appear in your css output using a simple not operator, /*!
, in the opening syntax of a CSS comment.
Example
input.css:
/*! This comment will be removed! */
/* This comment will be kept! */
a {}
output.css:
/* This comment will be kept! */
a {}
Installation
postcss-optional-comments is freely available to download from github or install via NPM.
Install using NPM:
npm i --save-dev postcss-optional-comments
Usage
Gulp
Use with gulp-postcss
module.
gulp.task('css', function () {
var postcss = require('gulp-postcss');
var optionalComments = require('postcss-optional-comments');
return gulp.src('./src/**/*.css')
.pipe(postcss([ optionalComments ]))
.pipe(gulp.dest('./dest'));
});
Todo
- Support single line comments
Contributing
Feel free to submit a pull request!