{"id":23014855,"url":"https://github.com/pierreburel/postcss-rem","last_synced_at":"2025-08-14T07:31:41.793Z","repository":{"id":32878263,"uuid":"144990384","full_name":"pierreburel/postcss-rem","owner":"pierreburel","description":"PostCSS plugin to use rem units with optional pixel fallback.","archived":false,"fork":false,"pushed_at":"2023-11-14T22:52:02.000Z","size":414,"stargazers_count":19,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-11T20:56:48.069Z","etag":null,"topics":["css","postcss","rem"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/pierreburel.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":"2018-08-16T13:18:49.000Z","updated_at":"2025-03-15T05:36:04.000Z","dependencies_parsed_at":"2023-11-14T23:44:06.953Z","dependency_job_id":null,"html_url":"https://github.com/pierreburel/postcss-rem","commit_stats":{"total_commits":25,"total_committers":3,"mean_commits":8.333333333333334,"dds":0.07999999999999996,"last_synced_commit":"8224c71f6f6788d550a33c426981c91d9cffb1dd"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/pierreburel/postcss-rem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-rem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-rem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-rem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-rem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pierreburel","download_url":"https://codeload.github.com/pierreburel/postcss-rem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-rem/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270384124,"owners_count":24574526,"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-14T02:00:10.309Z","response_time":75,"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":["css","postcss","rem"],"created_at":"2024-12-15T11:10:11.863Z","updated_at":"2025-08-14T07:31:41.510Z","avatar_url":"https://github.com/pierreburel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-rem [![Node.js CI](https://github.com/pierreburel/postcss-rem/actions/workflows/node.js.yml/badge.svg)](https://github.com/pierreburel/postcss-rem/actions/workflows/node.js.yml)\n\n[PostCSS] plugin to use rem units with optional pixel fallback. Based on [sass-rem](https://github.com/pierreburel/sass-rem).\n\n**Breaking change in 3.0**: changed default function name to `rem-convert` as [CSS now use `rem()` for calculating the remainder](https://developer.mozilla.org/en-US/docs/Web/CSS/rem). You can revert back by setting `name` option to `'rem'` (see [usage](#usage)).\n\nSee also: [startijenn-rem](https://github.com/pierreburel/startijenn-rem), vanilla JavaScript version.\n\n[postcss]: https://github.com/postcss/postcss\n\n## Example\n\n### Input\n\n```scss\n.demo {\n  font-size: rem-convert(24px); /* Simple */\n  padding: rem-convert(5px 10px); /* Multiple values */\n  margin: rem-convert(10px 0.5rem); /* Existing rem */\n  border-bottom: rem-convert(1px solid black); /* Multiple mixed values */\n  box-shadow: rem-convert(\n    0 0 2px #ccc,\n    inset 0 0 5px #eee\n  ); /* Comma-separated values */\n  text-shadow: rem-convert(1px 1px) #eee, rem-convert(-1px) 0 #eee; /* Alternate use */\n}\n```\n\n### Output\n\n```css\n.demo {\n  font-size: 1.5rem; /* Simple */\n  padding: 0.3125rem 0.625rem; /* Multiple values */\n  margin: 0.625rem 0.5rem; /* Existing rem */\n  border-bottom: 0.0625rem solid black; /* Multiple mixed values */\n  box-shadow: 0 0 0.125rem #ccc, inset 0 0 0.3125rem #eee; /* Comma-separated values */\n  text-shadow: 0.0625rem 0.0625rem #eee, -0.0625rem 0 #eee; /* Alternate use */\n}\n```\n\n## Options\n\nWith `baseline` to `10` (`html { font-size: 62.5%; }`) and `fallback` to `true`:\n\n```css\n.demo {\n  font-size: 24px;\n  font-size: 2.4rem; /* Simple */\n  padding: 5px 10px;\n  padding: 0.5rem 1rem; /* Multiple values */\n  margin: 10px 5px;\n  margin: 1rem 0.5rem; /* Existing rem */\n  border-bottom: 1px solid black;\n  border-bottom: 0.1rem solid black; /* Multiple mixed values */\n  box-shadow: 0 0 2px #ccc, inset 0 0 5px #eee;\n  box-shadow: 0 0 0.2rem #ccc, inset 0 0 0.5rem #eee; /* Comma-separated values */\n  text-shadow: 1px 1px #eee, -1px 0 #eee;\n  text-shadow: 0.1rem 0.1rem #eee, -0.1rem 0 #eee; /* Alternate use */\n}\n```\n\nWith `convert` to `px` (for a lt-ie9 only stylesheet for example):\n\n```css\n.demo {\n  font-size: 24px; /* Simple */\n  padding: 5px 10px; /* Multiple values */\n  margin: 10px 8px; /* Existing rem */\n  border-bottom: 1px solid black; /* Multiple mixed values */\n  box-shadow: 0 0 2px #ccc, inset 0 0 5px #eee; /* Comma-separated values */\n  text-shadow: 1px 1px #eee, -1px 0 #eee; /* Alternate use */\n}\n```\n\n## Usage\n\nInstall with `npm i postcss-rem` and use with [PostCSS]:\n\n```js\npostcss([require(\"postcss-rem\")]);\n```\n\nExample with custom options:\n\n```js\npostcss([\n  require(\"postcss-rem\")({\n    name: \"convert-rem\", // Default to 'rem-convert'\n    baseline: 10,        // Default to 16\n    // convert: \"px\",    // Default to 'rem'\n    fallback: true,      // Default to false\n    precision: 6,        // Default to 5\n  }),\n]);\n```\n\nSee [PostCSS] docs for examples for your environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierreburel%2Fpostcss-rem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierreburel%2Fpostcss-rem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierreburel%2Fpostcss-rem/lists"}