{"id":13480206,"url":"https://github.com/stormwarning/tailwindcss-capsize","last_synced_at":"2025-10-07T03:44:24.082Z","repository":{"id":37952533,"uuid":"286581041","full_name":"stormwarning/tailwindcss-capsize","owner":"stormwarning","description":"✂️ Tailwind CSS utility classes for trimming whitespace above \u0026 below capital letters.","archived":false,"fork":false,"pushed_at":"2025-09-28T09:10:01.000Z","size":589,"stargazers_count":118,"open_issues_count":14,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-28T11:29:01.486Z","etag":null,"topics":["capsize","hacktoberfest","leading-trim","tailwindcss-plugin","text-box-trim","typography"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stormwarning.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-10T21:19:48.000Z","updated_at":"2025-09-25T09:09:16.000Z","dependencies_parsed_at":"2024-06-01T22:31:57.370Z","dependency_job_id":"9de3d027-efda-4a41-809b-199f667db5e2","html_url":"https://github.com/stormwarning/tailwindcss-capsize","commit_stats":{"total_commits":90,"total_committers":6,"mean_commits":15.0,"dds":0.5111111111111111,"last_synced_commit":"8239deb7fdf58b08e626c244a6858672a1fac106"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/stormwarning/tailwindcss-capsize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormwarning%2Ftailwindcss-capsize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormwarning%2Ftailwindcss-capsize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormwarning%2Ftailwindcss-capsize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormwarning%2Ftailwindcss-capsize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stormwarning","download_url":"https://codeload.github.com/stormwarning/tailwindcss-capsize/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormwarning%2Ftailwindcss-capsize/sbom","scorecard":{"id":495963,"data":{"date":"2025-08-11","repo":{"name":"github.com/stormwarning/tailwindcss-capsize","commit":"1d844753018c6539a8d0d18ade88eaec1a60fd26"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 2/14 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"12 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/stormwarning/tailwindcss-capsize/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/stormwarning/tailwindcss-capsize/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/stormwarning/tailwindcss-capsize/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/stormwarning/tailwindcss-capsize/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/stormwarning/tailwindcss-capsize/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/stormwarning/tailwindcss-capsize/release.yml/main?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: ISC License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"20 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3","Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx","Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3","Warn: Project is vulnerable to: GHSA-9crc-q9x8-hgqq","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T20:25:38.871Z","repository_id":37952533,"created_at":"2025-08-19T20:25:38.871Z","updated_at":"2025-08-19T20:25:38.871Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717436,"owners_count":26033539,"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-10-07T02:00:06.786Z","response_time":59,"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":["capsize","hacktoberfest","leading-trim","tailwindcss-plugin","text-box-trim","typography"],"created_at":"2024-07-31T17:00:35.801Z","updated_at":"2025-10-07T03:44:24.076Z","avatar_url":"https://github.com/stormwarning.png","language":"TypeScript","readme":"# tailwindcss-capsize\n\n[![npm version][npm-img]][npm-url]\n\n\u003e A TailwindCSS plugin that generates text-box-trim utility classes using [Capsize].\n\n```bash\nnpm install --save-dev tailwindcss-capsize\n```\n\n## text-box-trim?\n\nFormerly known as `leading-trim`, a [proposed CSS property] to remove the extra space from text bounding boxes, which affects optical alignment. This [article from Microsoft Design] outlines the problem and how the proposed solution works.\n\n## Configuration\n\nA JavaScript config file is required due to the values needed by the plugin. \n\n```css\n@config \"../tailwind.config.js\";\n```\n\nOther Tailwind settings can be configured through CSS directives or included in the config file.\n\nThis plugin requires a `fontMetrics` key added to your Tailwind theme. It should\nbe an object with keys matching those in your `fontFamily` definitions, and each key should have an object of the following shape:\n\n```ts\n{\n\tascent: number\n\tdescent: number\n\tlineGap: number\n\tunitsPerEm: number\n\tcapHeight: number\n}\n```\n\nThese values can be determined by using the [Capsize website], [fontkit], [FontDrop!], or some other means.\n\n### A full example\n\n```js\n// tailwind.config.js\nimport pluginCapsize from 'tailwindcss-capsize'\nexport default {\n\ttheme: {\n\t\tfontFamily: {\n\t\t\tsans: ['Inter', 'sans-serif'],\n\t\t},\n\t\tfontMetrics: {\n\t\t\t// Keys here must match those in fontFamily.\n\t\t\tsans: {\n\t\t\t\tcapHeight: 2048,\n\t\t\t\tascent: 2728,\n\t\t\t\tdescent: -680,\n\t\t\t\tlineGap: 0,\n\t\t\t\tunitsPerEm: 2816,\n\t\t\t},\n\t\t},\n\t\t// ...\n\t},\n\tplugins: [pluginCapsize],\n}\n```\n\n## Usage\n\nThe new `.capsize` utility class should be applied to the _direct parent_ element surrounding a text node. This class requires `font-family`, `font-size`, and `line-height` utilities to be applied at some point above it in the cascade in order for the required custom properties to be available.\n\n```html\n\u003c!-- Example using default TailwindCSS config --\u003e\n\n\u003cp class=\"font-sans text-base leading-none capsize\"\u003eLorem ipsum dolor\u003c/p\u003e\n```\n\n## Options\n\n### rootSize\n\n#### type: `number` (optional, default: `16`)\n\nThe plugin assumes a root font-size of `16px` when converting from rem values. To use a different value, pass it in (without units) to the plugin options.\n\n```js\npluginCapsize({ rootSize: 12 })\n```\n\n### className\n\n#### type: `string` (optional, default: `'capsize'`)\n\nThe default `.capsize` utility class can be replaced with a custom class name if preferred.\n\n```js\npluginCapsize({ className: 'leading-trim' })\n```\n\n## Tips and tricks\n\n### Text truncation and line clamping\n\nSometimes an interface calls for truncating text to a single line or clamping text to a specified number of lines. Applying these methods to the same element that the default `.capsize` class is applied to will cause issues since the class assigns pseudo `::before` and `::after` elements to that element.\n\n```html\n\u003c!-- ❌ Does NOT work --\u003e\n\n\u003cp class=\"font-sans text-base leading-none capsize truncate\"\u003e\n\tText to be truncated to a single line\n\u003c/p\u003e\n```\n\nTo solve this, a child element to the element with the `.capsize` class should wrap the text. This element should receive the styling to truncate or line clamp.\n\n```html\n\u003c!-- ✅ Does work! --\u003e\n\n\u003cp class=\"font-sans text-base leading-none capsize\"\u003e\n\t\u003cspan class=\"truncate\"\u003eText to be truncated to a single line\u003c/span\u003e\n\u003c/p\u003e\n```\n\n## Related\n\n[🔡 tailwindcss-opentype] — Utility classes for advanced typographic features.\n\n[npm-url]: https://www.npmjs.com/package/tailwindcss-capsize\n[npm-img]: https://img.shields.io/npm/v/tailwindcss-capsize.svg?style=flat-square\n[Capsize]: https://github.com/seek-oss/capsize\n[proposed CSS property]: https://www.w3.org/TR/css-inline-3/#leading-trim\n[article from microsoft design]: https://medium.com/microsoft-design/leading-trim-the-future-of-digital-typesetting-d082d84b202\n[Capsize website]: https://seek-oss.github.io/capsize/\n[fontkit]: https://github.com/foliojs/fontkit\n[FontDrop!]: https://fontdrop.info\n[🔡 tailwindcss-opentype]: https://github.com/stormwarning/tailwindcss-opentype\n","funding_links":[],"categories":["Plugins","TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstormwarning%2Ftailwindcss-capsize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstormwarning%2Ftailwindcss-capsize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstormwarning%2Ftailwindcss-capsize/lists"}