spacing-system
Skill3 starsChanged 8 days agoMITView on GitHub
Use when designing or auditing a spacing scale for padding, gaps, icon sizes, component heights, or border radii. Names the two-unit primitive model (a minor unit — the smallest legal increment — plus a major unit — the dominant rhythm — where major divides cleanly by minor), the derivation rule (padding / gap / radius / height ladders all derive from the unit primitives, never invented per-surface), the 24 CSS px WCAG 2.5.8 AA target floor for interactive heights, and the T-shirt-vs-numeric naming options. Cite when an agent proposes a single-unit grid for a mixed-density system or invents off-grid spacing values for "this one specific case." For one system's concrete density-mode unit choices see udts-spacing-defaults.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- KyaniteLabs/tastechecktheir own version, first seen Nov 2, 2026
- miovrag/claude-skillstheir own version, first seen Jun 12, 2026
- launchapp-dev/animus-clitheir own version, first seen Mar 15, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- launchapp-dev/animus-cli★ 39same name
- KyaniteLabs/tastecheck★ 12same name
- miovrag/claude-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository66 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- clud-bug-collaborationSkill
- critical-issues-onlySkill
- evidence-based-reviewSkill
- respect-existing-conventionsSkill
- skill-frontmatter-qualitySkill
- apca-contrastSkill
- api-contract-enforcementSkill
- brand-voice-reviewSkill
- chroma-harmonizationSkill
- clud-bug-collaborationSkill
- component-sizing-principlesSkill
- component-sizingSkill
- composing-a-screenSkill
- consuming-a-design-systemSkill
- conventions-templateSkill
- critical-issues-onlySkill
- curating-a-skill-catalogSkill
- designing-a-design-systemSkill
- designing-elite-uiSkill
- design-system-consistencySkill
- design-token-namingSkill
- dtcg-formatSkill
- empirical-design-principlesSkill
- evidence-based-reviewSkill
- finding-a-catalog-skillSkill
- frontend-a11ySkill
- guarding-a-regressionSkill
- ios-safari-surfacesSkill
- line-height-gridSkill
- logmindSkill
- motion-continuitySkill
- oklch-color-spaceSkill
- orchestrating-agent-delegationSkill
- orchestrating-a-multi-agent-runSkill
- orchestrating-elite-agent-qaSkill
- palette-relationshipsSkill
- pii-and-complianceSkill
- proving-an-absenceSkill
- respect-existing-conventionsSkill
- retiring-a-superseded-decisionSkill
- reviewing-design-workSkill
- semver-design-tokensSkill
- session-heartbeatSkill
- skillforgeSkill
- skill-frontmatter-qualitySkill
- technical-writingSkill
- test-disciplineSkill
- thrill-designSkill
- token-frugal-toolingSkill
- token-naming-conventionsSkill
- type-scaleSkill
- udts-component-sizing-laddersSkill
- udts-dtcg-extensionsSkill
- udts-linter-rulesSkill
- udts-naming-conventionSkill
- udts-reviewSkill
- udts-semver-defaultsSkill
- udts-spacing-defaultsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
No token layer on disk — no unit primitives declared anywhere, so there is no grid to be off of.
- Distinctive: line 40
Every secondary scale derives from the two units.
- Distinctive: line 99
After picking unit primitives + emitting ladders:
- Distinctive: line 102
Grid alignment: every padding, gap, and component-height token is a multiple of the minor unit.
- Distinctive: line 103
Pointer target: every interactive component-height rung is ≥ 24 CSS px.
- Distinctive: line 104
Naming sync: if both T-shirt and numeric families are emitted, every value has a matching pair in both.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spacing system
Spacing in a token-driven design system is a two-unit primitive problem, not a one-number guess. A token-driven system declares a minor unit (the smallest legal increment) and a major unit (the dominant rhythm), with the constraint that the major divides cleanly by the minor. Everything downstream — padding, gap, icon size, component height, border radius — derives from those two numbers.
When to use
- Designing a new spacing scale from a density brief.
- Auditing an existing scale with one-off off-grid values.
- Picking unit primitives for a density mode (dense / balanced / spacious).
- Code review: flag raw px values for
padding/gap/marginoutside the system's declared scale.
When NOT to use
- No token layer on disk — no unit primitives declared anywhere, so there is no grid to be off of. A marketing surface built inside a system that has declared primitives is still in scope.
- Print-design contexts where the grid math is pt-based and a different system applies.
The two-unit primitive model
A token-driven system declares two unit primitives per foundation theme:
| Slot | Typical value | Role |
| minor | e.g. 4 | Smallest legal increment — used for tight inline gaps, sub-pixel-but-aligned spacing |
| major | e.g. 8 | Dominant rhythm — used for padding, gap, vertical stack rhythm |
Constraint: major mod minor == 0. Both default to 4 when not split (single-unit systems collapse to minor == major).
Different density briefs pick different unit pairs — a dense data tool wants a smaller minor unit than a spacious marketing surface, so the same derivation rule yields a 2/4, 4/8, or 4/16 pairing depending on the brief. One system's concrete density-mode unit choices live in udts-spacing-defaults (an incubating L2 stub).
What derives from the unit primitives
Every secondary scale derives from the two units. Designers and developers don't invent these — the system generates them.
Padding ladder
Generated from the major unit, with minor steps for tight cases:
padding-0 = 0
padding-2xs = minor (e.g. 4)
padding-xs = major (e.g. 8)
padding-sm = 1.5 × major (e.g. 12)
padding-md = 2 × major (e.g. 16)
padding-lg = 3 × major (e.g. 24)
padding-xl = 4 × major (e.g. 32)
padding-2xl = 6 × major (e.g. 48)
padding-3xl = 8 × major (e.g. 64)Gap ladder
Same ladder as padding, separately labeled (gap-*) because horizontal and vertical gaps may diverge in some themes. The major-unit base ensures stacked rhythm preserves baselines.
Icon-size ladder
Curated, not derived — component-sizing-principles owns the curated set, the reasoning, and the rule that pairs an icon size with a control height.
Component-height ladder
Curated per density mode, with the 24 CSS px WCAG 2.5.8 AA Pointer Target floor for interactive controls (anything clickable / tappable / focusable). See component-sizing-principles for the per-density ladder.
Border-radius ladder
Radius snaps to the minor unit like every other ladder here, but how many rungs and how fast they grow is the system's own personality call, not a universal formula — a sharp-cornered enterprise tool and a soft-cornered consumer app can share the same unit primitives and still diverge completely on radius. Two endpoints are universal regardless of personality: radius-pill (9999, fully-rounded) and radius-circle (50%, relative, for circular elements). One worked ladder between 0 and those endpoints lands in udts-spacing-defaults once that stub stabilizes.
Naming: T-shirt OR numeric
Emit both sets of names and let consumers pick the family that fits their codebase convention:
| T-shirt | Numeric | px (balanced) |
padding-2xs | space-1 | 4 |
padding-xs | space-2 | 8 |
padding-sm | space-3 | 12 |
padding-md | space-4 | 16 |
padding-lg | space-5 | 24 |
padding-xl | space-6 | 32 |
padding-2xl | space-7 | 48 |
padding-3xl | space-8 | 64 |
Emit both in DTCG with cross-aliases. Pick the family that fits your codebase, not "the correct one" — there isn't one.
The WCAG 2.5.8 AA Pointer Target floor
Any interactive control's minimum height is 24 CSS px for AA conformance. The smallest rung in the component-height ladder is reserved for non-interactive elements (badges, read-only chips, density tags); interactive controls start at the first rung that clears the 24 px floor.
Failing this is one of the most common WCAG 2.2 misses in design systems. The skill exists partly to make the rule load-bearing.
Verification
After picking unit primitives + emitting ladders:
- Divisibility:
major mod minor == 0. If not, the system is malformed. - Grid alignment: every padding, gap, and component-height token is a multiple of the minor unit.
- Pointer target: every interactive component-height rung is ≥ 24 CSS px.
- Naming sync: if both T-shirt and numeric families are emitted, every value has a matching pair in both. No orphans.
- Icon-size curation: icon sizes match component-sizing-principles's curated set, not a formula output.
Cross-references
- Routed here by: designing-a-design-system — the L1 dispatcher for building or extending a system.
- REQUIRED BACKGROUND for height + font + icon pairing: component-sizing-principles — the curated per-density component-height ladder + font-pairing + icon-size pairing.
- For the typography scale that pairs with spacing: type-scale and line-height-grid — line-heights snap to the minor unit declared here.
- For one system's concrete density-mode unit choices (worked example): udts-spacing-defaults — an incubating L2 stub that instantiates this model.
Sources
- WCAG 2.5.8 — Target Size (AA, added in 2.2) — the 24 CSS px floor.
- One system's concrete density-mode unit choices: udts-spacing-defaults (incubating).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

