Spacing Token Designer
A list of spacing values alone does not show whether a button becomes crowded or a card wastes room. Enter six spacing steps at minimum and maximum viewport widths, and check for zero, negative, out-of-order or shrinking values. Set minimum content width and content height for each button, field, list row and card sample. Intermediate sizes are linearly interpolated. Compare compact and comfortable assignments across the four components, including your sample requirements and a 44px minimum touch height. Export CSS rules and a JSON plan. Width warnings use your planning thresholds; test real labels, fonts, browser zoom and accessibility in the finished product.
Key features
- Fixed zero token plus six positive, ordered and non-shrinking steps
- Editable minimum content width and height for four component samples
- Spacing and density audit at minimum, midpoint and maximum viewport widths
- Compact and comfortable previews with 44px touch-height signals
- Copy or download CSS clamp tokens, or download the settings as JSON
How to use
- Set minimum and maximum viewport widths and enter spacing steps 1–6 in pixels at each bound.
- Set each component sample’s minimum content width and content height.
- Resolve invalid viewport, step or sample values.
- Review the width table and switch between compact and comfortable component density.
- Change the preview width and inspect touch-height and content-width signals.
- Copy or download CSS, or download JSON; then test with real labels and browser zoom.
Use cases
- Organize recurring gaps in a design system
- Compare mobile and desktop form and list density
- Spot cramped buttons and cards before building the final interface
Frequently asked questions
Why can I not edit the zero step?
--space-0 is fixed at zero for elements that need no gap. Each of the other six steps must be positive and larger than the preceding step.
How do values change between viewport bounds?
The corresponding values at the two bounds are linearly interpolated. At the default 16px root, CSS clamp holds a bound value outside the configured interval.
What changes between compact and comfortable density?
Both use the same spacing scale. They assign different token steps to padding and gaps for button, field, list and card components. The exported CSS includes both.
Does the minimum height guarantee an accessible touch target?
The sample button, field and row rules have a 44px CSS minimum height. Verify the actual clickable area, text wrapping and zoom settings in the finished interface.
Is a content-width warning a measured overflow error?
No. It compares calculated inner width with the minimum content width you enter for each sample. Real text, icons and font metrics may need a different width.
Privacy
The settings and CSS calculations stay in your browser. This tool does not submit them to a server API.
Comments & questions