Skip to content

Commit 97196c7

Browse files
committed
Update README
Add examples of: - sorting properties in *.scss files - using keywords (`$variable`, `$include` and `$import`) in sort-order config.
1 parent 2f37068 commit 97196c7

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,35 @@ p {
363363
}
364364
```
365365
366+
If you sort properties in `*.scss` or `*.less` files, you can use one of 3
367+
keywords in your config:
368+
* `$variable` for variable declarations (e.g. `$var` in Sass or `@var` in LESS);
369+
* `$include` for included mixins (e.g. `@include ...` and `@extend ...` in Sass
370+
or `.mixin()` in LESS);
371+
* `$import` for `@import` rules.
372+
373+
Example: `{ "sort-order": [ [ "$variable" ], [ "$include" ], [ "top", "padding" ] ] }`
374+
375+
```scss
376+
/* before */
377+
p {
378+
padding: 0;
379+
@include mixin($color);
380+
$color: tomato;
381+
top: 0;
382+
}
383+
384+
/* after */
385+
p {
386+
$color: tomato;
387+
388+
@include mixin($color);
389+
390+
top: 0;
391+
padding: 0;
392+
}
393+
```
394+
366395
### stick-brace
367396
368397
Available values:

0 commit comments

Comments
 (0)