-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Is there a way to sort declarations before nestings? #23
Comments
That could nice to have yes. Currently there is no way of doing this, I'm not fully convinced though as this also means moving the selector At the moment the selector in the middle will 'split' the sorting keeping the declarations at their original position compared to the selector while still being sorted. ExampleBefore: .foo {
display: block;
.bar {
display: block;
}
display: block;
animation: none;
} After: .foo {
display: block;
.bar {
display: block;
}
animation: none;
display: block;
} |
This is what I am experiencing (using the atom package, with the command Before.foo {
display: block;
.bar {
display: block;
}
display: block;
animation: none;
} After.foo {
.bar {
display: block;
}
display: block;
display: block;
animation: none;
} |
For alphabetical sorting, it seems to work as expected |
Oh interesting find! It shouldn't modify the order like that... I will split this issue. |
Moving declarations to the bottom was/is a blocker for me to actually use the plugin. If it's fixed by moving declarations to the top, it might be a blocker for others. If it's fixed by moving declarations anywhere (top or bottom), I think it should be configurable. For my needs, fixing #29 would be sufficient. |
After asking around in the PostCSS gitter room, Twitter and #web room on freenode I have eight people all putting the declarations on the top. So this looks like sane standard behaviour. |
It would be nice to have a config parameter to output declarations before nestings.
Example
Before:
After:
The text was updated successfully, but these errors were encountered: