Vertical rhythm
vertical_rhythmSnap a type scale to a baseline grid. Pass baseline (px, default 8) and sizes: an array of pixel sizes, or "name:size" strings such as "h1:48" and "body:16". Optional: bodySize (default 16) and rootPx (default 16). Returns, per size, a line-height rounded to a whole number of baseline units (never under 1.1 times the size), margin-block start and end in baseline multiples, and CSS using calc(var(--baseline) * n). Preferred ratios fall as size rises (1.5 up to 18px, 1.35 up to 28px, 1.25 up to 40px, then 1.15); that curve and the margin pattern are conventions, with body leading in line with UXPin's 1.4 to 1.6 and vertical rhythm as a composition aid per Smashing's Typography Best Practices. Aligns line boxes and margins; it does not read font metrics.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sizes": "<sizes>"
},
"name": "vertical_rhythm"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sizes | Yes | Font sizes in px, or "name:size" strings, up to 30. | |
| rootPx | No | Root font size for rem output (default 16). | |
| baseline | No | Baseline unit in px (2 to 48, default 8). | |
| bodySize | No | Body font size in px (default 16). |