Skip to content

miraks/sort-sass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SortSass

Sass properties sorting tool.

It supports only indented sass syntax.

Install

npm install -g sort-sass

Leave off the -g if you don't wish to install globally.

Usage

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);

Examples

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

Properties order

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

License

MIT © Alexey Volodkin