{"id":15655157,"url":"https://github.com/danielroe/postcss-capsize","last_synced_at":"2025-07-25T09:35:29.074Z","repository":{"id":37016463,"uuid":"347486957","full_name":"danielroe/postcss-capsize","owner":"danielroe","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-05T14:03:17.000Z","size":6776,"stargazers_count":25,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T15:24:05.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/danielroe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":["danielroe"]}},"created_at":"2021-03-13T21:54:12.000Z","updated_at":"2025-04-28T08:26:57.000Z","dependencies_parsed_at":"2023-02-13T23:01:12.792Z","dependency_job_id":"e15e789c-b5de-4972-a59a-eb73131636a0","html_url":"https://github.com/danielroe/postcss-capsize","commit_stats":{"total_commits":301,"total_committers":4,"mean_commits":75.25,"dds":"0.17940199335548168","last_synced_commit":"f009b376821ebe69f3e09572f035a80fb457257b"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fpostcss-capsize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fpostcss-capsize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fpostcss-capsize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fpostcss-capsize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielroe","download_url":"https://codeload.github.com/danielroe/postcss-capsize/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252974182,"owners_count":21834216,"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":[],"created_at":"2024-10-03T12:56:44.457Z","updated_at":"2025-05-08T00:20:27.818Z","avatar_url":"https://github.com/danielroe.png","language":"TypeScript","funding_links":["https://github.com/sponsors/danielroe"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003epostcss-capsize\u003c/h1\u003e\n\u003cp align=\"center\"\u003ePostCSS plugin to inject Capsize font metrics\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://npmjs.com/package/postcss-capsize\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/npm/v/postcss-capsize/latest.svg?style=flat-square\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://bundlephobia.com/result?p=postcss-capsize\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/bundlephobia/minzip/postcss-capsize?style=flat-square\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://npmjs.com/package/postcss-capsize\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/npm/dt/postcss-capsize.svg?style=flat-square\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://lgtm.com/projects/g/danielroe/postcss-capsize\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/lgtm/alerts/github/danielroe/postcss-capsize?style=flat-square\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://lgtm.com/projects/g/danielroe/postcss-capsize\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/lgtm/grade/javascript/github/danielroe/postcss-capsize?style=flat-square\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://david-dm.org/danielroe/postcss-capsize\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/david/danielroe/postcss-capsize.svg?style=flat-square\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/danielroe/postcss-capsize\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/codecov/c/github/danielroe/postcss-capsize.svg?style=flat-square\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e PostCSS plugin to inject Capsize font metrics\n\n[**Read more about Capsize**](https://seek-oss.github.io/capsize/)\n\n## Quick Start\n\nFirst install `postcss-capsize`:\n\n```bash\nyarn add postcss-capsize --dev\n# or npm\nnpm install postcss-capsize --save-dev\n```\n\nSecond, add `postcss-capsize` as a PostCSS plugin to your `postcss.config.js`,\nor in your project configuration.\n\n```diff\nmodule.exports = {\n  plugins: [\n+   ['postcss-capsize', {\n+     metrics: {\n+       'Test Mono': {\n+         capHeight: 100,\n+         ascent: 800,\n+         descent: -200,\n+         lineGap: 0,\n+         unitsPerEm: 1000,\n+       }\n+       // You can declare as many fonts as needed\n+     }\n+   }],\n    require('autoprefixer')\n  ]\n}\n```\n\n**Note**: there are many font metrics you can install from `@capsizecss/metrics` - or generate from a font file via `@capsizecss/unpack`.\n\n## Example\n\n### Split syntax\n```css\n.test {\n  line-gap: 10px;\n  /* both properties below must be declared alongside `line-gap` */\n  /* The first matching font-family from your plugin config will be used */\n  font-family: 'Gaudy Mono', 'Test Mono', sans-serif;\n  font-size: 24px;\n}\n```\n\n### Combined syntax (deprecated)\n```css\n.test {\n  /* font-metrics: [font-size] [font-family] [line-gap] */\n  /* [font-family] must match the entry in your plugin config */\n  font-metrics: 24px Test Mono 10px;\n}\n```\n\n### Result\n\n```css\n.test {\n  line-height: 12.4px;\n  font-size: 24px;\n  font-family: 'Gaudy Mono', 'Test Mono', sans-serif;\n  /* Or, with combined syntax */\n  font-family: Test Mono;\n}\n.test::before {\n  content: '';\n  margin-bottom: -0.4583em;\n  display: table;\n}\n.test::after {\n  content: '';\n  margin-top: 0.0417em;\n  display: table;\n}\n```\n\n## Contributors\n\nThis has been developed to suit my needs but additional use cases and contributions are very welcome.\n\n## License\n\n[MIT License](./LICENSE) - Copyright \u0026copy; Daniel Roe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielroe%2Fpostcss-capsize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielroe%2Fpostcss-capsize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielroe%2Fpostcss-capsize/lists"}