Skip to content

Search the guides, deployment pages, and API reference.

font

import { font } from "@pitlane/theme/schema";
font: object;

The two font token types, grouped because they share a prefix.

font.family() accepts a font stack, as a string or an array of names; an array joins with commas and quotes what needs quoting. font.weight() accepts 1 to 1000 or one of DTCG's nineteen keywords, and emits the number.

Type Declaration

family()

family(): TokenSchema<"fontFamily">;

A fontFamily token: a font stack as a string, or an array of names joined with commas.

Returns

TokenSchema<"fontFamily">

weight()

weight(): TokenSchema<"fontWeight">;

A fontWeight token: 1 to 1000 or a DTCG weight keyword, emitted as the number.

Returns

TokenSchema<"fontWeight">

Example

let schema = { font: s.font.family(), weight: s.font.weight() };
let tokens = { font: { sans: ["Inter var", "system-ui"] }, weight: { bold: 700 } };