Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support alternative property ordering style #92

Merged
merged 20 commits into from
Apr 19, 2015
Merged

Support alternative property ordering style #92

merged 20 commits into from
Apr 19, 2015

Conversation

benedfit
Copy link

Closes #88

sortOrder (default: false, false | 'alphabetical' | 'grouped' | {Array})

Enforce a particular sort order when declaring properties. Throws a warning if you don't follow the order. If set to false, allow any order.

Example if 'alphabetical':

prefer this:

.some-class
    display block
    float left
    position absolute
    right 10px
    top 0

over this:

.some-class
    position absolute
    top 0
    right 10px
    display block
    float left

Example if 'grouped' (based on predefined grouped ordering):

prefer this:

.some-class
    position absolute
    top 0
    right 10px
    display block
    float left

over this:

.some-class
    display block
    float left
    position absolute
    right 10px
    top 0

Example if [ 'margin', 'padding', 'float', 'position' ]:

prefer this:

.some-class
    margin 0
    padding 0
    float left
    position absolute
    right 10px
    top 0
    display block

over this:

.some-class
    display block
    float left
    position absolute
    right 10px
    top 0
    margin 0
    padding 0

When set to 'grouped' or {Array} throws a warning if properties that are not defined in the ordering array are not after those that should be ordered.

@rossPatton
Copy link
Collaborator

Awesome, I'll take a look at merging this in this weekend.

Thanks!

@rossPatton rossPatton merged commit bf0fe42 into SimenB:develop Apr 19, 2015
@rossPatton
Copy link
Collaborator

this should be in 0.9.6, lemme know if you guys see any issues

thanks again

@benedfit
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants