Skip to content
CSScomb plugin for Gulp.js. Formats CSS according to a pre-defined coding style.
Branch: master
Clone or download
Konstantin Tarkus Konstantin Tarkus
Konstantin Tarkus and Konstantin Tarkus 3.0.8
Latest commit 739ed31 Sep 10, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig Update coding style Oct 7, 2014
.gitattributes
.gitignore
.jshintrc
.npmignore
.travis.yml Initial commit Jan 30, 2014
LICENSE.txt Load settings from .csscomb.json file if it exists Jul 2, 2014
README.md 3.0.8 Sep 10, 2016
csscomb.jpg 3.0.8 Sep 10, 2016
index.js
package.json 3.0.8 Sep 10, 2016
test.js Update unit test Oct 7, 2014

README.md

gulp-csscomb   Build Status Dependency Status Tips

Format CSS coding style with CSScomb.

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


🔥 Want to strengthen your core JavaScript skills and master ES6?
I would personally recommend this awesome ES6 course by Wes Bos.


Installation

npm install gulp-csscomb --save-dev

Example 1

var gulp = require('gulp');
var csscomb = require('gulp-csscomb');

gulp.task('styles', function() {
  return gulp.src('src/styles/main.css')
    .pipe(csscomb())
    .pipe(gulp.dest('./build/css'));
});

Example 2

var gulp = require('gulp');
var $ = require('gulp-load-plugins')();

gulp.task('styles', function() {
  return gulp.src('src/styles/bootstrap.less')
    .pipe($.less({strictMath: true}))
    .pipe($.autoprefixer([
      'Android 2.3',
      'Android >= 4',
      'Chrome >= 20',
      'Firefox >= 24', // Firefox 24 is the latest ESR
      'Explorer >= 8',
      'iOS >= 6',
      'Opera >= 12',
      'Safari >= 6']))
    .pipe($.csscomb())
    .pipe(gulp.dest('./build/css'));
});

If there is .csscomb.json file present in the same folder as the source file(s), or in the project root folder, gulp-csscomb will read config settings from it instead of default config.

You can also specify a pre-defined configuration. Ex.: csscomb('zen')

License

The MIT License (MIT) © Konstantin Tarkus (@koistya)

You can’t perform that action at this time.