---
title: "@pitlane/theme/schema"
description: "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."
url: "https://pitlane.tools/package/theme/schema"
---

# @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()`:

```ts
import * as s from "@pitlane/theme/schema";

let schema = { color: s.color(), spacing: s.scale() };
```

## See

[Theme guide: Choose schemas](https://pitlane.tools/guides/theme.md#choose-schemas)

## Interfaces

- [SchemaGroup](https://pitlane.tools/package/theme/schema/interface/SchemaGroup.md). A schema group: per-child schemas, optionally under a schema for the node itself. [group](https://pitlane.tools/package/theme/schema/function/group.md) builds one; a plain object literal is the children-only form.
- [TokenSchema](https://pitlane.tools/package/theme/schema/interface/TokenSchema.md). A `remix/data-schema` schema that also names the token type it declares. Every factory in this module returns one.

## Type Aliases

- [SchemaNode](https://pitlane.tools/package/theme/schema/type/SchemaNode.md). A node in a schema tree.

## Variables

- [font](https://pitlane.tools/package/theme/schema/variable/font.md). The two font token types, grouped because they share a prefix.

## Functions

- [any](https://pitlane.tools/package/theme/schema/function/any.md). 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](https://pitlane.tools/package/theme/schema/function/border.md). A `border` token. Accepts CSS border shorthand text.
- [color](https://pitlane.tools/package/theme/schema/function/color.md). A `color` token. Accepts any CSS color, including `light-dark()`, `color-mix()`, and `currentColor`, plus DTCG's structured form.
- [dimension](https://pitlane.tools/package/theme/schema/function/dimension.md). A `dimension` token. Accepts any CSS length, including `clamp()`, `calc()`, `%`, and `em`.
- [duration](https://pitlane.tools/package/theme/schema/function/duration.md). A `duration` token. Accepts `ms`, `s`, and `calc()`.
- [easing](https://pitlane.tools/package/theme/schema/function/easing.md). A `cubicBezier` token, named for the CSS property it feeds. Accepts a four-number tuple or `cubic-bezier(…)` text.
- [gradient](https://pitlane.tools/package/theme/schema/function/gradient.md). A `gradient` token. Accepts CSS gradient function text.
- [group](https://pitlane.tools/package/theme/schema/function/group.md). 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](https://pitlane.tools/package/theme/schema/function/number.md). A `number` token. Accepts a finite number, which is what unitless CSS values such as `line-height` and `opacity` take.
- [scale](https://pitlane.tools/package/theme/schema/function/scale.md). 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](https://pitlane.tools/package/theme/schema/function/shadow.md). A `shadow` token. Accepts CSS shadow text, `inset` included.
- [stroke](https://pitlane.tools/package/theme/schema/function/stroke.md). A `strokeStyle` token, named for the CSS value it holds. Accepts a line-style keyword.
- [transition](https://pitlane.tools/package/theme/schema/function/transition.md). A `transition` token. Accepts CSS transition shorthand text.
