Open jeanpierreb opened 8 years ago
Of interest, Sublime CSSComb does this reordering perfectly. But it doesn't get the spacing issues right, as Sassbeautify does.
I spent a bunch of time trying to get the two to work together — the formatting from sassbeautify, and the reordering from csscomb but no beueno. Might be possible, but I couldn't figure it out.
And finally, I think I've found a decent compromise. I currently have reordering on via CSSComb, triggered by a custom key map, and then run sassbeautify on save. Not bad.
@saltcod @jeanpierreb You can achieve this by using sublime-hooks (Package Control -> Install -> Hooks). That way you can hook the css_comb
command to saving a file.
Settings -> Settings - Syntax Specific
(ST3 Build 3143)A new empty Sass.sublime-settings
file should open. Now add the following:
"on_pre_save_language": [
{
"command": "css_comb"
}
]
and save it. That way CSSComb will trigger every time you save the file. One setting I added to my CSSComb User settings is "space-before-opening-brace": " "
After that it worked fine for me. However now CSSComb formats the file exactly like SASSBeautify would. So I lost the necessity to use it at all. Hope this helps someone.
Would be great if there was an option for SassBeautify to sort the properties and enforce the sort order from scss-lint.
https://github.com/brigade/scss-lint/blob/master/data/property-sort-orders/concentric.txt