{"id":2399264,"url":"https://paranoida.github.io/sass-mediaqueries","last_synced_at":"2025-07-21T19:30:40.051Z","repository":{"id":45743722,"uuid":"5462597","full_name":"rafalbromirski/sass-mediaqueries","owner":"rafalbromirski","description":"Media Queries mixins for Sass - fully customizable and very easy to use.","archived":false,"fork":false,"pushed_at":"2018-03-28T07:16:27.000Z","size":179,"stargazers_count":1264,"open_issues_count":12,"forks_count":162,"subscribers_count":59,"default_branch":"master","last_synced_at":"2024-04-13T21:17:45.827Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rafalbromirski.github.com/sass-mediaqueries/","language":"CSS","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/rafalbromirski.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":"2012-08-18T12:42:21.000Z","updated_at":"2024-03-14T14:27:19.000Z","dependencies_parsed_at":"2022-08-31T09:41:54.345Z","dependency_job_id":null,"html_url":"https://github.com/rafalbromirski/sass-mediaqueries","commit_stats":null,"previous_names":["paranoida/sass-mediaqueries"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalbromirski%2Fsass-mediaqueries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalbromirski%2Fsass-mediaqueries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalbromirski%2Fsass-mediaqueries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalbromirski%2Fsass-mediaqueries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafalbromirski","download_url":"https://codeload.github.com/rafalbromirski/sass-mediaqueries/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226888096,"owners_count":17698109,"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-01-24T05:38:32.977Z","updated_at":"2024-11-28T18:31:03.198Z","avatar_url":"https://github.com/rafalbromirski.png","language":"CSS","funding_links":[],"categories":["Libraries and Mixins"],"sub_categories":["Media Queries"],"readme":"# sass-mediaqueries\n\nIt's a collection of useful **Media Queries** mixins for **Sass** (including iOS devices, TVs and more). Fully customizable and very easy to use.\n\n#### Online: \u003chttp://rafalbromirski.github.com/sass-mediaqueries\u003e\n#### Demo: \u003chttp://rafalbromirski.github.com/sass-mediaqueries/demo.html\u003e\n\n### How to install:\n\nUsing **bower**:\n\n```\nbower install sass-mediaqueries\n```\n\nUsing **npm**:\n\n```\nnpm install sass-mediaqueries\n```\n\nUsing **curl**:\n\n```\ncurl -O https://raw.githubusercontent.com/rafalbromirski/sass-mediaqueries/master/_media-queries.scss\n```\n\nThen, at the top of your sass/scss file (ie. `application.scss`) add:\n\n```scss\n@import \"media-queries\";\n```\n\n## Doc:\n\n#### Generator (v1.6.0):\n\n```\nmq($args...)\n```\n\nGenerator allows you to create custom media-queries mixins by passing [**keywords arguments**](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#keyword_arguments) based on w3c [**media features**](http://www.w3.org/TR/css3-mediaqueries/#media1) specification (make sure you always provide key and value).\n\nIt's also a syntactic sugar for the standard media queries [syntax](http://www.w3.org/TR/css3-mediaqueries/#media0) (CSS).\n\n**Examples**:\n\n```scss\n@include mq($max-width: 1000px) {\n  ...\n}\n\n// will generate\n\n@media only screen and (max-width: 1000px) {\n  ...\n}\n```\n\nCreating new mixins (like `max-screen`) is even easier:\n\n```scss\n@mixin max-screen($max)\n  @include mq($max-width: $max) {\n    @content;\n  }\n}\n\n// usage\n\n@include max-screen(1000px) {\n  ...\n}\n\n// will generate\n\n@media only screen and (max-width: 1000px) {\n  ...\n}\n```\n\nOr if you want to change `$media-type` and other properies:\n\n```scss\n@mixin custom-device($min, $max)\n  @include mq($media-type: 'all', $min-width: $min, $max-width: $max) {\n    @content;\n  }\n}\n\n// usage\n\n@include custom-device(500px, 1000px) {\n  ...\n}\n\n// will generate\n\n@media all and (min-width: 500px) and (max-width: 1000px) {\n  ...\n}\n```\n\nHow cool is that?\n\n---\n\n#### Other Mixins:\n\n```\n@  screen(min-width, max-width, orientation)\n@  min-screen(width)\n@  max-screen(width)\n--\n@  screen-height(min-height, max-height, orientation)\n@  min-screen-height(height)\n@  max-screen-height(height)\n--\n@  hdpi(ratio)\n--\n@  landscape\n@  portrait\n--\n@  iphone4(orientation)\n@  iphone5(orientation)\n@  iphone6(orientation)\n@  iphone6-plus(orientation)\n--\n@  ipad(orientation)\n@  ipad-retina(orientation)\n--\n@  hdtv(standard)\n```\n\n---\n\n#### - screen($min-width, $max-width, $orientation: false)\n\nIt targets group of devices or just one with particular screen width and orientation (optional).\n\n###### # Example:\n\n```scss\n@include screen(320px, 640px) { ... }\n@include screen(768px, 1024px, landscape) { ... }\n```\n\nIt will be compiled to:\n\n```css\n@media screen and (min-width: 768px) and (max-width: 1280px) { ... }\n@media screen and (min-width: 320px) and (max-width: 640px) and (orientation: landscape) { ... }\n```\n\n#### - min-screen($width)\n\nIt's a shortcut for `@media screen and (min-width ... )`\n\n###### # Example:\n\n```scss\n@include min-screen(768px) { ... }\n@include min-screen(1024px) { ... }\n```\n\nIt will be compiled to:\n\n```css\n@media screen and (min-width: 768px) { ... }\n@media screen and (min-width: 1024px) { ... }\n```\n\n\n#### - max-screen($width)\n\nIt's a shortcut for `@media screen and (max-width ... )`\n\n###### # Example:\n\n```scss\n@include max-screen(1024px) { ... }\n@include max-screen(768px) { ... }\n```\n\nIt will be compiled to:\n\n```css\n@media screen and (max-width: 1024px) { ... }\n@media screen and (max-width: 768px) { ... }\n```\n\n---\n\n#### - screen-height($min-height, $max-height, $orientation: false)\n\nIt targets group of devices or just one with particular screen height and orientation (optional).\n\n###### # Example:\n\n```scss\n@include screen-height(640px, 768px) { ... }\n@include screen-height(640px, 768px, landscape) { ... }\n```\n\nIt will be compiled to:\n\n```css\n@media screen and (min-height: 768px) and (max-height: 1280px) { ... }\n@media screen and (min-height: 768px) and (max-height: 1280px) and (orientation: landscape) { ... }\n```\n\n#### - min-screen-height($width)\n\nIt's a shortcut for `@media screen and (min-height ... )`\n\n###### # Example:\n\n```scss\n@include min-screen-height(768px) { ... }\n@include min-screen-height(1024px) { ... }\n```\n\nIt will be compiled to:\n\n```css\n@media screen and (min-height: 768px) { ... }\n@media screen and (min-height: 1024px) { ... }\n```\n\n\n#### - max-screen-height($width)\n\nIt's a shortcut for `@media screen and (max-height ... )`\n\n###### # Example:\n\n```scss\n@include max-screen-height(1024px) { ... }\n@include max-screen-height(768px) { ... }\n```\n\nIt will be compiled to:\n\n```css\n@media screen and (max-height: 1024px) { ... }\n@media screen and (max-height: 768px) { ... }\n```\n\n---\n\n#### - hdpi($ratio: 1.3)\n\nIt targets devices with hdpi display.\n\n###### # Example:\n\n```scss\n.brand {\n\tbackground-image: url(logo.png);\n\n\t@include hdpi {\n\t\tbackground-image: url(logo_2x.png);\n\t}\n}\n```\n\n---\n\n#### - landscape() \u0026 portrait()\n\nBoth mixins target different screen orientations.\n\n###### # Example:\n\n```scss\n@include landscape { ... }\n@include portrait { ... }\n```\n\nIt will be compiled to:\n\n```css\n@media screen and (orientation: landscape) { ... }\n@media screen and (orientation: portrait) { ... }\n```\n\n---\n\n```\n$orientation: all | portrait | landscape\n```\n\n#### - iphone4($orientation: all)\n\nIt targets only **iPhone 4** + orientation\n\n#### - iphone5($orientation: all)\n\nIt targets only **iPhone 5** + orientation\n\n#### - iphone6($orientation: all)\n\nIt targets only **iPhone 6** + orientation\n\n#### - iphone6-plus($orientation: all)\n\nIt targets only **iPhone 6 Plus** + orientation\n\n#### - ipad($orientation: all)\n\nIt targets all **iPads** + orientation\n\n#### - ipad-retina($orientation: all)\n\nIt targets only **iPads with retina** display + orientation\n\n###### # Example:\n\n```scss\n@include ipad { ... }                 // all iPads\n@include ipad-retina { ... }          // only iPad with retina\n\n@include iphone5 { ... }              // only iPhone 5\n@include iphone4 { ... }              // only iPhone 4/4S\n```\n\n###### # Example:\n\n```scss\n// common part for iPhone 5 - landscape \u0026 portrait\n@include iphone5 { ... }\n\n@include iphone5(landscape) { ... }\n@include iphone5(portrait) { ... }\n```\n\n---\n\n```\n$standard: '720p' | '1080' | '2K' | '4K'\n```\n\n#### - hdtv($standard: '1080')\n\nIt targets TVs with particular standard like `1080` or `4K`\n\n###### # Example:\n```scss\n.title {\n\tfont-size: 5vm;\n\n\t@include hdtv {\n\t\tfont-size: 10vm;\n\t}\n\n\t@include hdtv('4K') {\n\t\tfont-size: 15vm;\n\t}\n}\n```\n\n---\n\n### Credits:\n\nFeel free to check my \u003ca href=\"http://rafalbromirski.com\"\u003ewebsite\u003c/a\u003e or follow me on \u003ca href=\"https://twitter.com/rafalbromirski\"\u003etwitter\u003c/a\u003e.\n\n---\n\n### License:\n\nThe MIT license\n\nCopyright \u0026copy; 2015 [Rafal Bromirski](http://rafalbromirski.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/paranoida.github.io%2Fsass-mediaqueries","html_url":"https://awesome.ecosyste.ms/projects/paranoida.github.io%2Fsass-mediaqueries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/paranoida.github.io%2Fsass-mediaqueries/lists"}