├── .gitignore ├── .travis.yml ├── test ├── fixtures │ ├── nested-blocks.css │ ├── single-line-selectors.css │ ├── font-face.css │ ├── single-line-declarations.css │ └── comment-spacing.css ├── expected │ ├── nested-blocks.css │ ├── single-line-selectors.css │ ├── font-face.css │ ├── single-line-declarations.css │ └── comment-spacing.css └── wpcss_test.js ├── .jshintrc ├── LICENSE-MIT ├── package.json ├── Gruntfile.js ├── tasks ├── wpcss.js └── config │ ├── alphabetical.json │ └── default.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | npm-debug.log 4 | tmp 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - "0.11" 5 | - "0.10" 6 | 7 | before_install: 8 | - npm install -g grunt-cli 9 | -------------------------------------------------------------------------------- /test/fixtures/nested-blocks.css: -------------------------------------------------------------------------------- 1 | @media only screen and (min-width: 600px) { 2 | .button, 3 | button, 4 | input[type="button"] { 5 | font-size: 2.4rem; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/expected/nested-blocks.css: -------------------------------------------------------------------------------- 1 | @media only screen and (min-width: 600px) { 2 | .button, 3 | button, 4 | input[type="button"] { 5 | font-size: 2.4rem; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/single-line-selectors.css: -------------------------------------------------------------------------------- 1 | article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /test/expected/single-line-selectors.css: -------------------------------------------------------------------------------- 1 | article, 2 | aside, 3 | details, 4 | figcaption, 5 | figure, 6 | footer, 7 | header, 8 | hgroup, 9 | main, 10 | nav, 11 | section, 12 | summary { 13 | display: block; 14 | } 15 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "boss": true, 3 | "curly": true, 4 | "devel": true, 5 | "eqeqeq": true, 6 | "eqnull": true, 7 | "expr": true, 8 | "immed": true, 9 | "latedef": true, 10 | "newcap": true, 11 | "noarg": true, 12 | "node": true, 13 | "quotmark": "single", 14 | "smarttabs": true, 15 | "sub": true, 16 | "trailing": true, 17 | "undef": true, 18 | "unused": "vars" 19 | } 20 | -------------------------------------------------------------------------------- /test/expected/font-face.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "Genericons"; 3 | src: url("font/Genericons.eot"); 4 | src: url("font/Genericons.eot?#iefix") format("embedded-opentype"), 5 | url("font/Genericons.woff") format("woff"), 6 | url("font/Genericons.ttf") format("truetype"), 7 | url("font/Genericons.svg#Genericons") format("svg"); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | -------------------------------------------------------------------------------- /test/fixtures/font-face.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "Genericons"; 3 | src: url("font/Genericons.eot"); 4 | src: url("font/Genericons.eot?#iefix") format("embedded-opentype"), 5 | url("font/Genericons.woff") format("woff"), 6 | url("font/Genericons.ttf") format("truetype"), 7 | url("font/Genericons.svg#Genericons") format("svg"); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | -------------------------------------------------------------------------------- /test/fixtures/single-line-declarations.css: -------------------------------------------------------------------------------- 1 | .single-line { 2 | font-size: 2em; font-weight: 700; 3 | } 4 | 5 | .single-line-then-one { 6 | font-size: 2em; font-weight: 700; 7 | text-align: center; 8 | } 9 | 10 | .one-then-single-line { 11 | text-align: center; 12 | font-size: 2em; font-weight: 700; 13 | } 14 | 15 | .one-then-single-line-then-one { 16 | margin: 0; 17 | font-size: 2em; font-weight: 700; 18 | text-align: center; 19 | } 20 | 21 | .multiple-lines { 22 | display: block; margin: 0; padding: 0; 23 | font-weight: 700; font-size: 2em; text-align: center; 24 | } 25 | 26 | .single-line-whitespace-separators { 27 | display: block;margin: 0; padding: 0; 28 | font-weight: 700; font-size: 2em; text-align: center; 29 | } 30 | 31 | .linespace { 32 | display: block; 33 | 34 | margin: 0; 35 | 36 | 37 | padding: 0; 38 | } 39 | -------------------------------------------------------------------------------- /test/expected/single-line-declarations.css: -------------------------------------------------------------------------------- 1 | .single-line { 2 | font-size: 2em; 3 | font-weight: 700; 4 | } 5 | 6 | .single-line-then-one { 7 | font-size: 2em; 8 | font-weight: 700; 9 | text-align: center; 10 | } 11 | 12 | .one-then-single-line { 13 | font-size: 2em; 14 | font-weight: 700; 15 | text-align: center; 16 | } 17 | 18 | .one-then-single-line-then-one { 19 | margin: 0; 20 | font-size: 2em; 21 | font-weight: 700; 22 | text-align: center; 23 | } 24 | 25 | .multiple-lines { 26 | display: block; 27 | margin: 0; 28 | padding: 0; 29 | font-size: 2em; 30 | font-weight: 700; 31 | text-align: center; 32 | } 33 | 34 | .single-line-whitespace-separators { 35 | display: block; 36 | margin: 0; 37 | padding: 0; 38 | font-size: 2em; 39 | font-weight: 700; 40 | text-align: center; 41 | } 42 | 43 | .linespace { 44 | display: block; 45 | margin: 0; 46 | padding: 0; 47 | } 48 | -------------------------------------------------------------------------------- /test/fixtures/comment-spacing.css: -------------------------------------------------------------------------------- 1 | /* Section Heading 2 | ------------------------------------------------------------------------------*/ 3 | 4 | *, 5 | *:before, 6 | *:after { 7 | box-sizing: inherit; 8 | } 9 | /* Rule comment */ 10 | html { 11 | box-sizing: border-box; /* Inline comment. */ 12 | } 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | /** 21 | * Section Heading 22 | * ----------------------------------------------------------------------------- 23 | */ 24 | 25 | /* Section Heading 26 | ------------------------------------------------------------------------------*/ 27 | 28 | /* @noflip */ 29 | body.rtl { 30 | direction: rtl; 31 | unicode-bidi: embed; 32 | } 33 | /* Headings 34 | * @link http://example.com/ 35 | ------------------------------------------------------------------------------*/ 36 | h1, 37 | h2, 38 | h3, 39 | h4, 40 | h5, 41 | h6 { 42 | font-weight: 700; 43 | } 44 | -------------------------------------------------------------------------------- /test/expected/comment-spacing.css: -------------------------------------------------------------------------------- 1 | /* Section Heading 2 | ------------------------------------------------------------------------------*/ 3 | 4 | *, 5 | *:before, 6 | *:after { 7 | box-sizing: inherit; 8 | } 9 | 10 | /* Rule comment */ 11 | html { 12 | box-sizing: border-box; 13 | /* Inline comment. */ 14 | } 15 | 16 | 17 | /** 18 | * Section Heading 19 | * ----------------------------------------------------------------------------- 20 | */ 21 | 22 | 23 | /* Section Heading 24 | ------------------------------------------------------------------------------*/ 25 | 26 | /* @noflip */ 27 | body.rtl { 28 | direction: rtl; 29 | unicode-bidi: embed; 30 | } 31 | 32 | 33 | /* Headings 34 | * @link http://example.com/ 35 | ------------------------------------------------------------------------------*/ 36 | 37 | h1, 38 | h2, 39 | h3, 40 | h4, 41 | h5, 42 | h6 { 43 | font-weight: 700; 44 | } 45 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Cedaro 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "grunt-wp-css", 3 | "description": "Format style sheets according to the WordPress CSS coding standards.", 4 | "version": "0.2.1", 5 | "homepage": "https://github.com/cedaro/grunt-wp-css", 6 | "author": { 7 | "name": "Brady Vercher", 8 | "email": "brady@blazersix.com", 9 | "url": "http://www.cedaro.com/" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git://github.com/cedaro/grunt-wp-css.git" 14 | }, 15 | "bugs": { 16 | "url": "https://github.com/cedaro/grunt-wp-css/issues" 17 | }, 18 | "license": "MIT", 19 | "engines": { 20 | "node": ">= 0.10.0" 21 | }, 22 | "scripts": { 23 | "test": "grunt test" 24 | }, 25 | "dependencies": { 26 | "cssbeautify": "^0.3.1", 27 | "csscomb": "^3.1.8", 28 | "lodash": "^4.5.1" 29 | }, 30 | "devDependencies": { 31 | "grunt": "^0.4.5", 32 | "grunt-contrib-clean": "^1.0.0", 33 | "grunt-contrib-jshint": "^1.0.0", 34 | "grunt-contrib-nodeunit": "^0.4.1", 35 | "matchdep": "^1.0.1" 36 | }, 37 | "peerDependencies": { 38 | "grunt": ">=0.4.0" 39 | }, 40 | "keywords": [ 41 | "gruntplugin", 42 | "wordpress", 43 | "css" 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /* 2 | * grunt-wp-css 3 | * http://www.cedaro.com/ 4 | * 5 | * Copyright (c) 2014 Cedaro 6 | * Licensed under the MIT license. 7 | */ 8 | 9 | 'use strict'; 10 | 11 | module.exports = function( grunt ) { 12 | 13 | grunt.loadTasks( 'tasks' ); 14 | require( 'matchdep' ).filterDev( 'grunt-*' ).forEach( grunt.loadNpmTasks ); 15 | 16 | grunt.config.init({ 17 | 18 | clean: { 19 | tests: ['tmp'] 20 | }, 21 | 22 | jshint: { 23 | options : { 24 | jshintrc : '.jshintrc' 25 | }, 26 | all : [ 27 | 'Gruntfile.js', 28 | 'tasks/*.js' 29 | ] 30 | }, 31 | 32 | wpcss: { 33 | comment_spacing: { 34 | src: ['test/fixtures/comment-spacing.css'], 35 | dest: 'tmp/comment-spacing.css' 36 | }, 37 | font_face: { 38 | src: ['test/fixtures/font-face.css'], 39 | dest: 'tmp/font-face.css' 40 | }, 41 | nested_blocks: { 42 | src: ['test/fixtures/nested-blocks.css'], 43 | dest: 'tmp/nested-blocks.css' 44 | }, 45 | single_line_selectors: { 46 | src: ['test/fixtures/single-line-selectors.css'], 47 | dest: 'tmp/single-line-selectors.css' 48 | }, 49 | single_line_declarations: { 50 | src: ['test/fixtures/single-line-declarations.css'], 51 | dest: 'tmp/single-line-declarations.css' 52 | } 53 | }, 54 | 55 | nodeunit: { 56 | tests: ['test/*_test.js'], 57 | } 58 | 59 | }); 60 | 61 | grunt.registerTask( 'default', [ 'jshint' ] ); 62 | 63 | grunt.registerTask( 'test', ['clean:tests', 'wpcss', 'nodeunit']); 64 | 65 | }; 66 | -------------------------------------------------------------------------------- /test/wpcss_test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var grunt = require( 'grunt' ); 4 | 5 | /* 6 | ======== A Handy Little Nodeunit Reference ======== 7 | https://github.com/caolan/nodeunit 8 | 9 | Test methods: 10 | test.expect( numAssertions ) 11 | test.done() 12 | Test assertions: 13 | test.ok( value, [message]) 14 | test.equal( actual, expected, [message]) 15 | test.notEqual( actual, expected, [message]) 16 | test.deepEqual( actual, expected, [message]) 17 | test.notDeepEqual( actual, expected, [message]) 18 | test.strictEqual( actual, expected, [message]) 19 | test.notStrictEqual( actual, expected, [message]) 20 | test.throws( block, [error], [message]) 21 | test.doesNotThrow( block, [error], [message]) 22 | test.ifError( value ) 23 | */ 24 | 25 | function getTestData( id ) { 26 | var processed = grunt.file.read( 'tmp/' + id + '.css' ), 27 | expected = grunt.file.read( 'test/expected/' + id + '.css' ); 28 | 29 | return { 30 | expected: expected, 31 | processed: processed, 32 | isEqual: processed === expected 33 | }; 34 | } 35 | 36 | exports.wpcss = { 37 | setUp: function( done ) { 38 | done(); 39 | }, 40 | 41 | comment_spacing: function( test ) { 42 | test.expect( 1 ); 43 | test.ok( getTestData( 'comment-spacing' ).isEqual, "comments weren't spaced correctly" ); 44 | test.done(); 45 | }, 46 | 47 | font_face: function( test ) { 48 | test.expect( 1 ); 49 | test.ok( getTestData( 'font-face' ).isEqual, "@font-face src wasn't ordered correctly" ); 50 | test.done(); 51 | }, 52 | 53 | nested_blocks: function( test ) { 54 | test.expect( 1 ); 55 | test.ok( getTestData( 'nested-blocks' ).isEqual, "nested blocks don't match the expected output" ); 56 | test.done(); 57 | }, 58 | 59 | single_line_selectors: function( test ) { 60 | test.expect( 1 ); 61 | test.ok( getTestData( 'single-line-selectors' ).isEqual, 'selectors should appear on their own line' ); 62 | test.done(); 63 | }, 64 | 65 | single_line_declarations: function( test ) { 66 | test.expect( 1 ); 67 | test.ok( getTestData( 'single-line-declarations' ).isEqual, 'declarations should appear on their own line' ); 68 | test.done(); 69 | }, 70 | }; 71 | -------------------------------------------------------------------------------- /tasks/wpcss.js: -------------------------------------------------------------------------------- 1 | /* 2 | * grunt-wp-css 3 | * http://www.cedaro.com/ 4 | * 5 | * Copyright (c) 2014 Cedaro 6 | * Licensed under the MIT license. 7 | */ 8 | 9 | 'use strict'; 10 | 11 | module.exports = function( grunt ) { 12 | 13 | var _ = require( 'lodash' ), 14 | Comb = require( 'csscomb' ), 15 | cssbeautify = require( 'cssbeautify' ), 16 | fs = require( 'fs' ), 17 | path = require( 'path' ); 18 | 19 | grunt.registerMultiTask( 'wpcss', 'Format style sheets to match WordPress coding standards.', function() { 20 | var comb = new Comb(), 21 | config = {}, 22 | configKeys = {}, 23 | configPath = {}, 24 | userConfig = {}, 25 | options; 26 | 27 | options = this.options({ 28 | commentSpacing: true, 29 | config: 'default' 30 | }); 31 | 32 | configPath = path.resolve( __dirname, 'config/' + options.config + '.json' ); 33 | if ( fs.existsSync( configPath ) ) { 34 | config = require( configPath ); 35 | } else { 36 | grunt.fatal( 'Invalid config defined.' ); 37 | } 38 | 39 | if ( grunt.file.exists( '.csscomb.json' ) ) { 40 | userConfig = grunt.file.readJSON( '.csscomb.json' ); 41 | } 42 | 43 | configKeys = _.keys( config ); 44 | config = _.extend( config, userConfig, options ); 45 | config = _.pick( config, configKeys ); 46 | 47 | comb.configure( config ); 48 | 49 | this.files.forEach(function( f ) { 50 | // Read and combine source files into the 'contents' var. 51 | var contents = f.src.filter(function( filepath ) { 52 | // Warn on and remove invalid source files (if nonull was set). 53 | if ( ! grunt.file.exists( filepath ) ) { 54 | grunt.log.warn( 'Source file "' + filepath + '" not found.' ); 55 | return false; 56 | } else { 57 | return true; 58 | } 59 | }).map(function( filepath ) { 60 | return grunt.file.read( filepath ).trim(); 61 | }).join( '\n\n' ); 62 | 63 | contents = cssbeautify( contents ); 64 | contents = comb.processString( contents ); 65 | 66 | if ( options.commentSpacing ) { 67 | // Add two newlines before all comments that follow a closing curly brace. 68 | contents = contents.replace( /}\s+\/\*/g, '}\n\n/*' ); 69 | 70 | // Collapse extra newlines. 71 | contents = contents.replace( /\n{3,}/g, '\n\n' ); 72 | 73 | // Comments with at least 20 dashes in them will be considered 74 | // section headings and should follow two newlines. 75 | contents = contents.replace(/\s*(\/\*((?!\*\/)[\s\S])+-{20,}[\s\S]*?\*\/)\s*/g, '\n\n\n$1\n\n'); 76 | contents = contents.replace( /\n{4,}/g, '\n\n\n' ); 77 | 78 | // Trim whitespace at the beginning of the file. 79 | contents = contents.replace( /^\s*/, '' ); 80 | } 81 | 82 | grunt.file.write( f.dest, contents ); 83 | }); 84 | }); 85 | 86 | }; 87 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # grunt-wp-css [![Build Status](https://travis-ci.org/cedaro/grunt-wp-css.png?branch=develop)](https://travis-ci.org/cedaro/grunt-wp-css) 2 | 3 | > Format style sheets according to the [WordPress CSS coding standards](http://make.wordpress.org/core/handbook/coding-standards/css/). 4 | 5 | 6 | ## Getting Started 7 | 8 | If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: 9 | 10 | ```shell 11 | npm install grunt-wp-css --save-dev 12 | ``` 13 | 14 | Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: 15 | 16 | ```js 17 | grunt.loadNpmTasks( 'grunt-wp-css' ); 18 | ``` 19 | 20 | ## wpcss Task 21 | 22 | _Run this task with the `grunt wpcss` command._ 23 | 24 | 25 | ### Overview 26 | 27 | In your project's Gruntfile, add a section named `wpcss` to the data object passed into `grunt.initConfig()`. 28 | 29 | ```js 30 | grunt.initConfig({ 31 | wpcss: { 32 | target: { 33 | options: { 34 | commentSpacing: true, // Whether to clean up newlines around comments between CSS rules. 35 | config: '', // Which CSSComb config to use for sorting properties. 36 | }, 37 | files: {} 38 | } 39 | } 40 | }); 41 | ``` 42 | This task supports the file mapping format Grunt supports. Please read [Globbing patterns](http://gruntjs.com/configuring-tasks#globbing-patterns) and [Building the files object dynamically](http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically) for additional details. 43 | 44 | 45 | ### Options 46 | 47 | #### options.commentSpacing 48 | Type: `Boolean` 49 | Default value: `true` 50 | *Optional* 51 | 52 | Whether the plugin should attempt to automatically correct spacing around comments that appear between rule declarations within the style sheet. 53 | 54 | #### options.config 55 | Type: `String` 56 | Default value: `'default'` 57 | 58 | The CSSComb configuration to use for sorting CSS properties. Possible values are `default` or `alphabetical`. 59 | 60 | 61 | ## Contributors 62 | 63 | Thanks to [Gary Jones](https://github.com/GaryJones) of [Gamajo Tech](http://gamajo.com/) for researching and providing the default configuration rules, among [many other improvements](https://github.com/cedaro/grunt-wp-css/commits?author=GaryJones). 64 | 65 | 66 | ## Release History 67 | 68 | #### 0.2.1 69 | 70 | Updated peer dependencies to support Grunt 1.0. See [#13](https://github.com/cedaro/grunt-wp-css/pull/13) 71 | 72 | #### 0.2.0 73 | 74 | This is the [@GaryJones](https://github.com/GaryJones) release. 75 | 76 | * Updated the default CSScomb config ([0887c06](https://github.com/cedaro/grunt-wp-css/commit/0887c06993c7eeea2c716d2d9ba523f3663dfa8b)). 77 | * Updated the alphabetical CSScomb config to match improvements in the new default config. 78 | * Fixed the exports variable name in the tests. 79 | * Added Travis CI support. 80 | 81 | #### 0.1.0 82 | 83 | * Initial release. 84 | -------------------------------------------------------------------------------- /tasks/config/alphabetical.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": [ 3 | ".git/**", 4 | "node_modules/**" 5 | ], 6 | "verbose": true, 7 | 8 | "always-semicolon": true, 9 | "block-indent": "\t", 10 | "color-case": "lower", 11 | "color-shorthand": true, 12 | "element-case": "lower", 13 | "eof-newline": true, 14 | "leading-zero": true, 15 | "quotes": "double", 16 | "remove-empty-rulesets": true, 17 | "rule-delimiter": "\n\n", 18 | "sort-order-fallback": "abc", 19 | "space-after-colon": " ", 20 | "space-after-combinator": " ", 21 | "space-after-opening-brace": "\n", 22 | "space-after-selector-delimiter": "\n", 23 | "space-before-closing-brace": "\n", 24 | "space-before-colon": "", 25 | "space-before-combinator": " ", 26 | "space-before-opening-brace": " ", 27 | "space-before-selector-delimiter": "", 28 | "space-between-declarations": "\n", 29 | "strip-spaces": true, 30 | "unitless-zero": true, 31 | "sort-order": [ 32 | [ 33 | "$variable", 34 | "$include", 35 | "$import" 36 | ], 37 | 38 | [ 39 | "-moz-animation", 40 | "-ms-animation", 41 | "-o-animation", 42 | "-webkit-animation", 43 | "animation", 44 | "-moz-animation-delay", 45 | "-ms-animation-delay", 46 | "-o-animation-delay", 47 | "-webkit-animation-delay", 48 | "animation-delay", 49 | "-moz-animation-direction", 50 | "-ms-animation-direction", 51 | "-o-animation-direction", 52 | "-webkit-animation-direction", 53 | "animation-direction", 54 | "-moz-animation-duration", 55 | "-ms-animation-duration", 56 | "-o-animation-duration", 57 | "-webkit-animation-duration", 58 | "animation-duration", 59 | "-moz-animation-iteration-count", 60 | "-ms-animation-iteration-count", 61 | "-o-animation-iteration-count", 62 | "-webkit-animation-iteration-count", 63 | "animation-iteration-count", 64 | "-moz-animation-name", 65 | "-ms-animation-name", 66 | "-o-animation-name", 67 | "-webkit-animation-name", 68 | "animation-name", 69 | "-moz-animation-play-state", 70 | "-ms-animation-play-state", 71 | "-o-animation-play-state", 72 | "-webkit-animation-play-state", 73 | "animation-play-state", 74 | "-moz-animation-timing-function", 75 | "-ms-animation-timing-function", 76 | "-o-animation-timing-function", 77 | "-webkit-animation-timing-function", 78 | "animation-timing-function", 79 | "-moz-backface-visibility", 80 | "-webkit-backface-visibility", 81 | "backface-visibility", 82 | "background", 83 | "background-attachment", 84 | "-moz-background-clip", 85 | "-webkit-background-clip", 86 | "background-clip", 87 | "background-color", 88 | "background-image", 89 | "background-origin", 90 | "background-position", 91 | "-ms-background-position-x", 92 | "background-position-x", 93 | "-ms-background-position-y", 94 | "background-position-y", 95 | "background-repeat", 96 | "-moz-background-size", 97 | "-o-background-size", 98 | "-webkit-background-size", 99 | "background-size", 100 | "border", 101 | "border-bottom", 102 | "border-bottom-color", 103 | "-webkit-border-bottom-left-radius", 104 | "border-bottom-left-radius", 105 | "-webkit-border-bottom-right-radius", 106 | "border-bottom-right-radius", 107 | "border-bottom-style", 108 | "border-bottom-width", 109 | "border-collapse", 110 | "border-color", 111 | "-moz-border-image", 112 | "-o-border-image", 113 | "-webkit-border-image", 114 | "border-image", 115 | "-moz-border-image-outset", 116 | "-o-border-image-outset", 117 | "-webkit-border-image-outset", 118 | "border-image-outset", 119 | "-moz-border-image-repeat", 120 | "-o-border-image-repeat", 121 | "-webkit-border-image-repeat", 122 | "border-image-repeat", 123 | "-moz-border-image-slice", 124 | "-o-border-image-slice", 125 | "-webkit-border-image-slice", 126 | "border-image-slice", 127 | "-moz-border-image-source", 128 | "-o-border-image-source", 129 | "-webkit-border-image-source", 130 | "border-image-source", 131 | "-moz-border-image-width", 132 | "-o-border-image-width", 133 | "-webkit-border-image-width", 134 | "border-image-width", 135 | "border-left", 136 | "border-left-color", 137 | "border-left-style", 138 | "border-left-width", 139 | "-moz-border-radius", 140 | "-webkit-border-radius", 141 | "border-radius", 142 | "-moz-border-radius-bottomleft", 143 | "-moz-border-radius-bottomright", 144 | "-moz-border-radius-topleft", 145 | "-moz-border-radius-topright", 146 | "border-right", 147 | "border-right-color", 148 | "border-right-style", 149 | "border-right-width", 150 | "border-spacing", 151 | "border-style", 152 | "border-top", 153 | "border-top-color", 154 | "-webkit-border-top-left-radius", 155 | "border-top-left-radius", 156 | "-webkit-border-top-right-radius", 157 | "border-top-right-radius", 158 | "border-top-style", 159 | "border-top-width", 160 | "border-width", 161 | "box-decoration-break", 162 | "-moz-box-shadow", 163 | "-webkit-box-shadow", 164 | "box-shadow", 165 | "-moz-box-sizing", 166 | "-webkit-box-sizing", 167 | "box-sizing", 168 | "caption-side", 169 | "clear", 170 | "clip", 171 | "color", 172 | "content", 173 | "counter-increment", 174 | "counter-reset", 175 | "cursor", 176 | "display", 177 | "empty-cells", 178 | "-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha", 179 | "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient", 180 | "filter:progid:DXImageTransform.Microsoft.Alpha(Opacity", 181 | "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader", 182 | "filter:progid:DXImageTransform.Microsoft.gradient", 183 | "flex-align", 184 | "flex-direction", 185 | "flex-order", 186 | "flex-pack", 187 | "float", 188 | "font", 189 | "font-effect", 190 | "font-emphasize", 191 | "font-emphasize-position", 192 | "font-emphasize-style", 193 | "font-family", 194 | "font-size", 195 | "font-size-adjust", 196 | "-moz-osx-font-smoothing", 197 | "-webkit-font-smoothing", 198 | "font-smooth", 199 | "font-stretch", 200 | "font-style", 201 | "font-variant", 202 | "font-weight", 203 | "height", 204 | "-moz-hyphens", 205 | "-webkit-hyphens", 206 | "hyphens", 207 | "-ms-interpolation-mode", 208 | "letter-spacing", 209 | "line-height", 210 | "list-style", 211 | "list-style-image", 212 | "list-style-position", 213 | "list-style-type", 214 | "margin", 215 | "margin-bottom", 216 | "margin-left", 217 | "margin-right", 218 | "margin-top", 219 | "max-height", 220 | "max-width", 221 | "min-height", 222 | "min-width", 223 | "nav-down", 224 | "nav-index", 225 | "nav-left", 226 | "nav-right", 227 | "nav-up", 228 | "opacity", 229 | "outline", 230 | "outline-color", 231 | "outline-offset", 232 | "outline-style", 233 | "outline-width", 234 | "overflow", 235 | "-ms-overflow-x", 236 | "overflow-x", 237 | "-ms-overflow-y", 238 | "overflow-y", 239 | "padding", 240 | "padding-bottom", 241 | "padding-left", 242 | "padding-right", 243 | "padding-top", 244 | "pointer-events", 245 | 246 | "position", 247 | "top", 248 | "right", 249 | "bottom", 250 | "left", 251 | 252 | "quotes", 253 | "resize", 254 | "src", 255 | "-moz-tab-size", 256 | "-o-tab-size", 257 | "tab-size", 258 | "table-layout", 259 | "text-align", 260 | "-moz-text-align-last", 261 | "-ms-text-align-last", 262 | "-webkit-text-align-last", 263 | "text-align-last", 264 | "text-decoration", 265 | "text-emphasis", 266 | "text-emphasis-color", 267 | "text-emphasis-position", 268 | "text-emphasis-style", 269 | "text-indent", 270 | "-ms-text-justify", 271 | "text-justify", 272 | "text-outline", 273 | "-ms-text-overflow", 274 | "text-overflow", 275 | "text-overflow-ellipsis", 276 | "text-overflow-mode", 277 | "text-rendering", 278 | "text-shadow", 279 | "text-transform", 280 | "text-wrap", 281 | "-moz-transform", 282 | "-ms-transform", 283 | "-o-transform", 284 | "-webkit-transform", 285 | "transform", 286 | "-moz-transform-origin", 287 | "-ms-transform-origin", 288 | "-o-transform-origin", 289 | "-webkit-transform-origin", 290 | "transform-origin", 291 | "-moz-transition", 292 | "-ms-transition", 293 | "-o-transition", 294 | "-webkit-transition", 295 | "transition", 296 | "-moz-transition-delay", 297 | "-ms-transition-delay", 298 | "-o-transition-delay", 299 | "-webkit-transition-delay", 300 | "transition-delay", 301 | "-moz-transition-duration", 302 | "-ms-transition-duration", 303 | "-o-transition-duration", 304 | "-webkit-transition-duration", 305 | "transition-duration", 306 | "-moz-transition-property", 307 | "-ms-transition-property", 308 | "-o-transition-property", 309 | "-webkit-transition-property", 310 | "transition-property", 311 | "-moz-transition-timing-function", 312 | "-ms-transition-timing-function", 313 | "-o-transition-timing-function", 314 | "-webkit-transition-timing-function", 315 | "transition-timing-function", 316 | "-moz-user-select", 317 | "-ms-user-select", 318 | "-webkit-user-select", 319 | "user-select", 320 | "vertical-align", 321 | "visibility", 322 | "white-space", 323 | "width", 324 | "-ms-word-break", 325 | "word-break", 326 | "word-spacing", 327 | "-ms-word-wrap", 328 | "word-wrap", 329 | "-ms-writing-mode", 330 | "z-index", 331 | "zoom" 332 | ] 333 | ] 334 | } 335 | -------------------------------------------------------------------------------- /tasks/config/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": [ 3 | ".git/**", 4 | "node_modules/**" 5 | ], 6 | "verbose": true, 7 | 8 | "always-semicolon": true, 9 | "block-indent": "\t", 10 | "color-case": "lower", 11 | "color-shorthand": true, 12 | "element-case": "lower", 13 | "eof-newline": true, 14 | "leading-zero": true, 15 | "quotes": "double", 16 | "remove-empty-rulesets": true, 17 | "rule-delimiter": "\n\n", 18 | "sort-order-fallback": "abc", 19 | "space-after-colon": " ", 20 | "space-after-combinator": " ", 21 | "space-after-opening-brace": "\n", 22 | "space-after-selector-delimiter": "\n", 23 | "space-before-closing-brace": "\n", 24 | "space-before-colon": "", 25 | "space-before-combinator": " ", 26 | "space-before-opening-brace": " ", 27 | "space-before-selector-delimiter": "", 28 | "space-between-declarations": "\n", 29 | "strip-spaces": true, 30 | "unitless-zero": true, 31 | "sort-order": [ 32 | [ 33 | "$variable", 34 | "$include", 35 | "$import" 36 | ], 37 | 38 | [ 39 | "display", 40 | "visibility", 41 | "float", 42 | "clear", 43 | "overflow", 44 | "overflow-x", 45 | "overflow-y", 46 | "-ms-overflow-x", 47 | "-ms-overflow-y", 48 | "clip", 49 | "zoom", 50 | "flex-direction", 51 | "flex-order", 52 | "flex-pack", 53 | "flex-align", 54 | 55 | "position", 56 | "z-index", 57 | "top", 58 | "right", 59 | "bottom", 60 | "left", 61 | 62 | "-webkit-box-sizing", 63 | "-moz-box-sizing", 64 | "box-sizing", 65 | "width", 66 | "min-width", 67 | "max-width", 68 | "height", 69 | "min-height", 70 | "max-height", 71 | "margin", 72 | "margin-top", 73 | "margin-right", 74 | "margin-bottom", 75 | "margin-left", 76 | "padding", 77 | "padding-top", 78 | "padding-right", 79 | "padding-bottom", 80 | "padding-left", 81 | "border", 82 | "border-width", 83 | "border-style", 84 | "border-color", 85 | "border-top", 86 | "border-top-width", 87 | "border-top-style", 88 | "border-top-color", 89 | "border-right", 90 | "border-right-width", 91 | "border-right-style", 92 | "border-right-color", 93 | "border-bottom", 94 | "border-bottom-width", 95 | "border-bottom-style", 96 | "border-bottom-color", 97 | "border-left", 98 | "border-left-width", 99 | "border-left-style", 100 | "border-left-color", 101 | "-webkit-border-radius", 102 | "-moz-border-radius", 103 | "border-radius", 104 | "-webkit-border-top-left-radius", 105 | "-moz-border-radius-topleft", 106 | "border-top-left-radius", 107 | "-webkit-border-top-right-radius", 108 | "-moz-border-radius-topright", 109 | "border-top-right-radius", 110 | "-webkit-border-bottom-right-radius", 111 | "-moz-border-radius-bottomright", 112 | "border-bottom-right-radius", 113 | "-webkit-border-bottom-left-radius", 114 | "-moz-border-radius-bottomleft", 115 | "border-bottom-left-radius", 116 | "-webkit-border-image", 117 | "-moz-border-image", 118 | "-o-border-image", 119 | "border-image", 120 | "-webkit-border-image-source", 121 | "-moz-border-image-source", 122 | "-o-border-image-source", 123 | "border-image-source", 124 | "-webkit-border-image-slice", 125 | "-moz-border-image-slice", 126 | "-o-border-image-slice", 127 | "border-image-slice", 128 | "-webkit-border-image-width", 129 | "-moz-border-image-width", 130 | "-o-border-image-width", 131 | "border-image-width", 132 | "-webkit-border-image-outset", 133 | "-moz-border-image-outset", 134 | "-o-border-image-outset", 135 | "border-image-outset", 136 | "-webkit-border-image-repeat", 137 | "-moz-border-image-repeat", 138 | "-o-border-image-repeat", 139 | "border-image-repeat", 140 | "table-layout", 141 | "empty-cells", 142 | "caption-side", 143 | "border-spacing", 144 | "border-collapse", 145 | 146 | "outline", 147 | "outline-width", 148 | "outline-style", 149 | "outline-color", 150 | "outline-offset", 151 | "opacity", 152 | "filter:progid:DXImageTransform.Microsoft.Alpha(Opacity", 153 | "-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha", 154 | "-ms-interpolation-mode", 155 | "color", 156 | "background", 157 | "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader", 158 | "background-color", 159 | "background-image", 160 | "background-repeat", 161 | "background-attachment", 162 | "background-position", 163 | "background-position-x", 164 | "-ms-background-position-x", 165 | "background-position-y", 166 | "-ms-background-position-y", 167 | "-webkit-background-clip", 168 | "-moz-background-clip", 169 | "background-clip", 170 | "background-origin", 171 | "-webkit-background-size", 172 | "-moz-background-size", 173 | "-o-background-size", 174 | "background-size", 175 | "box-decoration-break", 176 | "-webkit-box-shadow", 177 | "-moz-box-shadow", 178 | "box-shadow", 179 | "filter:progid:DXImageTransform.Microsoft.gradient", 180 | "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient", 181 | "text-shadow", 182 | "font", 183 | "font-family", 184 | "src", 185 | "font-size", 186 | "font-weight", 187 | "font-style", 188 | "font-variant", 189 | "font-size-adjust", 190 | "font-stretch", 191 | "font-effect", 192 | "font-emphasize", 193 | "font-emphasize-position", 194 | "font-emphasize-style", 195 | "-webkit-font-smoothing", 196 | "-moz-osx-font-smoothing", 197 | "font-smooth", 198 | "line-height", 199 | "text-align", 200 | "-webkit-text-align-last", 201 | "-moz-text-align-last", 202 | "-ms-text-align-last", 203 | "text-align-last", 204 | "vertical-align", 205 | "white-space", 206 | "text-decoration", 207 | "text-emphasis", 208 | "text-emphasis-color", 209 | "text-emphasis-style", 210 | "text-emphasis-position", 211 | "text-indent", 212 | "-ms-text-justify", 213 | "text-justify", 214 | "letter-spacing", 215 | "word-spacing", 216 | "-ms-writing-mode", 217 | "text-outline", 218 | "text-transform", 219 | "text-wrap", 220 | "text-overflow", 221 | "-ms-text-overflow", 222 | "text-overflow-ellipsis", 223 | "text-overflow-mode", 224 | "-ms-word-wrap", 225 | "word-wrap", 226 | "word-break", 227 | "-ms-word-break", 228 | "-moz-tab-size", 229 | "-o-tab-size", 230 | "tab-size", 231 | "-webkit-hyphens", 232 | "-moz-hyphens", 233 | "hyphens", 234 | 235 | "list-style", 236 | "list-style-position", 237 | "list-style-type", 238 | "list-style-image", 239 | "content", 240 | "quotes", 241 | "counter-reset", 242 | "counter-increment", 243 | "resize", 244 | "cursor", 245 | "-webkit-user-select", 246 | "-moz-user-select", 247 | "-ms-user-select", 248 | "user-select", 249 | "nav-index", 250 | "nav-up", 251 | "nav-right", 252 | "nav-down", 253 | "nav-left", 254 | "-webkit-transition", 255 | "-moz-transition", 256 | "-ms-transition", 257 | "-o-transition", 258 | "transition", 259 | "-webkit-transition-delay", 260 | "-moz-transition-delay", 261 | "-ms-transition-delay", 262 | "-o-transition-delay", 263 | "transition-delay", 264 | "-webkit-transition-timing-function", 265 | "-moz-transition-timing-function", 266 | "-ms-transition-timing-function", 267 | "-o-transition-timing-function", 268 | "transition-timing-function", 269 | "-webkit-transition-duration", 270 | "-moz-transition-duration", 271 | "-ms-transition-duration", 272 | "-o-transition-duration", 273 | "transition-duration", 274 | "-webkit-transition-property", 275 | "-moz-transition-property", 276 | "-ms-transition-property", 277 | "-o-transition-property", 278 | "transition-property", 279 | "-webkit-transform", 280 | "-moz-transform", 281 | "-ms-transform", 282 | "-o-transform", 283 | "transform", 284 | "-webkit-transform-origin", 285 | "-moz-transform-origin", 286 | "-ms-transform-origin", 287 | "-o-transform-origin", 288 | "transform-origin", 289 | "-webkit-animation", 290 | "-moz-animation", 291 | "-ms-animation", 292 | "-o-animation", 293 | "animation", 294 | "-webkit-animation-name", 295 | "-moz-animation-name", 296 | "-ms-animation-name", 297 | "-o-animation-name", 298 | "animation-name", 299 | "-webkit-animation-duration", 300 | "-moz-animation-duration", 301 | "-ms-animation-duration", 302 | "-o-animation-duration", 303 | "animation-duration", 304 | "-webkit-animation-play-state", 305 | "-moz-animation-play-state", 306 | "-ms-animation-play-state", 307 | "-o-animation-play-state", 308 | "animation-play-state", 309 | "-webkit-animation-timing-function", 310 | "-moz-animation-timing-function", 311 | "-ms-animation-timing-function", 312 | "-o-animation-timing-function", 313 | "animation-timing-function", 314 | "-webkit-animation-delay", 315 | "-moz-animation-delay", 316 | "-ms-animation-delay", 317 | "-o-animation-delay", 318 | "animation-delay", 319 | "-webkit-animation-iteration-count", 320 | "-moz-animation-iteration-count", 321 | "-ms-animation-iteration-count", 322 | "-o-animation-iteration-count", 323 | "animation-iteration-count", 324 | "-webkit-animation-direction", 325 | "-moz-animation-direction", 326 | "-ms-animation-direction", 327 | "-o-animation-direction", 328 | "animation-direction", 329 | "-webkit-backface-visibility", 330 | "-moz-backface-visibility", 331 | "backface-visibility", 332 | "text-rendering", 333 | "pointer-events" 334 | ] 335 | ] 336 | } 337 | --------------------------------------------------------------------------------