{"id":27725443,"url":"https://github.com/infinum/media-blender","last_synced_at":"2025-07-16T23:35:53.736Z","repository":{"id":57293891,"uuid":"69897744","full_name":"infinum/media-blender","owner":"infinum","description":"Easy and predictable SASS/SCSS media queries","archived":false,"fork":false,"pushed_at":"2025-04-17T08:01:20.000Z","size":179,"stargazers_count":26,"open_issues_count":2,"forks_count":4,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-06-30T02:44:40.007Z","etag":null,"topics":["bootstrap","breakpoint","desktop","media","media-blender","media-query","mixins","open-source","orientation","retina","retina-support","sass","susy","tablet"],"latest_commit_sha":null,"homepage":"","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/infinum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-10-03T18:17:52.000Z","updated_at":"2025-04-17T08:00:47.000Z","dependencies_parsed_at":"2025-04-27T19:14:39.211Z","dependency_job_id":"156689e0-ec50-431e-9257-dbb40986a43b","html_url":"https://github.com/infinum/media-blender","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/infinum/media-blender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2Fmedia-blender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2Fmedia-blender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2Fmedia-blender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2Fmedia-blender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinum","download_url":"https://codeload.github.com/infinum/media-blender/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2Fmedia-blender/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263553671,"owners_count":23479432,"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":["bootstrap","breakpoint","desktop","media","media-blender","media-query","mixins","open-source","orientation","retina","retina-support","sass","susy","tablet"],"created_at":"2025-04-27T19:14:33.900Z","updated_at":"2025-07-06T08:32:23.474Z","avatar_url":"https://github.com/infinum.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# media-blender\n\nEasy and predictable media queries\n\n[![Build Status](https://travis-ci.org/infinum/media-blender.svg?branch=master)](https://travis-ci.org/infinum/media-blender)\n[![NPM version](https://badge.fury.io/js/media-blender.svg)](http://badge.fury.io/js/media-blender)\n[![Dependency Status](https://david-dm.org/infinum/media-blender.svg)](https://david-dm.org/infinum/media-blender)\n[![devDependency Status](https://david-dm.org/infinum/media-blender/dev-status.svg)](https://david-dm.org/infinum/media-blender#info=devDependencies)\n\n\n## Installation\n\n```bash\nnpm install --save media-blender\n```\n\n## Configuration (breakpoint definition)\n\nThe breakpoints are defined with a SCSS map. The smallest breakpoint should start with 0, and the largest should only have one value if the other is infinity:\n\n```scss\n@import 'media-blender';\n\n$media-breakpoints: (\n  mobile: 0 767,\n  tablet: 768 991,\n  desktop: 992 1199,\n  large: 1200\n);\n```\n\nThe above values are overriding the default values. The default values are:\n\n```scss\n$media-breakpoints: (\n  small: 0 543,\n  mobile: 544 767,\n  tablet: 768 991,\n  desktop: 992 1199,\n  large: 1200\n) !default;\n```\n\n\n## Usage\n\nThe media mixin is receiving one or more parameters - the breakpoints we want to match.\n\n### Examples\n\n#### Small mobile screens only\n\nSource:\n```scss\n@include media(small) {\n  .element {\n    color: red;\n  }\n}\n```\n\nCompiled:\n```css\n@media (max-width: 543px) {\n  .element {\n    color: red;\n  }\n}\n```\n\n#### Tablet only\n\nSource:\n```scss\n@include media(tablet) {\n  .element {\n    color: red;\n  }\n}\n```\n\nCompiled:\n```css\n@media (min-width: 768px) and (max-width: 991px) {\n  .element {\n    color: red;\n  }\n}\n```\n\n#### Desktop\n\n```scss\n@include media(desktop large) {\n  .element {\n    color: red;\n  }\n}\n```\n\nCompiled:\n```css\n@media (min-width: 992px) {\n  .element {\n    color: red;\n  }\n}\n```\n\n#### Tablet and large\n\n```scss\n@include media(tablet large) {\n  .element {\n    color: red;\n  }\n}\n```\n\nCompiled:\n```css\n@media (min-width: 768px) and (max-width: 991px), (min-width: 1200px) {\n  .element {\n    color: red;\n  }\n}\n```\n\n#### Retina support\n\nThe mixin also supports retina screens via the `retina` query. It can be used alone,\nor in combination with other breakpoints.\n\n##### Using only retina\n\n```scss\n@include media(retina) {\n  .element {\n    color: red;\n  }\n}\n```\n\nCompiled:\n\n```css\n@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n  .element {\n    color: red;\n  }\n}\n```\n\n###### Combining retina with breakpoints\n\n```scss\n@include media(small mobile tablet retina) {\n  .element {\n    color: red;\n  }\n}\n```\n\nCompiled:\n\n```css\n@media (max-width: 991px) and (-webkit-min-device-pixel-ratio: 2), (max-width: 991px) and (min-resolution: 192dpi) {\n  .element {\n    .color: red;\n  }\n}\n```\n#### Desktop-first and mobile-first support\n\nWe make writing mobile-first or desktop-first oriented media queries easier than ever\nby introducing the `up` and `down` keywords. You can now say `tablet up`, and this will\ntarget tablets, and all other devices with a screen of at least that size. The reverse\ngoes for `tablet down`. This will include all devices with a screen size no larger than\nthat defined for the tablet upper breakpoint. This also works for your custom breakpoints,\nif you define them. It relies on the breakpoints, not their order of definition in the map.\n\n##### Using `down` syntax\n```scss\n@include media (tablet down) {\n  .element {\n    color: red;\n  }\n}\n```\n\nCompiled:\n\n```css\n@media (max-width: 991px) {\n  .element {\n    color: red;\n  }\n}\n```\n\n##### Using `up` syntax\n\n```scss\n@include media (tablet up) {\n  .element {\n    color: red;\n  }\n}\n```\n\nCompiled:\n\n```css\n@media (min-width: 768px) {\n  .element {\n    color: red;\n  }\n}\n```\n\n#### Orientation\n\nOther than the breakpoints, you can also specify orientation, as an optional second\nargument to the mixin. For example, you can specify all mobile devices and tablets in\nlandscape mode as so:\n\n```scss\n@include media(small mobile tablet, landscape) {\n  .element {\n    visibility: hidden;\n  }\n}\n```\n\nCompiled:\n\n```css\n@media (max-width: 991px) and (orientation: landscape) {\n  .element {\n    visibility: hidden;\n  }\n}\n```\n\n## Testing\n\nThe mixin and its functions are unit tested using [True](https://github.com/oddbird/true).\n\nAll of the tests are defined in the `test/` directory and are SCSS files themselves. To add\nyour own tests, create a new `.scss` file in `test/` and add the file name to the `test_sass.js`\nfile. The tests are run using [Mocha](https://mochajs.org/).\n\n### Running the tests\n\nTo run the tests, run this command:\n\n```bash\nnpm run test\n```\n\nAdditionally, tests and linters can be run continuously through the watch mode, via:\n\n```bash\nnpm run watch\n```\n\n## Changelog\n\n### 2.0.0\n\n* Updated default breakpoints (Bootstrap 4 values)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinum%2Fmedia-blender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinum%2Fmedia-blender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinum%2Fmedia-blender/lists"}