gulp-crass

Css optimize

gulp-crass

Css files by optimizing utility organizes and removes spaces

Uses the crass library.

/path/to/file.css:

b, c, a {
    third: rgba(255, 255, 255, 0.9);
    second: abc;
    first: 50%;
}

Output:

ab, c {
    first: 50%;
    second: abc;
    third: hsla(00%100%0.9);
}
 

Install with npm

npm install --save-dev gulp-crass
gulp.task('default', function() {
  return gulp.src('./exam/*.css')
        .pipe(crass())
        .pipe(gulp.dest('build/'));;
});

With options:

gulp.task('default', function() {
  return gulp.src('./exam/*.css')
        .pipe(crass({pretty:false}))
        .pipe(gulp.dest('build/'));;
});

Type: Boolean Default: true

Type: Boolean Default: false