goldenratio.app
v0.1.1Golden-ratio design math: spacer calculator, spacing scale, grid widths, CSS vars, Tailwind setup.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
golden_calculator Golden Calculator
The goldenratio.app Golden Calculator. Stack spacers numbered 1-11 (each is the previous x 1.618) on a left and a right side; returns whether both sides are equal and, if not, every combination of spacers that would make the shorter side match ("Try" on the site). The site starts with left = [6, 5, 6], right = [].
| Parameter | Type | Description |
|---|---|---|
left | array | Spacer numbers stacked on the left, top to bottom, e.g. [6, 5, 6]. |
right | array | Spacer numbers stacked on the right. |
golden_spacing Golden spacing scale
The golden spacing scale (spacers 1-11 plus half-N and double-N) with exact values, px and CSS variable names, as used by goldenratio.app and the tailwindcss-golden-ratio plugin. With default options it also returns the rounded cheatsheet table from goldenratio.app/#/spacing.
| Parameter | Type | Description |
|---|---|---|
prefix | Plugin prefix option, only changes tailwind_key (true = "gr-"). | |
root_font_px | number | Root font size for px conversion of rem/em values (default 16). |
spacer_base | number | theme.goldenRatio.spacerBase: the size of spacer 6 (default 1.5, as on goldenratio.app). |
spacer_unit | string | theme.goldenRatio.spacerUnit (default 'rem'). |
golden_grid Golden grid
The golden grid from goldenratio.app/#/grid: w-grp-1..11, w-grp-half-*, w-grp-double-* percentage widths, the starter .container/.row CSS, every example row from the site with its total width, and an optional check of your own row (does it add up to exactly 100%?).
| Parameter | Type | Description |
|---|---|---|
container_px | number | Also give each width in px for a row this wide. |
include_examples | boolean | Include the site example rows (default true). |
row | array | Widths to check as one row, e.g. ["5", "4"] or ["half-4", "5", "half-4"] (w-grp- prefix optional). |
golden_css_variables Golden CSS variables
The :root block of golden-ratio CSS variables (--golden-ratio-1..11, half-*, double-*, --gr) exactly as goldenratio.app ships it. Use without Tailwind.
| Parameter | Type | Description |
|---|---|---|
format | string | css (default, readable), min (one line, as in the site stylesheet) or json. |
spacer_base | number | theme.goldenRatio.spacerBase: the size of spacer 6 (default 1.5, as on goldenratio.app). |
spacer_unit | string | theme.goldenRatio.spacerUnit (default 'rem'). |
tailwind_plugin_setup tailwindcss-golden-ratio setup
How to add the tailwindcss-golden-ratio plugin (the one goldenratio.app uses): install command, tailwind.config.js, options, and the exact theme values it generates (spacing, grp widths, scale, fontSize extras, borderWidth/lineHeight) for the given options.
| Parameter | Type | Description |
|---|---|---|
prefix | theme.goldenRatio.prefix (true = "gr-"). | |
spacer_base | number | theme.goldenRatio.spacerBase: the size of spacer 6 (default 1.5, as on goldenratio.app). |
spacer_unit | string | theme.goldenRatio.spacerUnit (default 'rem'). |
use_css_vars | boolean | theme.goldenRatio.useCssVars (default true). |
golden_ratio_steps Golden ratio steps
Step any number up or down the golden ratio (x or / 1.61803398875), e.g. to pick a type scale or the next size. What the goldenratio.app Alfred workflow does.
| Parameter | Type | Description |
|---|---|---|
value * | number | Starting value, e.g. 16. |
steps_down | integer | Steps below the value (default 5). |
steps_up | integer | Steps above the value (default 5). |
unit | string | Unit suffix for the text column, e.g. "px". |