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

Sorting errors with aspect-ratio media queries #53

Open
mattblackstone opened this issue Jan 10, 2024 · 2 comments
Open

Sorting errors with aspect-ratio media queries #53

mattblackstone opened this issue Jan 10, 2024 · 2 comments

Comments

@mattblackstone
Copy link

{ 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
Copy link
Author

Environment:

  • node v20.9.0
  • npm 10.1.0
  • postcss 8.4.32
  • postcss-sort-media-queries 5.2.0

@mattblackstone
Copy link
Author

mattblackstone commented Jan 11, 2024

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) {...}

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

1 participant