brackets-csscomb
brackets-csscomb copied to clipboard
Add support for Sass and LESS specific stuff & minor config changes.
I guess it would be cool to make possible to sort pre-processor specific rules: includes, mixins and extends. I've added an array into sort-order
. This is kinda new feature, so maybe the version should be updated to 1.1.0, according to Semantic Versioning.
Almost everybody sort their CSS, or SCSS or whatever on purpose. That purpose would be style guide. One of the most popular ones is SMACSS, this book has a chapter about formatting code. I guess this kind of style guide would be appropriate so I changed sort-order
a bit.
I've changed block-indent
and rule-indent
to fix an issue when you sort already indented Sass or LESS files, previous setup messed everything up.
As for stick-brace
key, it's value would be 1, because it's like global convention to use such a style, isn't it?
That file is just default config straight from csscomb so it kinda doesn't make sense to edit it. I think bigger problem is that at this moment plugin is hardcoded to exclusively use only this config file.
One way to fix this problem is to comb file not just selected text so csscomb can search for config recursively. So you just add custom .csscomb.json
to project folder and csscomb will sort how you want.
This way feels much cleaner to me.
Another way is to add search in brackets for .csscomb.json
and pass it instead of default config. But this will be effectively the same code as in csscomb and it much more error-prone.