grunt-recess
Lint and minify CSS and LESS, using the Twitter RECESS module.
issue tracker.
Problems with the output should be submitted on RecessGetting Started
If you haven't used grunt before, be sure to check out the Getting Started guide, as it explains how to create a gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:
$ npm install --save-dev grunt-recess
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
Tip: the load-grunt-tasks module makes it easier to load multiple grunt tasks.
Documentation
Example usage
Lint
recess: dist: src: 'src/main.css'
Lint and compile
recess: dist: options: compile: true files: 'dist/main.css': 'src/main.less'
A destination is only needed when compile: true
. It won't output any warnings in this mode.
You can also specify .less
files and they will be compiled.
Lint, compile and concat
recess: dist: options: compile: true files: 'dist/combined.css': 'src/main.css' 'src/component.css'
You can specify multiple source files to concat them.
Options
// Defaultcompile: false // Compiles CSS or LESS. Fixes white space and sort order.compress: false // Compress your compiled codenoIDs: true // Doesn't complain about using IDs in your stylesheetsnoJSPrefix: true // Doesn't complain about styling .js- prefixed classnamesnoOverqualifying: true // Doesn't complain about overqualified selectors (ie: div#foo.bar)noUnderscores: true // Doesn't complain about using underscores in your class namesnoUniversalSelectors: true // Doesn't complain about using the universal * selectorprefixWhitespace: true // Adds whitespace prefix to line up vender prefixed propertiesstrictPropertyOrder: true // Complains if not strict property orderzeroUnits: true // Doesn't complain if you add units to values of 0includePath: mixed // Additional paths to look for `@import`'ed LESS files. Accepts a string or an array of strings.
gulp
You might want to check out gulp-recess which is a faster alternative to this task.