{"id":13795455,"url":"https://github.com/azat-io/postcss-responsive","last_synced_at":"2025-04-24T15:32:21.667Z","repository":{"id":65553711,"uuid":"510520867","full_name":"azat-io/postcss-responsive","owner":"azat-io","description":"📐 PostCSS plugin that improves developer experience of responsive design","archived":false,"fork":false,"pushed_at":"2024-11-12T22:27:26.000Z","size":985,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T17:22:47.618Z","etag":null,"topics":["css","postcss","postcss-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/azat-io.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-04T22:42:40.000Z","updated_at":"2024-11-12T22:27:30.000Z","dependencies_parsed_at":"2023-02-12T03:30:50.975Z","dependency_job_id":"d2fea619-84ca-49fe-9740-34d151d1a2c7","html_url":"https://github.com/azat-io/postcss-responsive","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"134d0fb42ffd975eedaa7782416ec2671c183389"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azat-io%2Fpostcss-responsive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azat-io%2Fpostcss-responsive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azat-io%2Fpostcss-responsive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azat-io%2Fpostcss-responsive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azat-io","download_url":"https://codeload.github.com/azat-io/postcss-responsive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250654479,"owners_count":21465890,"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","postcss","postcss-plugin"],"created_at":"2024-08-03T23:00:57.277Z","updated_at":"2025-04-24T15:32:21.414Z","avatar_url":"https://github.com/azat-io.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# PostCSS Responsive\n\n\u003cimg align=\"right\" width=\"120\" height=\"120\" title=\"PostCSS\" src=\"http://postcss.github.io/postcss/logo.svg\"\u003e\n\n[PostCSS](https://postcss.org) plugin that simplifies the creation of adaptive design with custom `responsive()` function.\n\n## Usage\n\n**Step 1:** Install plugin:\n\n```sh\nnpm install --save-dev postcss postcss-responsive\n```\n\n**Step 2:** Check your project for existing PostCSS config: `.postcssrc` in the project root, `\"postcss\"` section in `package.json` or `postcss` in bundle config.\n\nIf you do not use PostCSS, add it according to [official docs](https://github.com/postcss/postcss#usage)\nand set this plugin in settings.\n\n**Step 3:** Add the plugin to your PostCSS config:\n\n```diff\n{\n  \"plugins\": {\n+    \"postcss-responsive\": {\n+      \"minWidth\": 480,\n+      \"maxWidth\": 1280,\n+    },\n    \"autoprefixer\": {}\n  }\n}\n```\n\n**Step 4:** Just add `responsive()` function into your CSS code. This function can take 2 or 4 arguments: minimum and maximum value and minimum and maximum viewport width (You can set it in plugin settings).\n\n## Options\n\n### minWidth\n\nThe minimum value of the viewport, starting from which we will build a fluid layout. By default, it is not preserved.\n\n### maxWidth\n\nThe maximum value of the viewport, ending with which we will build a fluid layout. By default, it is not preserved.\n\n### funcName\n\nYou can set your own CSS function name. Default value is `responsive`\n\n### legacy\n\nUse `vw` units instead of `vi`. Default value is `false`\n\n## Example\n\n### Input\n\n```css\n.container {\n  display: grid;\n  grid-template-columns: responsive(180px, 240px) 1fr;\n  grid-gap: responsive(8px, 16px);\n  padding: responsive(16px, 32px) responsive(16px, 24px);\n  font-size: responsive(1rem, 1.125rem, 400px, 800px);\n  line-height: responsive(1.5rem, 1.75rem, 400px, 800px);\n}\n```\n\n### Output\n\n```css\n.container {\n  display: grid;\n  grid-template-columns: clamp(11.25rem, 9rem + 7.5vi, 15rem) 1fr;\n  grid-gap: clamp(0.5rem, 0.2rem + 1vi, 1rem);\n  padding: clamp(1rem, 0.4rem + 2vi, 2rem) clamp(1rem, 0.7rem + 1vi, 1.5rem);\n  font-size: clamp(1rem, 0.875rem + 0.5vi, 1.125rem);\n  line-height: clamp(1.5rem, 1.25rem + 1vi, 1.75rem);\n}\n```\n\n### Browser Support\n\n`postcss-responsive` plugin uses `clamp()` function and `vi` units. So it works on all modern browsers. You can check browser support [here](https://caniuse.com/?search=clamp)\n\n## Contributing\n\nPull requests are welcome.\n\n## License\n\nMIT \u0026copy; [Azat S.](https://twitter.com/azat_io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazat-io%2Fpostcss-responsive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazat-io%2Fpostcss-responsive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazat-io%2Fpostcss-responsive/lists"}