{"id":15041296,"url":"https://github.com/abeidahmed/sassy-lib","last_synced_at":"2025-08-30T09:05:00.390Z","repository":{"id":115787243,"uuid":"321668956","full_name":"abeidahmed/sassy-lib","owner":"abeidahmed","description":"A minimalistic Sass breakpoint library for your next project.","archived":false,"fork":false,"pushed_at":"2021-03-22T13:49:48.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T20:15:39.807Z","etag":null,"topics":["breakpoint","css","sass","sass-library","sass-mixins"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sassy-lib","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/abeidahmed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2020-12-15T13:00:33.000Z","updated_at":"2021-03-22T13:50:28.000Z","dependencies_parsed_at":"2023-07-26T06:47:38.716Z","dependency_job_id":null,"html_url":"https://github.com/abeidahmed/sassy-lib","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeidahmed%2Fsassy-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeidahmed%2Fsassy-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeidahmed%2Fsassy-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeidahmed%2Fsassy-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abeidahmed","download_url":"https://codeload.github.com/abeidahmed/sassy-lib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248952355,"owners_count":21188426,"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":["breakpoint","css","sass","sass-library","sass-mixins"],"created_at":"2024-09-24T20:45:55.194Z","updated_at":"2025-04-14T20:15:45.490Z","avatar_url":"https://github.com/abeidahmed.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sassy-lib\n\nA minimalistic `Sass` breakpoint library for your next project.\n\n## Installation\n\n`npm i sassy-lib`\n\nAfter installation, import the library in your `.scss` file.\n\n`@import './node_modules/sassy-lib/main.scss';`\n\n\u003e Absolute `import`s do not work. You need to `import` it manually.\n\n## Library defaults\n\nDefault breakpoints:\n\n```sass\n$breakpoints: (\n  xs: 0,\n  sm: 640px,\n  md: 768px,\n  lg: 1024px,\n  xl: 1280px,\n);\n```\n\nDefault `infix` separator (more info at the bottom of the page):\n\n```sass\n$breakpoint-infix-separator: \"-\";\n```\n\n\u003e If you need to overwrite the values, just define the breakpoint in your `.scss` file and `import` the library after declaring the breakpoint. Any overwrites must come before importing the library.\n\n```sass\n$breakpoints: (\n  xs: 0,\n  sm: 640px,\n  md: 768px,\n  lg: 1024px,\n  xl: 1280px,\n);\n\n@import './node_modules/sassy-lib/main.scss';\n\n// Note: The first value in the $breakpoints map should be 0.\n```\n\n## Usage\n\nThe library provides a breakpoint `mixin` which accepts 3 `args`:\n\n- breakpoint name, for example: `sm`, `md`, etc. This is same as your `$breakpoints` `map` key.\n- direction, for example: `up`, `down`, `only`. Further explanation provided below.\n- `$breakpoints` map. The default value is mentioned on top of the page. Even if you need to overwrite the default value, consider creating a separate file for your breakpoints as mentioned above.\n\nThe library handles 3 directions, namely:\n\n- `up` (min-width)\n- `down` (max-width)\n- `only` (min-width and max-width)\n\nTo use any of these directions (default is `up`), you need to `include` the breakpoint `mixin`.\n\n```sass\n@include breakpoint(sm) {\n  // your styles\n}\n// Same as @media (min-width: 640px) {}\n\n@include breakpoint(sm, down) {\n  // your styles\n}\n// Same as @media (max-width: 639.98px) {}\n\n@include breakpoint(sm, only) {\n  // your styles\n}\n// Same as @media (min-width: 640px and max-width: 767.98px) {}\n```\n\n## Creating utility classes\n\nSassy-lib also provides a powerful `api` called `breakpoint-infix` that you can use to create your utility classes.\n\n```sass\n$displays: (\n  flex: flex,\n  block: block,\n);\n\n// $breakpoints is your key-value pair of breakpoint map\n\n@each $breakpoint in map-keys($breakpoints) {\n  // provided by the library\n  $bp-sort: breakpoint-infix($breakpoint);\n\n  @include breakpoint($breakpoint) {\n    @each $prop, $value in $displays {\n      .#{$bp-sort}#{$prop} {\n        display: $value;\n      }\n    }\n  }\n}\n\n// creates\n.flex {\n  display: flex;\n}\n\n@media (min-width: 640px) {\n  .sm-flex {\n    display: flex;\n  }\n}\n\n// etc\n// Note: Please use $bp-sort before declaring your class name.\n```\n\nThe default `infix` separator is \"-\", but you can overwrite by overwriting the `$breakpoint-infix-separator` variable.\n\n## Tip\n\nYou can also create [Tailwind CSS](https://tailwindcss.com/) like `classes` by overwriting the `$breakpoint-infix-separator` value to `$breakpoint-infix-separator: \"\\\\:\"`, which will generate similar `classes`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabeidahmed%2Fsassy-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabeidahmed%2Fsassy-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabeidahmed%2Fsassy-lib/lists"}