2.0.1 • Published 2 years ago

postcss-mq-optimize v2.0.1

Weekly downloads
202
License
MIT
Repository
github
Last release
2 years ago

PostCSS Mq Optimize Build Status

Build Status

PostCSS plugin Removes invalid media queries or its expressions.

/* Input example */
@media (min-width: 200px) and (max-width: 300px) {
  .foo {}
}
@media (min-width: 200px) and (max-width: 300px) and (min-width: 100px) {
  .bar {}
}
@media (min-width: 200px) and (max-width: 300px) and (min-width: 200px) {
  .baz {}
}
@media (min-width: 200px) and (max-width: 300px) and (max-width: 100px) {
  .qux {}
}
@media screen and (max-width: 300px), (max-width: 200px) {
  .quux {}
}
/* Output example */
@media (min-width: 200px) and (max-width: 300px) {
  .foo {}
}
@media (min-width: 200px) and (max-width: 300px) {
  .bar {}
}
@media (min-width: 200px) and (max-width: 300px) {
  .baz {}
}
@media screen and (max-width: 300px), (max-width: 200px) {
  .quux {}
}

Usage

postcss([ require('postcss-mq-optimize') ])

See PostCSS docs for examples for your environment.