{"name":"css-mediaquery","version":"0.0.0","description":"Parses and determines if a given CSS Media Query matches a set of values.","main":"index.js","scripts":{"test":"node_modules/.bin/mocha -R spec"},"repository":{"type":"git","url":"git://github.com/ericf/css-media-match.git"},"keywords":["css","media","query","parse","match"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"license":"BSD","bugs":{"url":"https://github.com/ericf/css-media-match/issues"},"homepage":"https://github.com/ericf/css-media-match","devDependencies":{"mocha":"~1.16.2","chai":"~1.8.1"},"_id":"css-mediaquery@0.0.0","dist":{"shasum":"a02506690a519ecf1a7350514a29000b63bcef28","tarball":"http://registry-npm.ywwl.com/css-mediaquery/download/css-mediaquery-0.0.0.tgz","integrity":"sha512-EFGZyKZ395pWMtEutobsPwqhTcjJcl0MXVMX41vJ78wW7iexWVdZFylUKCXLO4bJdKrkgSVF+ZvJXJTNZGC0pw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKul5Zyz2nyzO428zqCsZmBUBPXi3RifVLH+zVxrVF1AIhAILtv4vc38vpcxqW52Ko5lDu60WGp5YVOW7+jMkjTmBt"}],"size":2883,"noattachment":false,"key":"/css-mediaquery/-/css-mediaquery-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"directories":{},"readme":"CSS Media Query\n===============\n\n[![Build Status](https://travis-ci.org/ericf/css-mediaquery.png?branch=master)](https://travis-ci.org/ericf/css-mediaquery)\n[![Dependency Status](https://gemnasium.com/ericf/css-mediaquery.png)](https://gemnasium.com/ericf/css-mediaquery)\n[![npm Version](https://badge.fury.io/js/css-mediaquery.png)](https://npmjs.org/package/css-mediaquery)\n\nParses and determines if a given CSS Media Query matches a set of values via\nJavaScript.\n\nInstallation\n------------\n\nInstall via npm:\n\n```shell\n$ npm install css-mediaquery\n```\n\nUsage\n-----\n\nThis package has two exports: `parse()`, and `match()` which can parse CSS Media\nQueries and determine if a media query matches a given set of values.\n\n### Matching\n\nThe `match()` method lets you compare a media query expression with a JavaScript\nobject and determine if a media query matches a given set of values.\n\n```javascript\nvar mediaQuery = require('css-mediaquery');\n\nvar isMatch = mediaQuery.match('screen and (min-width: 40em)', {\n    type : 'screen',\n    width: '1024px'\n});\n\nconsole.log(isMatch); // => true\n```\n\nThe values specified to check a media query string against should be thought of\nas if they are the current state of a device/browser. A `type` value _must_ be\nspecified, and it can _not_ be `\"all\"`.\n\n### Parsing\n\nExisting CSS Parsers don't do a great job at parsing the details of media\nqueries. That's where `css-mediaquery` shines. You can parse a media query\nexpression and get an AST back by using the `parse()` method.\n\n```javascript\nvar mediaQuery = require('css-mediaquery'),\n    ast        = mediaQuery.parse('screen and (min-width: 48em)');\n```\n\nThe `ast` variable will have the following payload:\n\n```javascript\n[\n    {\n        inverse: false,\n        type   : 'screen',\n\n        expressions: [\n            {\n                modifier: 'min',\n                feature : 'width',\n                value   : '48em'\n            }\n        ]\n    }\n]\n```\n\nThis package was written with care to following the W3C Recommendations for\n[CSS3 Media Queries][w3c-mq] and [CSS3 Values and Units][w3c-vu]. It supports\nall of the [Media Features][w3c-mq-features] and will properly convert values to\na common unit before comparing them.\n\n\n[w3c-mq]: http://www.w3.org/TR/css3-mediaqueries/\n[w3c-mq-features]: http://www.w3.org/TR/css3-mediaqueries/#media1\n[w3c-vu]: http://www.w3.org/TR/css3-values/\n\n\nLicense\n-------\n\nThis software is free to use under the Yahoo! Inc. BSD license.\nSee the [LICENSE file][] for license text and copyright information.\n\n\n[LICENSE file]: https://github.com/ericf/css-mediaquery/blob/master/LICENSE\n","publish_time":1389212954300,"_cnpm_publish_time":1389212954300,"dist-tags":{"latest":"0.1.2"}}