{"id":19653041,"url":"https://github.com/csstools/postcss-unmq","last_synced_at":"2025-04-28T17:31:15.631Z","repository":{"id":57328596,"uuid":"41424650","full_name":"csstools/postcss-unmq","owner":"csstools","description":"Remove media queries from CSS while preserving rules that match a hard-coded viewport","archived":true,"fork":false,"pushed_at":"2017-01-08T00:50:46.000Z","size":10,"stargazers_count":37,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-21T21:38:20.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-26T12:37:34.000Z","updated_at":"2024-12-28T18:55:40.000Z","dependencies_parsed_at":"2022-09-21T02:31:57.155Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-unmq","commit_stats":null,"previous_names":["jonathantneal/postcss-unmq"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-unmq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251218983,"owners_count":21554442,"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":[],"created_at":"2024-11-11T15:12:59.772Z","updated_at":"2025-04-28T17:31:15.584Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnMQ [![Build Status][ci-img]][ci]\n\n\u003cimg align=\"right\" width=\"135\" height=\"95\" src=\"http://postcss.github.io/postcss/logo-leftp.png\" title=\"Philosopher’s stone, logo of PostCSS\"\u003e\n\n[UnMQ] removes media queries from CSS while preserving rules that match a hard-coded viewport. This can be useful for outputting desktop CSS for older browsers like Internet Explorer 8.\n\n```css\n/* before */\n\nbody {\n    font-size: 12px;\n}\n\n@media screen and (max-width: 767px) {\n    body {\n        font-size: 16px;\n    }\n}\n\n@media screen and (min-width: 768px) {\n    body {\n        color: #444;\n    }\n}\n\n/* after */\n\nbody {\n    font-size: 12px;\n}\n\nbody {\n    color: #444;\n}\n```\n\n## Usage\n\nAdd [UnMQ] to your build tool:\n\n```bash\nnpm install postcss-unmq --save-dev\n```\n\n#### Node\n\n```js\nrequire('postcss-unmq')({ /* options */ }).process(YOUR_CSS);\n```\n\n#### PostCSS\n\nAdd [PostCSS] to your build tool:\n\n```bash\nnpm install postcss --save-dev\n```\n\nLoad [UnMQ] as a PostCSS plugin:\n\n```js\npostcss([\n    require('postcss-unmq')({ /* options */ })\n]);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nEnable [UnMQ] within your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n    return gulp.src('./css/src/*.css').pipe(\n        postcss([\n            require('postcss-unmq')({ /* options */ })\n        ])\n    ).pipe(\n        gulp.dest('./css')\n    );\n});\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\nEnable [UnMQ] within your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n    postcss: {\n        options: {\n            processors: [\n                require('postcss-unmq')({ /* options */ })\n            ]\n        },\n        dist: {\n            src: 'css/*.css'\n        }\n    }\n});\n```\n\n## Options\n\nYou can define your own viewport for media queries to be evaluated against. Think of the options as the current state of a device and browser.\n\n```js\nrequire('postcss-unmq')({\n    // these are already the default options\n    type: 'screen',\n    width: 1024,\n    height: 768,\n    resolution: '1dppx',\n    color: 3\n})\n```\n\nIf it’s not defined, `device-width` will be given the value of `width`, and `device-height` will be given the value of `height`. Similarly, `aspect-ratio` will be given the value of `device-width` divided by `device-height`.\n\n[ci]: https://travis-ci.org/jonathantneal/postcss-unmq\n[ci-img]: https://travis-ci.org/jonathantneal/postcss-unmq.svg\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n[PostCSS]: https://github.com/postcss/postcss\n[UnMQ]: https://github.com/jonathantneal/postcss-unmq\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-unmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-unmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-unmq/lists"}