|
|
{ "name": "grunt-css", "description": "Grunt plugin for linting and minifying CSS", "version": "0.5.4", "homepage": "https://github.com/jzaefferer/grunt-css", "author": { "name": "Jörn Zaefferer", "email": "joern.zaefferer@gmail.com" }, "repository": { "type": "git", "url": "git://github.com/jzaefferer/grunt-css.git" }, "bugs": { "url": "https://github.com/jzaefferer/grunt-css/issues" }, "licenses": [ { "type": "MIT", "url": "https://github.com/jzaefferer/grunt-css/blob/master/LICENSE-MIT" } ], "main": "tasks/grunt-css", "engines": { "node": ">=0.6.0" }, "dependencies": { "clean-css": "0.9.1", "csslint": "0.9.10", "gzip-js": "0.3.1" }, "devDependencies": { "grunt": "0.4.x", "grunt-contrib-jshint": "0.1.0" }, "keywords": [ "gruntplugin" ], "readme": "# grunt-css\n\n[Grunt](https://github.com/cowboy/grunt) plugin for linting and minifying CSS\n\n## Getting Started\n\nInstall the module with:\n\n\tnpm install grunt-css --save-dev\n\nThen load it from your own `Gruntfile.js` file:\n\n```js\ngrunt.loadNpmTasks('grunt-css');\n```\n\n### grunt 0.3 compability\n\nIf you're using grunt 0.3, install the 0.1.0 version of this task:\n\n\tnpm install grunt-css@0.3.2\n\n## Documentation\n\nThis plugin provides two tasks: `cssmin` and `csslint`. Both area [multi tasks][types_of_tasks], meaning that grunt will automatically iterate over all `cssmin` and `csslint` targets if a target is not specified.\n\n[types_of_tasks]: https://github.com/cowboy/grunt/blob/master/docs/types_of_tasks.md\n\n### cssmin\n\nThis works similar to the [`uglify` task](https://github.com/gruntjs/grunt-contrib-uglify). Specify a src and dest property for input and output:\n\n```js\n// Project configuration.\ngrunt.initConfig({\n\tcssmin: {\n\t\tmy_target: {\n\t\t\tsrc: 'src/input.css',\n\t\t\tdest: 'dist/output.min.css'\n\t\t}\n\t}\n});\n```\n\nExposes option of clean-css, which you can set per target or for all, as usual:\nkeepSpecialComments\n\n```js\n// Project configuration.\ngrunt.initConfig({\n\tcssmin: {\n\t\toptions: {\n\t\t\tkeepSpecialComments: 0\n\t\t},\n\t\tmy_target: {\n\t\t\toptions: {\n\t\t\t\tkeepSpecialComments: 1\n\t\t\t},\n\t\t\tsrc: 'src/input.css',\n\t\t\tdest: 'dist/output.min.css'\n\t\t}\n\t}\n});\n```\n\n#### Banner comments\n\nIn this example, running `grunt cssmin:my_target` will prepend a banner created by interpolating the `banner` template string with the config object. Here, those properties are the values imported from the `package.json` file (which are available via the `pkg` config property) plus today's date.\n\n\n```js\n// Project configuration.\ngrunt.initConfig({\n\tpkg: grunt.file.readJSON('package.json'),\n\tcssmin: {\n\t\toptions: {\n\t\t\tbanner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +\n\t\t\t\t'<%= grunt.template.today(\"yyyy-mm-dd\") %> */'\n\t\t},\n\t\tmy_target: {\n\t\t\tfiles: {\n\t\t\t\tsrc: 'src/input.css',\n\t\t\t\tdest: 'dist/output.min.css'\n\t\t\t}\n\t\t}\n\t}\n});\n```\n\n\n### csslint\n\nThis is similar to the built-in lint task, though the configuration is different. Here's an example:\n\n```js\ncsslint: {\n\tbase_theme: {\n\t\tsrc: \"themes/base/*.css\",\n\t\trules: {\n\t\t\t\"import\": false,\n\t\t\t\"overqualified-elements\": 2\n\t\t}\n\t}\n}\n```\n\n`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.\n\nFor the current csslint version, these rules are available:\n\n\timportant\n\tadjoining-classes\n\tknown-properties\n\tbox-sizing\n\tbox-model\n\toverqualified-elements\n\tdisplay-property-grouping\n\tbulletproof-font-face\n\tcompatible-vendor-prefixes\n\tregex-selectors\n\terrors\n\tduplicate-background-images\n\tduplicate-properties\n\tempty-rules\n\tselector-max-approaching\n\tgradients\n\tfallback-colors\n\tfont-sizes\n\tfont-faces\n\tfloats\n\tstar-property-hack\n\toutline-none\n\timport\n\tids\n\tunderscore-property-hack\n\trules-count\n\tqualified-headings\n\tselector-max\n\tshorthand\n\ttext-indent\n\tunique-headings\n\tuniversal-selector\n\tunqualified-attributes\n\tvendor-prefix\n\tzero-units\n\nFor an explanation of those rules, [check the csslint wiki](https://github.com/stubbornella/csslint/wiki/Rules).\n\n*Side note: To update this list, run this:*\n\n```bash\nnode -e \"require('csslint').CSSLint.getRules().forEach(function(x) { console.log(x.id) })\"\n```\n\n## Contributing\n\nPlease use the issue tracker and pull requests.\n\n## License\nCopyright (c) 2012 Jörn Zaefferer\nLicensed under the MIT license.\n", "readmeFilename": "README.md", "_id": "grunt-css@0.5.4", "dist": { "shasum": "adc77ede39f3a274075ef9372c3217e3399b42d3" }, "_from": "grunt-css@~0.5.4", "_resolved": "https://registry.npmjs.org/grunt-css/-/grunt-css-0.5.4.tgz" }
|