{"id":16927740,"url":"https://github.com/diegomura/media-engine","last_synced_at":"2026-03-14T13:42:18.268Z","repository":{"id":46180995,"uuid":"123077923","full_name":"diegomura/media-engine","owner":"diegomura","description":"Media queries engine written in pure JS!","archived":false,"fork":false,"pushed_at":"2021-11-09T03:50:18.000Z","size":48,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T13:46:01.679Z","etag":null,"topics":["engine","media","media-queries","media-query"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diegomura.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T05:32:54.000Z","updated_at":"2025-03-14T15:20:36.000Z","dependencies_parsed_at":"2022-09-08T10:13:35.374Z","dependency_job_id":null,"html_url":"https://github.com/diegomura/media-engine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegomura%2Fmedia-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegomura%2Fmedia-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegomura%2Fmedia-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegomura%2Fmedia-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diegomura","download_url":"https://codeload.github.com/diegomura/media-engine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248451788,"owners_count":21105939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["engine","media","media-queries","media-query"],"created_at":"2024-10-13T20:34:58.956Z","updated_at":"2026-03-14T13:42:18.228Z","avatar_url":"https://github.com/diegomura.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# media-engine\n\u003e Media queries engine written in pure JS!\n\n[![npm](https://img.shields.io/npm/v/media-engine.svg)](https://npm.im/media-engine)\n[![Travis](https://img.shields.io/travis/diegomura/media-engine.svg)](https://travis-ci.org/diegomura/media-engine)\n[![license](https://img.shields.io/npm/l/media-engine.svg)](./LICENSE)\n\n## Install\n```sh\nnpm install media-engine --save\n# or\nyarn add media-engine\n```\n\n## API\n`min-height`\n```js\nmatchMedia(\n  {\n    '@media min-height: 700': {\n      color: 'green',\n    },\n  },\n  { height: 800 }\n);\n// { color: 'green' }\n\nmatchMedia(\n  {\n    '@media min-height: 700': {\n      color: 'green',\n    },\n  },\n  { height: 100 }\n);\n// { }\n```\n\n`max-height`\n```js\nmatchMedia(\n  {\n    '@media max-height: 700': {\n      color: 'green',\n    },\n  },\n  { height: 100 }\n);\n// { color: 'green' }\n\nmatchMedia(\n  {\n    '@media max-height: 700': {\n      color: 'green',\n    },\n  },\n  { height: 800 }\n);\n// { }\n```\n\n`min-width`\n```js\nmatchMedia(\n  {\n    '@media min-width: 700': {\n      color: 'green',\n    },\n  },\n  { width: 800 }\n);\n// { color: 'green' }\n\nmatchMedia(\n  {\n    '@media min-width: 700': {\n      color: 'green',\n    },\n  },\n  { width: 100 }\n);\n// { }\n```\n\n`max-width`\n```js\nmatchMedia(\n  {\n    '@media max-width: 700': {\n      color: 'green',\n    },\n  },\n  { width: 100 }\n);\n// { color: 'green' }\n\nmatchMedia(\n  {\n    '@media max-width: 700': {\n      color: 'green',\n    },\n  },\n  { width: 800 }\n);\n// { }\n```\n\n`orientation`\n```js\nmatchMedia(\n  {\n    '@media orientation: landscape': {\n      color: 'green',\n    },\n  },\n  { orientation: 'landscape' }\n);\n// { color: 'green' }\n\nmatchMedia(\n  {\n    '@media orientation: landscape': {\n      color: 'green',\n    },\n  },\n  { orientation: 'portrait' }\n);\n// { }\n```\n\n`and operator`\n```js\nmatchMedia(\n  {\n    '@media (min-width: 700) and (orientation: landscape)': {\n      color: 'green',\n    },\n  },\n  { width: 800, orientation: 'landscape' }\n);\n// { color: 'green' }\n```\n\n`or operator`\n```js\nmatchMedia(\n  {\n    '@media (min-width: 700), (orientation: landscape)': {\n      color: 'green',\n    },\n  },\n  { orientation: 'landscape' }\n);\n// { color: 'green' }\n```\n\n`multiple queries`\n```js\nmatchMedia(\n  {\n    '@media orientation: landscape': {\n      color: 'green',\n    },\n    '@media min-width: 700': {\n      background: 'red',\n    }\n  },\n  { orientation: 'landscape', width: 800 }\n);\n// { color: 'green', background: 'red' }\n```\n\n## License\nMIT © [Diego Muracciole](http://github.com/diegomura)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegomura%2Fmedia-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiegomura%2Fmedia-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegomura%2Fmedia-engine/lists"}