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

alphabetise attribute order? #26

Closed
BrianGilbert opened this issue Nov 21, 2013 · 1 comment
Closed

alphabetise attribute order? #26

BrianGilbert opened this issue Nov 21, 2013 · 1 comment

Comments

@BrianGilbert
Copy link

Is it possible to make this alphabetise the order of the CSS attributes within all declarations?

@badsyntax
Copy link
Owner

Here there. Not at this time. This has been requested before in issue #10. It's unlikely I'll add this feature, unless I find a python library that does it and is well tested. The thing with sorting rules is that it will change the specificity of those rules and thus change the final layout. Sorting rules in a generic sense won't work reliably because of how people might write their sass.

Here's an example:

.myclass {
    @extend .box;
    border: 0;    
    @include border-radius(4px);
    @include acustommixin(2px);    
    border-top-left-radius: 40px 40px;
    border-bottom: 1px solid red;     
}

The order of those rules are very important to allow certain rules to override others. The example above shows how things can potentially break if you change the order of things.

I have decided to avoid pain and let the users define their rule ordering. ST comes with a tool to "sort lines" which i use to sort my rules.

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

No branches or pull requests

2 participants