Skip to content

About

Tailwind CSS v4 plugin: nested elements get the correct concentric corner radius automatically.

Topics

Resources

Stars

27 stars

Watchers

0 watching

Forks

Repository files navigation

The tailwindcss-concentric logo: four rounded slabs stacked in steps, each inset by the same gap, so every corner shares one centre.

tailwindcss-concentric

A Tailwind CSS v4 plugin that gives nested rounded elements the right corner radius automatically: inner radius = outer radius - gap.

A 14-second film. A magnified corner where the inner element repeats the outer radius, so the gap measures 20px along the edge but 28px across the corner. Switching on rounded-concentric makes the corner gap 20px too. Then a card sweeps through radii and paddings while its image and its Read and Save buttons keep an even gap, and the film ends on the one-line diff and npm i tailwindcss-concentric.

@import "tailwindcss";
@import "tailwindcss-concentric";
<div class="rounded-3xl p-3">
  <img class="rounded-concentric" />   <!-- 24px - 12px = 12px -->
</div>

Package documentation: packages/tailwindcss-concentric/README.md.

Repository

Path What it is
packages/tailwindcss-concentric The npm package. src/build.ts generates dist/index.css; src/merge.ts is the tailwind-merge plugin; src/audit.ts and src/cli.ts are the audit command.
packages/tailwindcss-concentric/test Unit, snapshot and audit tests (Vitest, real Tailwind compiler) and browser tests (Playwright) for every edge case in test/cases.ts.
skills/concentric Agent skill: SKILL.md, references/, and an eval (eval/) with a seeded sample app and a grader.
apps/site Playground and docs site: Astro and Tailwind CSS, with React islands for the interactive demos.
brand The logo, drawn from an interactive Hairline figure in brand/hairline. node apps/site/scripts/brand.ts redraws the logo, the favicon and the iOS icon from it. Also the launch film (film.mp4, and film.gif for this README), rendered from apps/site/src/pages/film.astro.
DECISIONS.md Spike results and the architecture choices behind them.

Development

Requires Node 22.18 or later (TypeScript files run directly with Node's type stripping) and pnpm 10.

pnpm install
pnpm build          # generate dist/
pnpm test           # unit + snapshot + size tests
pnpm test:e2e       # browser tests (Chromium, Firefox, WebKit)
pnpm lint           # Biome
pnpm typecheck
pnpm --filter concentric-site dev   # site at http://localhost:4321

The first e2e run needs browsers: pnpm --filter tailwindcss-concentric exec playwright install.

Other scripts:

pnpm --filter tailwindcss-concentric compat 4.0.0 latest   # browser suite against published Tailwind releases
pnpm --filter tailwindcss-concentric size                  # gzipped size of dist/index.css
node packages/tailwindcss-concentric/scripts/readme-image.ts   # re-render the README image
pnpm --filter concentric-site og-image                    # re-render the site's social image (public/og.png)
node apps/site/scripts/film.ts                            # re-render brand/film.mp4 and film.gif (needs ffmpeg and the dev server)

To run the skill eval, see skills/concentric/eval/README.md.

Releasing

Add a changeset with pnpm changeset. On main, the release workflow opens a "Version packages" pull request; merging it publishes to npm with provenance. It publishes through npm trusted publishing, so it needs no token: the package's trusted publisher on npmjs.com points at release.yml in this repository.

License

MIT

About

Tailwind CSS v4 plugin: nested elements get the correct concentric corner radius automatically.

Topics

Resources

Stars

27 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages