You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Jack Lukic 3addcf6029 icon side 11 years ago
..
node_modules Fixes issue with accidental submodule 11 years ago
tasks Fixes issue with accidental submodule 11 years ago
test Fixes issue with accidental submodule 11 years ago
.npmignore Fixes issue with accidental submodule 11 years ago
LICENSE-MIT Fixes issue with accidental submodule 11 years ago
README.md Fixes issue with accidental submodule 11 years ago
grunt.js Fixes issue with accidental submodule 11 years ago
package.json Fixes issue with accidental submodule 11 years ago

README.md

grunt-css

Grunt plugin for linting and minifying CSS

Getting Started

Install the module with: npm install grunt-css

Then load it from your own grunt.js file:

grunt.loadNpmTasks('grunt-css');

Documentation

This plugin provides two tasks: cssmin and csslint. Both area multi tasks, meaning that grunt will automatically iterate over all cssmin and csslint targets if a target is not specified.

cssmin

This works just like the built-in min task, so check docs for that.

csslint

This is similar to the built-in lint task, though the configuration is different. Here's an example:

csslint: {
	base_theme: {
		src: "themes/base/*.css",
		rules: {
			"import": false,
			"overqualified-elements": 2
		}
	}
}

src specifies the files to lint, rules the rules to apply. A value of false ignores the rule, a value of 2 will set it to become an error. Otherwise all rules are considered warnings.

For the current csslint version, these rules are available:

important
adjoining-classes
known-properties
box-sizing
box-model
outline-none
duplicate-background-images
compatible-vendor-prefixes
display-property-grouping
qualified-headings
fallback-colors
duplicate-properties
empty-rules
errors
shorthand
ids
gradients
font-sizes
font-faces
floats
underscore-property-hack
overqualified-elements
import
regex-selectors
rules-count
star-property-hack
text-indent
unique-headings
universal-selector
unqualified-attributes
vendor-prefix
zero-units

For an explanation of those rules, check the csslint wiki.

Side note: To update this list, run this:

node -e "require('csslint').CSSLint.getRules().forEach(function(x) { console.log(x.id) })"

Contributing

Please use the issue tracker and pull requests.

License

Copyright (c) 2012 Jörn Zaefferer Licensed under the MIT license.