Skip to content

ben-eb/gulp-css-condense

Repository files navigation

gulp-css-condense Build Status NPM version Dependency Status

A gulp plugin for the CSS compressor that shows no mercy.

If you have any difficulties with the output of this plugin, please use the css-condense tracker.

Install via npm:

npm install gulp-css-condense --save-dev

Example

var gulp = require('gulp');
var cssc = require('gulp-css-condense');

gulp.task('default', function() {
    return gulp.src('./main.css')
        .pipe(cssc())
        .pipe(gulp.dest('./out'));
});

Options

safe

Type: Boolean

If this is set to true, css-condense will not perform optimisations such as selector and declaration consolidation (the docs have more information). Note that you can also choose which optimisations that you deem to be fit for your build by passing them individually:

var gulp = require('gulp');
var cssc = require('gulp-css-condense');

gulp.task('default', function() {
    return gulp.src('./main.css')
        .pipe(cssc({
            consolidateViaDeclarations: true,
            consolidateViaSelectors: false,
            consolidateMediaQueries: true
        }))
        .pipe(gulp.dest('./out'));
});

options.safe is just a convenience for specifying all of the above options as false.

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs

About

A gulp plugin for the CSS compressor that shows no mercy.

Resources

License

Stars

Watchers

Forks

Packages

No packages published