Export mediaqueries that match provided max page width
npm install no-media-queriesExport the css without mediaqueries matching maximum page width.
This library can be used when you cant use respond.js, so you can have separated stylesheet for non responsive layout for IE8.
Also avaiable as gulp/grunt plugin.
Download manually or with a package-manager.
#### npm
``bash`
npm install --save no-media-queries
`bash`
nmq(css, options, reworkOptions);$3
You can also use it as a CLI app by installing it globally:
`bash`
npm install --global no-media-queries
`bash
$ nmq --help
Usage:
$ nmq
Example:
$ nmq responsive.css > non-responsive.css
Custom options: (options with one dash, reworkOptions with two dashes)
$ nmq responsive.css > non-responsive.css -width=200px --compress=true
`
This library will export all the relevant css rules form your css that match proper mediaquery breakpoint passed in.
If we have css like this:
`css`
a{
color: blue;
}
@media all and (min-width: 500px){
a{
color: red;
}
}
Running:
`javascript`
nmq(fs.readFileSync('responsive.css'), {width: 600px});
Will result in:
`css`
a{
color: red;
}
So we can have in our head css stylesheets like this:
`html`
Where no-responsive.css will be output from no-media-queries libarry.
Type: String or Buffer
Css to parse.
#### width
Type: String
Default: '10000px'
Breakpoint for our page width which should match mediaqueries.
#### type
Type: String`
Default: 'all'
Type of device.
MIT © Daniel Husar