{"id":23014865,"url":"https://github.com/pierreburel/postcss-em","last_synced_at":"2025-08-14T07:31:42.466Z","repository":{"id":33165636,"uuid":"153806435","full_name":"pierreburel/postcss-em","owner":"pierreburel","description":"PostCSS plugin to convert px in em.","archived":false,"fork":false,"pushed_at":"2023-11-14T22:52:35.000Z","size":444,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-24T17:48:29.572Z","etag":null,"topics":["css","em","postcss"],"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-10-19T15:44:33.000Z","updated_at":"2024-02-02T14:48:38.000Z","dependencies_parsed_at":"2023-11-14T23:44:23.997Z","dependency_job_id":null,"html_url":"https://github.com/pierreburel/postcss-em","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"10f5dcc9f616b71e29c7bc1ada63f018d7ce2308"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pierreburel/postcss-em","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-em","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-em/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-em/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-em/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pierreburel","download_url":"https://codeload.github.com/pierreburel/postcss-em/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreburel%2Fpostcss-em/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270384126,"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","em","postcss"],"created_at":"2024-12-15T11:10:17.195Z","updated_at":"2025-08-14T07:31:42.186Z","avatar_url":"https://github.com/pierreburel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-em [![Node.js CI](https://github.com/pierreburel/postcss-em/actions/workflows/node.js.yml/badge.svg)](https://github.com/pierreburel/postcss-em/actions/workflows/node.js.yml)\n\n[PostCSS] plugin to convert px in em. Based on [sass-em](https://github.com/pierreburel/sass-em).\n\n**Breaking change in 3.0**: changed default function name to `em-convert` to match [postcss-rem](https://github.com/pierreburel/postcss-rem), 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 `'em'` (see [usage](#usage)).\n\n[postcss]: https://github.com/postcss/postcss\n\n## How it works\n\nThe plugin provides a `em-convert()` function which takes at least 2 parameters: the value (px, mixed) and the context (px).\nThere can be multiple comma-separated values (eg. multiple box shadow), but the last parameter must be the context.\n\n## Example\n\n### Input\n\n```scss\n.demo {\n  font-size: em-convert(24px, 16px); /* Simple */\n  padding: em-convert(5px 10px, 24px); /* Multiple values */\n  margin: em-convert(10px 0.5em, 24px); /* Existing em value */\n  border-bottom: em-convert(1px solid black, 24px); /* Multiple mixed values */\n  box-shadow: em-convert(\n    0 0 2px #ccc,\n    inset 0 0 5px #eee,\n    24px\n  ); /* Comma-separated values */\n  text-shadow: em-convert(1px 1px, 24px) #eee, em-convert(-1px, 24px) 0 #eee; /* Alternate use */\n}\n```\n\n### Output\n\n```css\n.demo {\n  font-size: 1.5em; /* Simple */\n  padding: 0.20833em 0.41666em; /* Multiple values */\n  margin: 0.41666em 0.5em; /* Existing em value */\n  border-bottom: 0.04166em solid black; /* Multiple mixed values */\n  box-shadow: 0 0 0.08333em #ccc, inset 0 0 0.20833em #eee; /* Comma-separated values */\n  text-shadow: 0.04166em 0.04166em #eee, -0.04166em 0 #eee; /* Alternate use */\n}\n```\n\n## Usage\n\nInstall with `npm i postcss-em` and use with [PostCSS]:\n\n```js\npostcss([require(\"postcss-em\")]);\n```\n\nExample with custom options:\n\n```js\npostcss([ require('postcss-em')({\n  precision: 6       // Default to 5\n  name: 'convert-em' // Default to 'em-convert'\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-em","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierreburel%2Fpostcss-em","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierreburel%2Fpostcss-em/lists"}