postcss-sorting icon indicating copy to clipboard operation
postcss-sorting copied to clipboard

Feature request: sort simple media queries by query parameter values

Open derSascha opened this issue 3 years ago • 0 comments

Thanks for the great postcss plugin! Having some trouble with Bootstrap that uses the fact that only the last matching rule is used in browser:

@media (min-width: 768px) { .col-md-2: { width: 16%; } }
@media (min-width: 992px) { .col-lg-3: { width: 25%: } }

Sorting them in the wrong order breaks them. Not sure if it might be possible to sort simple media queries that contain only a min-width or a max-width query by numbers. Something like this:

@media (min-width: 576px) { ... }
@media (max-width: 767.98px) { ... }
@media (min-width: 768px) { ... }
... more complex queries

derSascha avatar Sep 16 '22 13:09 derSascha