Use when layout rhythm, density, or gaps feel arbitrary or inconsistent, or when one product needs different reading pressures without splitting into unrelated spacing systems.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Spacing System?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/kyanitelabs-spacing-system)
---
name: spacing-system
description: >-
Use when layout rhythm, density, or gaps feel arbitrary or inconsistent, or when one
product needs different reading pressures without splitting into unrelated spacing
systems.
---
# Spacing System (the scale nobody owns)
Every gap uses one `--space-*` scale; relationships create composition, not arbitrary margins.
## The decision order
1. Start with the 4px-base ladder plus a 2px micro-step for dense instrumentation
(`2/4/8/12/16/24/32/48/64/96px`, with `--space-0.5` = `0.125rem` for LED/tick/keycap
gutters) and `--space-section: clamp(3rem, 2rem + 4vw, 6rem)` (always `rem`, never
px-locked clamps). An alternate bounded scale needs brief and observed-hierarchy evidence.
2. Map attachment, control, task, group, region, and chapter to visibly different steps
(roughly ≥1.5× between levels), or document a content-pressure exception.
3. Choose metronomic, syncopated, or zone-tiered rhythm from content pressure; explain it.
4. Use `gap` and strictly one-direction logical margins (`margin-block-start` or `gap`, never
mixing top and bottom margins on sibling headings/paragraphs).
## Micro-craft geometry (2026 Precision Layer)
- **2px micro-step (`--space-0.5` / `0.125rem`):** reserved for dense workstation craft
(LED matrix gutters, vernier tick offsets, compact badge padding) without breaking the 4px ladder.
- **Concentric border-radius math:** whenever a rounded control sits inside a rounded
container, set `r_inner = max(0, r_outer - pad)` (e.g., `12px` card with `8px` padding →
`4px` inner module; never nest `12px` inside `12px`).
- **Asymmetric icon + label padding:** icons carry visual negative space around their glyph
box; trim `padding-inline-start` slightly tighter than `padding-inline-end` (e.g. `10px`
start vs `14px` end) so icon+label buttons feel optically centered.
- **Hairline border-box compensation:** `1px solid` borders consume `2px` of inner height in
`border-box` controls; account for stroke width or use `inset` box-shadow hairlines when
aligning bordered and borderless controls side by side.
## Let content set the rhythm
Map operational tasks to compact predictability and editorial/narrative content to breathing
room; retain one system and explain differing roles. Use the role map first:
| Relationship | Shared token | Compact operational rhythm | Long-form editorial rhythm |
| --- | --- | --- | --- |
| attachment | `--space-1` (4px) | icon/state to its label | inline metadata pair |
| control | `--space-2/3` (8/12px) | label-to-control / inside a control | claim-to-citation / tight evidence pair |
| task | `--space-4` (16px) | repeated queue item | adjacent paragraph or evidence group |
| group | `--space-5` (24px) | task-group break | discrete finding |
| region | `--space-6/7/8` (32/48/64px) | console-region break | narrative subsection or causal pivot |
| chapter | `--space-section` (fluid) | major workflow view | major account transition |
The console may be metronomic; an account may widen at finding, subsection, and chapter
boundaries. One vocabulary, different relationships—not two scales.
## Invariants and defaults
Invariant craft: audit `margin`/`padding`/`gap`; make proximity truthful and whitespace intentional;
keep one explainable vocabulary. Ladder, clamp, separation, and rhythm are brief-dependent
defaults; rendered overrides record scale, map, and tradeoff.
## Migration and honest audit boundary
Classify every literal by relationship and apply a general nearest-step + ambiguity threshold:
- **Exact ladder hit:** replace bare literals (e.g., `16px`, `24px`, `32px`) directly with
their matching `--space-*` token.
- **Near-step (≤1px delta from a ladder step):** snap to the nearest semantic token after
verifying the visual hierarchy does not collapse.
- **Ambiguous midpoint (≥2px from both neighboring steps):** do **not** silently round;
record as `PENDING` with source location and ask or measure in context. Sole prose
exception: documented following-paragraph `1em` spacing.
Use `assets/spacing-starter.css` as fixture/start. Without a target CSS fixture, mark audit
`PENDING`, name it and the next action; never claim residual off-scale values are gone. The
ladder, map, and migration rules remain required.
## Evidence
Audit source before describing it; map each value to a role. Handoff one Markdown table with
`status`, `reason`, `remediation`, `evidence`, and `provenance`, covering `scale`, `off-scale`,
`proximity`, `rhythm`, and `handoff`. `PENDING` names missing source/next action; it blocks that
check, not placeholder proof.
## Rhythm map
Name attachment, control, task, group, region, and chapter; show compact/editorial selection
without parallel scales. Replace, justify as observed exception, or leave each arbitrary value
PENDING with source and next action.
## Authoritative self-check
Include exactly one labeled **Authoritative self-check**. It confirms ladder/clamp or evidence-backed
override, all six relationships, context selection, migration, and honest fixture boundary. Judge
reasoning/evidence, not literal starter values.
## Deliver
Deliver base, token scale, role map, context rhythm, off-scale audit, and one authoritative
self-check. `responsive-layout` owns breakpoint reflow, not scale/proximity/reading pressure;
hand it `--space-*` and the evidence table. Send control/form relationships to `component-states`
or `form-ux`, not re-decide their behavior.
## References
- `references/decision-records.md` — novel-case ADR rules.
- `assets/spacing-starter.css` — ladder, layout primitives, migration helpers.
<!-- contract:v1:start -->
## Contract (generated)
Canonical detail: [contract.json](contract.json).
- Route: An interface needs a spacing scale, content-derived rhythm, or gap consistency (+1 in contract.json); avoid: The request is only responsive reflow or component state behavior (+1 in contract.json)
- Exclude: Do not impose one uniform cadence across dissimilar content (+1 in contract.json)
- Stop / handoff: Pause when content hierarchy is absent and spacing would be arbitrary (+1 in contract.json); receives [design-system-interview, improve-existing-website, tasteroll, web-typography] -> sends [responsive-layout, component-states, form-ux]
- Output: A tokenized spacing scale and stated section-rhythm strategy tied to content hierarchy
- Evidence: `table_with_evidence` with `status`, `reason`, `remediation`, `evidence`, `provenance`.
<!-- contract:v1:end -->