React PlumberInstall package

Concepts

Decisions

Decisions are the tokens your theme defines and the reasons written beside them. Plumber reads them through your own Tailwind and judges values against them.

Write the reason beside the token

Put a /* why: … */ comment directly before a token, and Plumber keeps it with that token. When a value drifts, the tokens Plumber offers come with those reasons, so whoever fixes it can tell which one is meant for the job.

css
@theme {
  /* why: Related items use eight pixels. */
  --spacing-related: 8px;
}

How reasons are handled:

Where decisions come from

Plumber collects tokens from these sources, in this order. When two define the same token, the later one wins.

  1. Presets it finds in your project, such as shadcn's, or ones you configure.
  2. Your Tailwind v4 theme, read through the Tailwind you have installed, with each token's place in your CSS.
  3. Variables on :root or html in your CSS, for any family your config doesn't already cover.
  4. decisions.<family>.from in plumber.config.ts: theme selectors such as 'theme:--radius-*', CSS file globs, DTCG token JSON (where $description is the reason), or a function that returns the tokens.

In a Tailwind theme, each family has its own namespaces:

FamilyTokens
Spacing--spacing-*
Colour--color-*
Radius--radius-*
Type--text-*, --font-*, --leading-*, --tracking-*
Motion--duration-*, --ease-*, --animate-*
Elevation--shadow-*, --inset-shadow-*, --drop-shadow-*
Z-index--z-*

Tokens with other names are sorted into families by their value, their uses and their name. plumber decisions says how each one was read.

See what Plumber read

sh
npx plumber decisions                    # every token, its value, origin and reason
npx plumber decisions --family spacing   # one family
npx plumber decisions --json             # the same, for scripts

A token listed with why: (none) has no reason yet.

When your decisions change

Once your project has a ledger, a new token, or a changed value, is an error in plumber check until someone accepts it:

sh
npx plumber accept-decisions

That records the current decisions in the ledger, so that a change to your tokens is reviewed like any other change. Editing only a reason doesn't need it. A token that disappears is a warning; after reviewing the removal, npx plumber ledger --prune clears it.