yunusga / postcss-sort-media-queries

PostCSS plugin for sorting and combining CSS media queries with mobile-first / desktop-first methodologies.
https://postcss-sort-media-queries.github.io
MIT License
147 stars 8 forks source link

Sorting errors with aspect-ratio media queries #53

Open mattblackstone opened 10 months ago

mattblackstone commented 10 months ago
{ sort: 'desktop-first' }

expected:

@media (max-aspect-ratio: 4/3) {...}
@media (max-aspect-ratio: 1/1) {...}
@media (max-aspect-ratio: 2/3) {...}
@media (max-aspect-ratio: 1/2) {...}

result:

@media (max-aspect-ratio: 1/1) {...}
@media (max-aspect-ratio: 1/2) {...}
@media (max-aspect-ratio: 2/3) {...}
@media (max-aspect-ratio: 4/3) {...}

same result using floats in place of fractions (1.333, 1, 0.667, 0.5)

mattblackstone commented 10 months ago

Environment:

mattblackstone commented 10 months ago

Temporary workaround to maintain order:

@media (max-aspect-ratio: 4/3) {...}
@media (max-aspect-ratio: 5/5) {...}
@media (max-aspect-ratio: 6/9) {...}
@media (max-aspect-ratio: 7/14) {...}