PostCSS plugin for simplifying media queries by removing redundant parts of the media description. Installation
npm install postcss-simplify-media-queries --save-devimport postcss from 'postcss';
import simplifyMediaQueries from 'postcss-simplify-media-queries';
const css = `
@media (min-width: 200px) and (min-width: 400px) {
/* styles here */
}
`;
postcss([simplifyMediaQueries])
.process(css)
.then((result) => {
console.log(result.css);
});Consider the following input:
@media (min-width: 200px) and (min-width: 400px) {
/* styles here */
}After applying the postcss-simplify-media-queries plugin, the output will be:
@media (min-width: 400px) {
/* styles here */
}This plugin doens’t support any options at the moment
To run the provided tests for this plugin, use the following command:
npm testFeel free to contribute to this project. Bug reports, feature requests, and pull requests are welcome. Please follow the contribution guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.