CSSComb is a coding style formatter for CSS.
npm install csscombTo run csscomb, you can use the following command from the project root:
./node_modules/.bin/csscomb path[ path[...]]./node_modules/.bin/csscomb --help
Usage: csscomb [options] <file ...>
Options:
-h, --help output usage information
-V, --version output the version number
-c, --config [path] configuration file pathcsscomb is configured using .csscomb.json file, located in the project root.
Example configuration:
{
"exclude": ["node_modules/**"],
"colon-space": true,
"color-case": "lower",
"color-shorthand": true,
"leading-zero": false,
"rule-indent": true,
"block-indent": true,
"stick-brace": true,
"strip-spaces": true,
"unitless-zero": true,
"always-semicolon": true
}Available value: {Boolean} true
Example: { "always-semicolon": true }
/* before */
a { color: red }
/* after */
a { color: red; }Available values:
{Boolean}true{Number}of spaces{String}of space characters (/[ \t]*)
Example: { "block-indent": 2 }
/* before */
a { color: red }
@media all { a { color: green } }
/* after */
a { color: red }
@media all {
a { color: green }
}Available values:
{Boolean}true (meansafter){String}:before,after,bothor any combination of whitespaces and/or a colon (,:,\t:\n\tetc.)
Example: { "colon-space": true }
/* before */
a { color:red }
/* after */
a { color: red }Example: { "colon-space": ":\n\t\t" }
/* before */
a {
color: red;
}
/* after */
a {
color:
red;
}Example: { "colon-space": ":" }
/* before */
a { color: red }
/* after */
a { color:red }Run npm test for tests.
Anyone and everyone is welcome to contribute. Please take a moment to review the guidelines for contributing.
Thanks for assistance and contributions:
@miripiruni, @puzankov, @L0stSoul
This software is released under the terms of the MIT license.
