Skip to content

Search the guides, deployment pages, and API reference.

@pitlane/theme/schema

Token schemas: one factory per token type, plus scale, any, and group. Each factory returns a remix/data-schema schema tagged with the token type it declares, so the same value both validates a token and names the brand its accessor leaf carries.

Designed for a namespace import, the way remix/data-schema ships its own string() and object():

import * as s from "@pitlane/theme/schema";
let schema = { color: s.color(), spacing: s.scale() };

See

Theme guide: Choose schemas

Interfaces

  • SchemaGroup. A schema group: per-child schemas, optionally under a schema for the node itself. group builds one; a plain object literal is the children-only form.
  • TokenSchema. A remix/data-schema schema that also names the token type it declares. Every factory in this module returns one.

Type Aliases

Variables

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

Functions

  • any. A token with no type. Its value is emitted verbatim and its accessor leaf brands as a plain string, which the open-grammar CSS properties accept and the token-mapped longhands still reject.
  • border. A border token. Accepts CSS border shorthand text.
  • color. A color token. Accepts any CSS color, including light-dark(), color-mix(), and currentColor, plus DTCG's structured form.
  • dimension. A dimension token. Accepts any CSS length, including clamp(), calc(), %, and em.
  • duration. A duration token. Accepts ms, s, and calc().
  • easing. A cubicBezier token, named for the CSS property it feeds. Accepts a four-number tuple or cubic-bezier(…) text.
  • gradient. A gradient token. Accepts CSS gradient function text.
  • group. A node that is itself typed and also carries per-child overrides. self applies to that node and to every descendant without its own entry; each key in children overrides it from there down.
  • number. A number token. Accepts a finite number, which is what unitless CSS values such as line-height and opacity take.
  • 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.
  • shadow. A shadow token. Accepts CSS shadow text, inset included.
  • stroke. A strokeStyle token, named for the CSS value it holds. Accepts a line-style keyword.
  • transition. A transition token. Accepts CSS transition shorthand text.