@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
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-schemaschema that also names the token type it declares. Every factory in this module returns one.
Type Aliases
- SchemaNode. A node in a schema tree.
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
bordertoken. Accepts CSS border shorthand text. - color. A
colortoken. Accepts any CSS color, includinglight-dark(),color-mix(), andcurrentColor, plus DTCG's structured form. - dimension. A
dimensiontoken. Accepts any CSS length, includingclamp(),calc(),%, andem. - duration. A
durationtoken. Acceptsms,s, andcalc(). - easing. A
cubicBeziertoken, named for the CSS property it feeds. Accepts a four-number tuple orcubic-bezier(…)text. - gradient. A
gradienttoken. Accepts CSS gradient function text. - group. A node that is itself typed and also carries per-child overrides.
selfapplies to that node and to every descendant without its own entry; each key inchildrenoverrides it from there down. - number. A
numbertoken. Accepts a finite number, which is what unitless CSS values such asline-heightandopacitytake. - 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
shadowtoken. Accepts CSS shadow text,insetincluded. - stroke. A
strokeStyletoken, named for the CSS value it holds. Accepts a line-style keyword. - transition. A
transitiontoken. Accepts CSS transition shorthand text.