{"id":30107052,"url":"https://github.com/benignware/sscreen","last_synced_at":"2025-08-10T01:33:01.398Z","repository":{"id":57368834,"uuid":"165570622","full_name":"benignware/sscreen","owner":"benignware","description":"A scss library for working with custom media queries","archived":false,"fork":false,"pushed_at":"2019-02-05T11:43:32.000Z","size":244,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-30T16:34:01.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/benignware.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":"2019-01-14T00:32:19.000Z","updated_at":"2019-02-05T11:42:22.000Z","dependencies_parsed_at":"2022-09-12T03:00:16.737Z","dependency_job_id":null,"html_url":"https://github.com/benignware/sscreen","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/benignware/sscreen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fsscreen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fsscreen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fsscreen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fsscreen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benignware","download_url":"https://codeload.github.com/benignware/sscreen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fsscreen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269663320,"owners_count":24455797,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-08-10T01:32:05.081Z","updated_at":"2025-08-10T01:33:01.375Z","avatar_url":"https://github.com/benignware.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sscreen\n\nA scss library for working with custom media queries\n\n\n## Install\n\n```cli\nnpm i sscreen -D\n```\n\n## Usage\n\nThe library consists of a mixin `screen-set` which lets you define your breakpoints and a function `screen-get` for retrieval as well as mixins `screen-up` and `screen-down` by which you actually make your stuff responsive.\n\n\u003e Note: For getting `sscreen` to work in recent user-agents, `@custom-media` directives must be transpiled on top of scss compilation. See [postcss-custom-media](https://github.com/postcss/postcss-custom-media) for further information\n\n\nHere's a complete example...\n\n```js\n// postcss.config.js\nmodule.exports = {\n  plugins: [\n    require('postcss-custom-media')({\n      preserve: true // For the sake of example, we preserve our transpiled @custom-media rules\n    })\n  ]\n};\n```\n\n```scss\n$screen-prefix: prefix-;\n$screen-style: kebabCase;\n$screen-breakpoint-delimiter: '-';\n\n// Define your breakpoints\n@include screen-set((\n  xs: 0,\n  sm: 576px,\n  md: 768px,\n  lg: 992px,\n  xl: 1200px\n));\n```\n\n```scss\n// Grid.scss\n.Grid {\n  display: flex;\n  flex-wrap: wrap;\n  flex-direction: row;\n  margin: -1rem;\n  box-sizing: border-box;\n}\n```\n\n```scss\n// GridItem.scss\n.GridItem {\n  padding: 1rem;\n  box-sizing: border-box;\n  $columns: 12;\n\n  @each $breakpoint in map-keys(screen-get()) {\n    $infix: screen-infix($breakpoint);\n\n    @include screen-up($breakpoint) {\n      @for $size from 1 through $columns {\n        \u0026--#{$infix}#{$size} {\n          flex: 0 0 percentage($size / $columns);\n          max-width: percentage($size / $columns);\n        }\n      }\n    }\n  }\n}\n```\n\nOutput:\n\n```css\n@custom-media --prefix-xs-down (max-width: 575.98px);\n\n@custom-media --prefix-sm-up (min-width: 576px);\n\n@custom-media --prefix-sm-down (max-width: 767.98px);\n\n@custom-media --prefix-md-up (min-width: 768px);\n\n@custom-media --prefix-md-down (max-width: 991.98px);\n\n@custom-media --prefix-lg-up (min-width: 992px);\n\n@custom-media --prefix-lg-down (max-width: 1199.98px);\n\n@custom-media --prefix-xl-up (min-width: 1200px);\n\n.Grid {\n  display: flex;\n  flex-wrap: wrap;\n  flex-direction: row;\n  margin: -1rem;\n  box-sizing: border-box;\n}\n\n.GridItem {\n  padding: 1rem;\n  box-sizing: border-box;\n}\n\n.GridItem--1 {\n  flex: 0 0 8.33333%;\n  max-width: 8.33333%;\n}\n\n/* ... */\n\n.GridItem--12 {\n  flex: 0 0 100%;\n  max-width: 100%;\n}\n\n@media (min-width: 576px) {\n  .GridItem--sm-1 {\n    flex: 0 0 8.33333%;\n    max-width: 8.33333%;\n  }\n  /* ... */\n  .GridItem--sm-12 {\n    flex: 0 0 100%;\n    max-width: 100%;\n  }\n}\n\n@media (--prefix-sm-up) {\n  .GridItem--sm-1 {\n    flex: 0 0 8.33333%;\n    max-width: 8.33333%;\n  }\n  /* ... */\n  .GridItem--sm-12 {\n    flex: 0 0 100%;\n    max-width: 100%;\n  }\n}\n\n@media (min-width: 768px) {\n  .GridItem--md-1 {\n    flex: 0 0 8.33333%;\n    max-width: 8.33333%;\n  }\n  /* ... */\n  .GridItem--md-12 {\n    flex: 0 0 100%;\n    max-width: 100%;\n  }\n}\n\n@media (--prefix-md-up) {\n  .GridItem--md-1 {\n    flex: 0 0 8.33333%;\n    max-width: 8.33333%;\n  }\n  /* ... */\n  .GridItem--md-12 {\n    flex: 0 0 100%;\n    max-width: 100%;\n  }\n}\n\n@media (min-width: 992px) {\n  .GridItem--lg-1 {\n    flex: 0 0 8.33333%;\n    max-width: 8.33333%;\n  }\n  /* ... */\n  .GridItem--lg-12 {\n    flex: 0 0 100%;\n    max-width: 100%;\n  }\n}\n\n@media (--prefix-lg-up) {\n  .GridItem--lg-1 {\n    flex: 0 0 8.33333%;\n    max-width: 8.33333%;\n  }\n  /* ... */\n  .GridItem--lg-12 {\n    flex: 0 0 100%;\n    max-width: 100%;\n  }\n}\n\n@media (min-width: 1200px) {\n  .GridItem--xl-1 {\n    flex: 0 0 8.33333%;\n    max-width: 8.33333%;\n  }\n  /* ... */\n  .GridItem--xl-12 {\n    flex: 0 0 100%;\n    max-width: 100%;\n  }\n}\n\n@media (--prefix-xl-up) {\n  .GridItem--xl-1 {\n    flex: 0 0 8.33333%;\n    max-width: 8.33333%;\n  }\n  /* ... */\n  .GridItem--xl-12 {\n    flex: 0 0 100%;\n    max-width: 100%;\n  }\n}\n\n\n```\n\n\u003e Note: `sscreen` is intented for being used at application level and is currently not suited for being incorporated into a dedicated scss library\n\n## Development\n\nIn order to run specs, issue the following from your terminal:\n\n```cli\nnpm test\n```\n\nRun dev-server\n\n```cli\nnpm start\n```\n\nCreate a build (for whatever purpose)\n\n```cli\nnpm run build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenignware%2Fsscreen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenignware%2Fsscreen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenignware%2Fsscreen/lists"}