
tailwindcss-text-box-trim adds utilities for the CSS text-box-trim and text-box-edge properties to Tailwind CSS v4. Headings sit flush against icons, buttons, and images instead of floating on their own invisible leading.
I had written the same custom utilities in four apps. That is the point where it should be a package.
Timeline
January 2026
Created and published
Twenty lines of CSS built on Tailwind v4's theme and utility directives, tested by compiling through PostCSS, and published to npm the same day.
- box-trim-both, box-trim-start, box-trim-end
- box-edge-cap, box-edge-ex, and the rest of the edge keywords
- One import after tailwindcss
- tailwind-merge class groups documented
January 2026
The namespace bug and the launch post
The theme tokens collided with Tailwind's reserved font-size namespace, so they moved to box-trim and box-edge. Added a publish workflow that only releases when the version changes, then wrote the launch post on this blog.

Before and after: the same heading with and without box-trim-both. May 2026
Maintenance
Package refreshes, a pnpm migration, and releases 1.0.5 through 1.0.7.
Impact
- Over 6,700 downloads this year, about 1,500 a month.
- Used on this site and in Nødro.
- Eight releases, each published automatically with provenance.
My role
Sole author and maintainer: the plugin, tests, publishing automation, the logo, and the launch post.
- Tailwind CSS
- npm