Modular type scale
modular_scaleBuild a modular type scale. Pass base (px, default 16) and ratio (a number from 1.01 to 4, or a name: minor second, major second, minor third, major third, perfect fourth, augmented fourth, perfect fifth, golden, major sixth, octave; default major third 1.25). Optional: stepsUp (default 6), stepsDown (default 2), rootPx (default 16), minViewport and maxViewport (defaults 320 and 1280), minBase and minRatio for the small-screen end of the fluid scale (default: same base, ratio pulled 20 percent toward 1). Returns each step with px, rem and a clamp() expression that interpolates linearly between the two viewports, plus fixed and fluid CSS custom properties. The ratio names come from music intervals and are a web design convention, not a law; Bringhurst, The Elements of Typographic Style, discusses scales of related sizes. Pure calculation, nothing is 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": "modular_scale"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Body size in px (8 to 64, default 16). | |
| ratio | No | A number (1.01 to 4) or a name such as "major third", "perfect fourth", "golden". Default major third. | |
| rootPx | No | Root font size for rem conversion (default 16). | |
| minBase | No | Base size at the small viewport (default same as base). | |
| stepsUp | No | Steps above the base (0 to 12, default 6). | |
| minRatio | No | Ratio at the small viewport, number or name (default: 20 percent closer to 1 than ratio). | |
| stepsDown | No | Steps below the base (0 to 6, default 2). | |
| maxViewport | No | Viewport width in px where the fluid scale reaches full size (default 1280). | |
| minViewport | No | Viewport width in px where the fluid scale uses its small values (default 320). |