Skip to content

Search the guides, deployment pages, and API reference.

scale

import { scale } from "@pitlane/theme/schema";
function scale(): TokenSchema<"scale">;

A dimension token whose accessor leaf is a multiplier rather than a value. The token emits its own custom property; the accessor leaf is callable, and carries the base itself as .token.

This is Tailwind's --spacing: one base that the whole scale multiplies, with no named steps.

Returns

TokenSchema<"scale">

A schema declaring a scale token

Example

let theme = createTheme({
schema: { spacing: s.scale() },
tokens: { spacing: "0.25rem" },
});
theme.token.spacing(4); // "calc(var(--spacing) * 4)"
theme.token.spacing.token; // "var(--spacing)"