Spacing scale
build_spacing_scaleGenerate spacing tokens from a base unit. Pass base (px, default 8) and one of: nothing (linear 4/8-point ladder: half step, 1x, 1.5x, 2x, 3x, 4x, 5x, 6x, 8x ...), ratio (modular: base times ratio to the power n, starting at the base), or steps (your own list of px values). count sets the token count (default 10, max 18 for linear and 24 for modular). Each token returns px, rem at 16px, a usage line (hairline gap, inside a component, component padding, between siblings, between groups, between sections), and a flag when the value is not a whole multiple of the base or is a fractional pixel. Also returns CSS custom properties in rem and in px, with an optional prefix (default space). Sources: Samara, Making and Breaking the Grid (consistent units); Graver and Jura, Best Practices for Graphic Designers (modular scales). The 4 or 8 point unit itself is a convention. Pure arithmetic, nothing stored.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "build_spacing_scale"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Base unit in px (default 8). | |
| count | No | How many tokens (default 10). | |
| ratio | No | Modular ratio, for example 1.5 or 1.25. Omit for a linear scale. | |
| steps | No | Your own step list in px, for example [4, 8, 12, 16, 24, 40]. | |
| prefix | No | Custom property prefix (default space). |