{"id":19240845,"url":"https://github.com/matviyroman/resass","last_synced_at":"2026-05-16T09:34:34.576Z","repository":{"id":65489166,"uuid":"272183377","full_name":"MatviyRoman/resass","owner":"MatviyRoman","description":"Mixins for checking device by width and height (width, min-width, max-width, height, min-height, max-height) or group of devices (mobile, tablet, laptop, desktop) or device by name (iPhone 5, iPhone X, iPhone 11 Pro Max, iPad Pro 12.9, etc). Expandable and very simple for usage.","archived":false,"fork":false,"pushed_at":"2021-07-25T10:38:41.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T02:36:50.786Z","etag":null,"topics":["css","frontend","media-queries","mq","resass","sass","sass-mediascreen","scss","scss-mediascreen"],"latest_commit_sha":null,"homepage":"https://resass.matviy.pp.ua","language":"SCSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatviyRoman.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-14T10:55:43.000Z","updated_at":"2021-07-25T10:46:15.000Z","dependencies_parsed_at":"2023-01-25T16:55:12.174Z","dependency_job_id":null,"html_url":"https://github.com/MatviyRoman/resass","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatviyRoman%2Fresass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatviyRoman%2Fresass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatviyRoman%2Fresass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatviyRoman%2Fresass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatviyRoman","download_url":"https://codeload.github.com/MatviyRoman/resass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240326576,"owners_count":19783873,"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":["css","frontend","media-queries","mq","resass","sass","sass-mediascreen","scss","scss-mediascreen"],"created_at":"2024-11-09T17:09:11.521Z","updated_at":"2026-05-16T09:34:34.543Z","avatar_url":"https://github.com/MatviyRoman.png","language":"SCSS","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=E2H8329XLYRKQ\u0026source=url","https://www.paypal.com/cgi-bin/webscr","https://www.paypal.com/en_UA/i/scr/pixel.gif"],"categories":[],"sub_categories":[],"readme":"# resass [![NPM version](https://img.shields.io/npm/v/resass.svg?style=flat)](https://www.npmjs.com/package/resass) [![NPM monthly downloads](https://img.shields.io/npm/dm/resass.svg?style=flat)](https://npmjs.org/package/resass) [![NPM total downloads](https://img.shields.io/npm/dt/resass.svg?style=flat)](https://npmjs.org/package/resass) [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=E2H8329XLYRKQ\u0026source=url)\n\n##sass media queries mixin\n\n- [Getting started](#getting-started)\n  - [Install](#install)\n  - [Download](#download)\n- [Usage](#usage)\n- [Documentation](#documentation)\n  - [Include](#include)\n  - [Examples](#examples)\n    - [Full include](#full-include)\n    - [Short include](#short-include)\n  - [List of supported devices](#list-of-supported-devices)\n    - [Groups](#groups)\n    - [Phones](#phones)\n    - [Tablets](#tables)\n    - [Laptops](#laptops)\n  - [Expanding the list of devices](#expanding-the-list-of-devices)\n- [Demo](#demo)\n  - [Helpful links](#helpful-links)\n    - [Important](#important)\n- [About](#about)\n  - [Contributing](#contributing)\n  - [Release](#relese-history)\n  - [Credits](#credits)\n  - [License](#license)\n- [Donate](#donate)\n\n## Getting started\n\n### Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install resass\n```\n\nInstall with [github](https://github.com):\n\n```sh\n$ git clone https://github.com/MatviyRoman/resass.git\n```\n\nInstall with [curl](https://matviy.pp.ua):\n\n```sh\n$ curl -O https://raw.githubusercontent.com/MatviyRoman/resass/master/mq.scss\n```\n\n### Download\n\n[download](https://github.com/matviyroman/resass/archive/master.zip)\n\n## Usage\n\n1. Include resass to app:\n\n```scss\n@import \"resass/r\";\n```\n\nor\n\n```scss\n@import \"resass/mq\";\n```\n\n## Documentation\n\nMixins for checking **device by width and height** (width, min-width, max-width, height, min-height, max-height) or **group of devices** (mobile, tablet, laptop, desktop) or **device by name** (iPhone 5, iPhone X, iPhone 11 Pro Max, iPad Pro 12.9, etc). Expandable and very simple for usage.\n\n### Include\n\n#### Full include\n\nBefore\n\n```scss\n1) @include screen()\n2) @include min-screen()\n3) @include max-screen()\n4) @include height()\n5) @include min-screen-height()\n6) @include max-screen-height()\n7) @include landscape()\n8) @include portrait()\n```\n\nAfter\n\n```css\n1) @media only screen and (min-width: width) and (max-width: width)\n2) @media only screen and (min-width: width)\n3) @media only screen and (max-width: width)\n4) @media only screen and (min-height: height) and (max-height: height)\n5) @media only screen and (min-height: height)\n6) @media only screen and (max-height: height)\n7) @media only screen and (orientation: landscape)\n8) @media only screen and (orientation: portrait)\n```\n\n#### Short include\n\nBefore\n\n```scss\n1) @include s()\n2) @include smin()\n3) @include smax()\n4) @include h()\n5) @include hmin()\n6) @include hmax()\n7) @include l()\n8) @include p()\n```\n\nAfter\n\n```css\n1) @media only screen and (min-width: width) and (max-width: width)\n2) @media only screen and (min-width: width)\n3) @media only screen and (max-width: width)\n4) @media only screen and (min-height: height) and (max-height: height)\n5) @media only screen and (min-height: height)\n6) @media only screen and (max-height: height)\n7) @media only screen and (orientation: landscape)\n8) @media only screen and (orientation: portrait)\n```\n\n### Examples:\n\nIt can be used like this:\n\nscss\n\n```scss\n@include screen(min-width, max-width, orientation) {\n  /*...*/\n}\n@include s(min-width, max-width, orientation) {\n  /*...*/\n}\n```\n\nBefore:\n\n```css\n@include screen(320px, 768px, portrait) {\n  /*...*/\n}\n@include s(0, 768px, l) {\n  /*...*/\n}\n```\n\nAfter:\n\n```css\n@media only screen and (min-width: 320px) and (max-width: 768px) and (orientation: portrait) {\n  /*...*/\n}\n@media only screen and (max-width: 768px) and (orientation: landscape) {\n  /*...*/\n}\n```\n\nOr like this:\n\n```scss\n@include device(iPhone5, portrait) {\n  // portrait orientation\n  // iPhone 5, iPhone 5s, iPhone 5c, iPhone SE\n}\n@include device(iPhone6Plus iPhoneXR, landscape) {\n  // landscape orientation\n  // iPhone 6+, iPhone 6s+, iPhone 7+, iPhone 8+, iPhone XR, iPhone 11\n}\n@include device(iPadPro10 iPadPro11 iPadPro12) {\n  // all orientations\n  // iPad Pro 10.5, iPad Pro 11, iPad Pro 12.9\n}\n```\n\nOr like this:\n\n```scss\n@include device(desktop) {\n  // all orientations\n  // desktop\n}\n@include device(mobile tablet laptop, landscape) {\n  // landscape orientation\n  // mobile, tablet, laptop\n}\n```\n\nOr even like this:\n\n```scss\n@include device(mobile-landscape tablet laptop) {\n  // landscape orientation\n  // mobile\n\n  // all orientations\n  // tablet, laptop\n}\n@include device(mobile-landscape tablet laptop, portrait) {\n  // landscape orientation\n  // mobile\n\n  // portrait orientation\n  // tablet, laptop\n}\n```\n\nBefore\n\n```scss\n@include s(325px, 0) {\n  /*...*/\n}\n```\n\nAfter\n\n```css\n@media only screen and (min-width: 325px) {\n  /*...*/\n}\n```\n\nBefore\n\n```scss\nBefore @include s(0, 325px) {\n  /*...*/\n}\n```\n\nAfter\n\n```css\n@media only screen and (max-width: 325px) {\n  /*...*/\n}\n```\n\nThere are also common mixins:\n\n```scss\n@include screen(min-width, max-width, orientation) {\n  /*...*/\n}\n@include screen(min-width, max-width, orientation) {\n  /*...*/\n}\n@include min-screen(width, orientation) {\n  /*...*/\n}\n@include max-screen(width, orientation) {\n  /*...*/\n}\n@include screen-height(min-height, max-height, orientation) {\n  /*...*/\n}\n@include min-screen-height(height, orientation) {\n  /*...*/\n}\n@include max-screen-height(height, orientation) {\n  /*...*/\n}\n```\n\nOrientations:\n\n```scss\n@include landscape() {\n  /*...*/\n}\n@include portrait() {\n  /*...*/\n}\n```\n\n### List of supported devices:\n\n#### Groups\n\n- Mobiles 320-767px `mobile` `mobile-portrait` `mobile-landscape`\n- Tablets 768-1023px `tablet` `tablet-portrait` `tablet-landscape`\n- Laptops 1024-1199px `laptop` `laptop-portrait` `laptop-landscape`\n- Desktop \u003e=1200px `desktop` `desktop-portrait` `desktop-landscape`\n\n#### Phones\n\n- iPhone 5, 5s, 5c, SE `iphone5` `iphone5s` `iphone5c` `iphonese`\n- iPhone 6, 6s, 7, 8 `iphone6` `iphone6s` `iphone7` `iphone8`\n- iPhone 6+, 6s+, 7+, 8+ `iphone6plus` `iphone6splus` `iphone7plus` `iphone8plus`\n- iPhone X, XS, 11 Pro `iphonex` `iphonexs` `iphone11pro`\n- iPhone XR, 11 `iphonexr` `iphone11`\n- iPhone XS Max, 11 Pro Max `iphonexsmax` `iphone11promax`\n\n#### Tablets\n\n- iPad 1, 2, Mini, Air `ipad1` `ipad2` `ipadmini` `ipadair`\n- iPad 3, 4, Pro 9.7\" `ipad3` `ipad4` `ipadpro9`\n- iPad Pro 10.5\" `ipadpro10`\n- iPad Pro 11.0\" `ipadpro11`\n\n#### Laptops\n\n- iPad Pro 12.9\" `ipadpro12`\n\n_Well, Yes. iPad Pro 12.9\" is a laptop because of its size._\n\n---\n\n### Expanding the list of devices:\n\nYou can add support for custom devices or group of devices without editing the source.\nBefore `@import \"resass/mq\"`, you must specify `$ms-devices` variable with a list of additional devices:\n\n```scss\n$ms-devices: (\n  desktop-sm: (\n    group: true,\n    // group of devices\n      min: 1200px,\n    max: 1919px\n  ),\n  desktop-md: (\n    group: true,\n    // group of devices\n      min: 1920px,\n    max: 2879px\n  ),\n  desktop-lg: (\n    group: true,\n    // group of devices\n      min: 2880px\n  ),\n  pixel2xl: (\n    group: false,\n    // specific device\n      width: 411px,\n    // or 412px?..\n      height: 823px,\n    pixel-ratio: 3.5\n  ),\n  macbook12: (\n    group: false,\n    // specific device\n      orientation: landscape,\n    width: 1440px,\n    height: 900px,\n    pixel-ratio: 2\n  ),\n  imac27: (\n    group: false,\n    // specific device\n      orientation: landscape,\n    width: 5120px,\n    height: 2880px\n  )\n);\n```\n\n## Demo\n\n### Helpful Links\n\n- [Demo 1](http://scss-mq-mix.matviy.pp.ua)\n- [Demo 2](http://resass.matviy.pp.ua)\n\n### Important\n\n\u003e Don't check the adaptability in the browser DevTools, there are [incorrectly calculated dimensions](https://codepen.io/matviy/pen/ZEQOrmv) of the sides in the landscape orientation of the device.\n\u003e It is better to check on a real device or in a simulator (for example, xCode Simulator).\n\n\u003e Use [group-css-media-queries](https://github.com/Se7enSky/group-css-media-queries) to optimize media queries. Without it, a lot of the same `@media ...` code is generated, especially if for the sake of convenience to use the mixin `@include device()` in each selector separately. Wrapper for Gulp - [gulp-group-css-media-queries](https://github.com/avaly/gulp-group-css-media-queries).\n\n## About\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Relese History\n\n| **DATE**   | **VERSION** | **CHANGES**                                        |\n| ---------- | ----------- | -------------------------------------------------- |\n| 2020-06-20 | v1.0.5      | Fix error                                          |\n| 2020-06-18 | v1.0.4      | Add short include                                  |\n| 2020-06-15 | v1.0.3      | Fix error                                          |\n| 2020-06-10 | v1.0.2      | Fix error                                          |\n| 2020-06-3  | v1.0.1      | Fix [#fix](https://github.com/romanmatviy/resass/) |\n| 2020-06-1  | v1.0.0      | upload                                             |\n\n### Credits\n\n**Roman Matviy**\n\n- [GitHub Profile](https://github.com/matviyroman)\n- [LinkedIn Profile](https://linkedin.com/in/romanmatviy)\n- [Portfolio Profile](https://matviy.pp.ua)\n- [Resume Profile](https://roman.matviy.pp.ua)\n\n### License\n\nCopyright © 2020, [Roman Matviy](https://github.com/matviyroman).\n\nReleased under the [MIT License](LICENSE).\n\n## Donate\n\nBuy me a coffee :)\n\nQR Code\n\n\u003cimg src=\"https://github.com/MatviyRoman/resass/blob/master/img/qr-code.png?raw=true\" alt=\"donation resass media queries\"\u003e\n\nOr PayPall\n\n[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=E2H8329XLYRKQ\u0026source=url)\n\n\u003cform action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_top\"\u003e\n\u003cinput type=\"hidden\" name=\"cmd\" value=\"_s-xclick\" /\u003e\n\u003cinput type=\"hidden\" name=\"hosted_button_id\" value=\"E2H8329XLYRKQ\" /\u003e\n\u003cinput type=\"image\" src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif\" name=\"submit\" title=\"PayPal - The safer, easier way to pay online!\" alt=\"Donate with PayPal button\" /\u003e\n\u003cimg alt=\"\" src=\"https://www.paypal.com/en_UA/i/scr/pixel.gif\" width=\"1\" height=\"1\" /\u003e\n\u003c/form\u003e\n\nThank You!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatviyroman%2Fresass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatviyroman%2Fresass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatviyroman%2Fresass/lists"}