Sass properties sorting tool.
It supports only indented sass syntax.
npm install -g sort-sass
Leave off the -g
if you don't wish to install globally.
From CLI:
sortsass /path/to/styles.sass
From node:
var fs = require('fs');
var sortSass = require('sort-sass');
var sassString = fs.readFileSync('some.sass');
var sortedSassString = sortSass(sassString);
Input:
.foo
font-size: 1em
content: 'bar'
color: white
display: block
position: absolute
Output:
.foo
content: 'bar'
display: block
position: absolute
font-size: 1em
color: white
Ordering is hardcoded right now, you can see it here https://github.com/miraks/sort-sass/blob/master/src/order.coffee. I think I'll add an option to change this.
– miraks (repository owner) in a comment to #1
There is an issue #3
MIT © Alexey Volodkin