Less beautifier - format code

2.6k views Asked by At

Is there is code beautifier for less such as http://www.lonniebest.com/formatcss/ for css? I need sort properties in less code by alphabet.

2

There are 2 answers

0
Kev On BEST ANSWER

I use CSSComb http://csscomb.com/. This one is a npm module but there are plugins for it. Especially I use it with Sublime Text.

It works with less too although there might me some edge case not (yet) properly handled. But it's good for me.

You can order rules however you want. Just read the docs ;)

0
roy riojas On

You can also use cssbrush. It is based and uses the csscomb under the hood, but include a fix for this bug and also has the ability to remember the files that were previously beautified, so it will only beautify changed files on each run.

Full disclosure, I wrote it.