blakeembrey / free-style

Make CSS easier and more maintainable by using JavaScript
MIT License
707 stars 29 forks source link

Avoids sorting nested style rules #20

Closed blakeembrey closed 8 years ago

blakeembrey commented 8 years ago

Closes https://github.com/blakeembrey/free-style/issues/19. It's a small tweak to skip sorting the tuples when parsing for nested styles (but not nested rules).

kpatient commented 8 years ago

Can confirm the following nested media queries are working as expected:

    '@media screen and (min-width: 640px)' : {
        maxWidth: '38rem'
    },
    '@media screen and (min-width: 900px)' : {
        maxWidth: '55rem'
    },
    '@media screen and (min-width: 1200px)' : {
        maxWidth: '72rem'
    },

output:

@media only all and (min-width: 1200px)
<style>…</style>.fl6rkql {
    max-width: 72rem;
}
@media only all and (min-width: 900px)
<style>…</style>.fl6rkql {
    max-width: 55rem;
}
@media only all and (min-width: 640px)
<style>…</style> .fl6rkql {
    max-width: 38rem;