Skip to content

shellscape/gulp-recess-plus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-recess-plus Build Status

A fork of gulp-recess with added functionality.

Lint CSS and LESS with RECESS.

Issues with the output should be reported on the RECESS issue tracker.

Install

$ npm install --save-dev gulp-recess-plus

Usage

var gulp = require('gulp');
var recess = require('gulp-recess-plus');

gulp.task('default', function () {
	return gulp.src('src/app.css')
		.pipe(recess())
		.pipe(recess.reporter())
		.pipe(gulp.dest('dist'));
});

Inline options support

Inline recess configuration/option is now available for css/less files on a per-file basis. ala jshint. For example:

/* recess noIDs: true, noJSPrefix: true, noOverqualifying: true */

.fancy {
  border: 1px solid red;
}

The options available exactly mirror the programmatic options listed for recess. Options specified on a per-file basis will override the options passed to gulp-recess and also any options loaded by .recessrc.

API

Options can be specified programmatically as part of the task configuration using the options below. Additionally or alternatively, you can use a .recessrc file to specify the options.

The compress and compile options from RECESS are intentionally missing. Separate tasks like gulp-csso and gulp-less will do a much better job.

recess(options)

Run recess on each file

// default options
includePath: []				// Additional paths to look for `@import`'ed LESS files.
strictPropertyOrder: true	// Complains if not strict property order
noIDs: true					// Doesn't complain about using IDs in your stylesheets
noJSPrefix: true			// Doesn't complain about styling .js- prefixed classnames
noOverqualifying: true		// Doesn't complain about overqualified selectors (ie: div#foo.bar)
noUnderscores: true			// Doesn't complain about using underscores in your class names
noUniversalSelectors: true	// Doesn't complain about using the universal * selector
zeroUnits: true				// Doesn't complain if you add units to values of 0

Writes .recess object to each vinyl object:

{
	success: true,			// Did it succeed?
	status: 'Perfect!',		// Recess status
	failureCount: 0,		// Number of errors
	results: [],			// Recess failure details
	errors: [],				// Recess errors
	options: {}				// The options passed to Recess
}

recess.reporter(options)

Write the report on each failing file. (Passing files write no output.)

// default options
fail: true					// If true, it writes error event on failure
minimal: false				// If true, it only lists failure filenames omitting details

License

MIT © Sindre Sorhus

About

Lint CSS and LESS with RECESS, Plus Extra Goodies

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%