-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Alphabetical media query ordering #19
Comments
Thanks for the edge-case, it's definitely as you've said - nested styles are being sorted. I think we should not sort nested styles (there's no need) which would fix this issue, but it might push the core issue a little further down the line. Please let me know, after this patch, if there's subsequent issues. |
Thanks so much for the fast response! Can confirm it is now respecting the order. And yes the above declarations should have been reversed, edited. |
My apologies for not seeing this earlier but it appears the commit #20 is showing mixed results. Which initially happened to be appearing correctly. The results are also different when using webpack auto reload and when just reloading in the browser. I think its no longer sorting alphabetically like normal properties as you fixed. But the deeper issue seems to be at play now, where the ordering is arbitrary. Maybe because its a javascript object which doesn't have any specified order? |
The order of properties is defined in an array, so it's not that. Most likely, whatever is happening with your Webpack reload is causing issues because the last style appended always appears at the bottom. I can't comment more without viewing some code though. |
I'm surprised I've not been able to find this issue anywhere, so maybe I've missed something.
So css declarations are sorted alphabetically when output. This also applies to
@media
queries which can cause them to override each other.Example:
This is outputting in this order for me, which I think is because it is reading the 1000 before the 500:
The text was updated successfully, but these errors were encountered: