css-sort.el is an Emacs extension you can sort CSS attributables automatically.
It has the following advantages:
- You don't need to select the sorted area, it can sort all the attributes automatically with one command "css-sort".
- Sort CSS attributes exactly in accordance with CSS sorting rules
- The statement starting with ◎ is automatically skipped and not sorted.
- @include attribute will automatically be placed in the beginning of the attribute area in the scan order.
Clone or download this repository (path of the folder is the <path-to-css-sort> used below).
In your ~/.emacs, add the following two lines:
(add-to-list 'load-path "<path-to-css-sort>") ; add css-sort to your load-path
(require 'css-sort)M-x css-sort