unslopkit

Blog

A border-radius scale your coding agent will follow

Five named radii and one spacing scale are enough. Unslop Kit writes them into DESIGN.md, and Extract can read the corners off a page you already have.

6 min read

By Vic

A coding agent treats corner radius as a local choice. A chip gets rounded-sm, a card gets rounded-xl, a modal gets rounded-2xl, and the button becomes a pill. Each decision is small. Together they make the page look like it was assembled from three kits.

A scale the agent can follow is a closed list. If the name is not in the file, there is nothing to reach for.

Five names

Unslop Kit records five radii, and only five.

NameWhat it is for
noneSquare. It is 0px.
smThe small step. A key hint in the component set uses this one.
mdControls. In DESIGN.md, the primary, accent, and ghost buttons, and the input, point at {rounded.md}.
lgCards. The card recipe points at {rounded.lg}. A drop zone in the component set uses this step too.
full9999px. Avatars only.

The prose under the YAML says the same thing in one sentence. Radii stay in one family, and full is for avatars. Do not pill the buttons, the inputs, or the hero eyebrow.

The week-1 lint warns when md or lg is 9999px. A pill on a control or a card flattens every component into the same capsule. The warning does not lock the export buttons. It is written into the file, so you see it before the agent does.

Pick a family from the library

The library has component styles that already made this choice. Keeping one writes sm, md, and lg. none stays 0px. full stays 9999px.

A few of the families, as they are stored:

  • Hairline flat. 4px, 6px, 10px. Small radii, a 1px rule, no card shadow.
  • Editorial quiet. 2px, 4px, 8px. Almost square. Type does the styling.
  • Technical tight. 2px, 2px, 4px. Dense gutters, no shadow.
  • Playful chunk. 12px, 16px, 24px. A 2px border, so the large radius does not read as a default soft kit.
  • Sharp brutal, luxury thin, ledger, stamp, and poster. 0px, 0px, 0px. The border or the hard shadow is the shape. Rounding it would fight the style.
  • Pill control and capsule card. These set md to 9999px. They are in the library so a kit can land on them and see the lint warning.

Spacing comes with the style. A kit built from the library uses a 4px base and this scale: 4, 8, 12, 16, 24, 32, 48, 72, 112. Section padding and the gutter come from the component style. Hairline flat uses 96px of section padding and a 24px gutter. Technical tight uses 64px and 16px. The container is 1120px. DESIGN.md tells the agent to use a 12-column grid at that container and gutter, and to pad sections with the section-y token.

Buttons do not get a fresh padding either. Each style records one, such as 12px 20px on Hairline flat or 8px 14px on Technical tight. The card recipe uses 24px of padding.

The components you add from the library are stricter than a loose Tailwind scale. A key hint uses --uk-radius-sm. A field uses --uk-radius-md. A drop zone uses --uk-radius-lg. The markup reads those variables. It does not paste a second set of pixel values.

Read the corners off a page you have

If the look already exists on a site you own, or on a page you are using as inspiration, Extract turns the computed corners into the same three steps.

It keeps radii under 200px. A 9999px pill is left out, so a round avatar does not become the card radius. The small step is the 25th percentile, clamped between 0px and 32px. The control step is the median, clamped between 0px and 40px. The card step is the 80th percentile, clamped between 0px and 48px. full is still 9999px. A page with no corner radii falls back to 4px, 8px, and 12px.

Spacing is the gaps the page actually used. Duplicate values are dropped. The scale keeps up to nine steps, each clamped between 4px and 160px. The base stays 4px. Section padding is the high end of those gaps, and at least 64px, then clamped between 48px and 160px. The gutter sits near the middle of the gaps, clamped between 12px and 48px. The container is the page max-width when that width is at least 640px, otherwise 1120px, and it is clamped between 640px and 1440px. A page with no spacing samples falls back to 8, 16, 24, and 48.

Look at the specimen before you keep the kit. One large photo tile should not set the radius for every card. Pull a site's design values covers the rest of that reading: colors, type, and what stays on the original site.

Where the numbers are written

In DESIGN.md, the YAML lists rounded.none, sm, md, lg, and full, then the spacing base, the scale, section-y, the container, and the gutter. The button and input recipes reference {rounded.md}. The card references {rounded.lg}.

Download kit zip writes four token files next to DESIGN.md.

  • tokens/variables.css sets --uk-radius-none, --uk-radius-sm, --uk-radius-md, --uk-radius-lg, and --uk-radius-full. Spacing lands as --uk-space-base, --uk-section-y, --uk-container, and --uk-gutter. The individual scale steps are not separate variables. They live in the YAML and in the JSON.
  • tokens/tailwind.css is a Tailwind v4 @theme with --radius-sm, --radius-md, and --radius-lg, plus --spacing-section, --spacing-gutter, and --container-page. It does not add an xl or a 2xl. It also does not delete a radius scale the project already ships, so the prose rule still matters.
  • tokens/shadcn.css sets --radius from the md step, in both the light block and the dark block.
  • tokens/tokens.json is the DTCG document. The spacing scale is an array there.

The agent instructions at the bottom of DESIGN.md say to load tokens/shadcn.css or tokens/tailwind.css, and not to invent a radius or a spacing value. If one is missing, stop and ask. The v0 prompt in the zip points at the Tailwind theme and says not to start from the default shadcn theme. The Bolt prompt says to apply tokens/shadcn.css before generating components.

Give your coding agent a DESIGN.md is the rest of that handoff: the brief, the refusal list, and the two checks on the export buttons.

A check you can do on the draft

Search the generated page for rounded-xl, rounded-2xl, rounded-3xl, and rounded-full. The full radius is the avatar case. A pill on a button, an input, or an eyebrow is the thing the lint is there to catch.

Then compare the draft's padding with the scale in the YAML. A value that is not on that list, and not the recorded button padding, was invented. If the layout needs a size the file does not have, add it to the scale on purpose, or leave the layout alone. An agent that is allowed to invent one step will invent the next one too.

Related