node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

gulp-crass

gulp-crass

Travis Build Status Circle Build Status Appveyor Build Status Build Status

Css files by optimizing utility organizes and removes spaces

Uses the crass library.

How It Works

/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

Install with npm

npm install --save-dev gulp-crass

Usage

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/'));;
});

API

crass(options)

options.pretty

Type: Boolean Default: true

options.sourceMap && options.sourcemap

Type: Boolean Default: false