Schemas / v0.4
Tokens
Schema for resolved design token manifests consumed by language servers and tooling.
Example
This manifest declares a condition dimension and a collection, then two tokens.
Each token requires an id and a resolved value per condition.
The first token adds authored modes aliases, a web platform reference and
contrast data. The second is marked deprecated with a status and a
lifecycle deprecated record that points to its replacement.
{
"$schema": "https://designlasagna.recipes/schemas/v0.4/tokens.json",
"schemaVersion": "0.4.0",
"designSystem": {
"name": "Acme UI",
"version": "2.3.0"
},
"conditions": {
"colorScheme": {
"type": "colorScheme",
"values": [
"light",
"dark"
],
"default": "light"
}
},
"collections": {
"semantic": {
"name": "Semantic",
"conditions": [
"colorScheme"
],
"defaults": {
"tier": "semantic"
}
}
},
"tokens": [
{
"id": "color.action.primary",
"path": [
"color",
"action",
"primary"
],
"collection": "semantic",
"type": "color",
"description": "Background for primary actions.",
"platforms": {
"web": {
"reference": "var(--color-action-primary)"
}
},
"resolved": {
"light": "#0b5fff",
"dark": "#5b93ff"
},
"modes": {
"light": "{color.blue.500}",
"dark": "{color.blue.300}"
},
"a11y": {
"wcagContrast": {
"light": {
"ratio": 5.2,
"against": "#ffffff",
"level": "AA"
}
}
},
"keywords": [
"button",
"cta"
],
"tags": [
"interactive"
]
},
{
"id": "color.brand.legacy",
"collection": "semantic",
"type": "color",
"resolved": {
"light": "#0b5fff",
"dark": "#5b93ff"
},
"status": "deprecated",
"deprecated": {
"message": "Use color.action.primary instead.",
"removal": "2027-01-01",
"replacement": "color.action.primary"
}
}
]
}
Manifest fields
The root object is the resolved tokens manifest. Required fields are marked with *.
| Field | Type | Description |
|---|---|---|
|
|
string
|
Identifier of the schema that validates the manifest. |
|
Use when: Always set it so editors and validators can find the contract. Origin: Contract metadata; set by authors or generators. Example usage |
||
|
|
string
|
Schema version the manifest conforms to. |
|
Use when: Keep it in sync with the $schema document the manifest is validated against. Origin: Contract metadata; set by authors or generators. Related: Example usage |
||
|
|
string
|
ISO 8601 timestamp identifying the generation run that produced the manifest. |
|
Use when: Set by generators so consumers can detect and track stale manifests. Origin: Computed by analysis or build tooling. Example usage |
||
|
|
array
|
Base format that the manifest extends. |
|
Use when: Document that a manifest augments an existing standard rather than replacing it. Origin: Contract metadata; set by authors or generators. Example usage |
||
|
|
DesignSystemMeta
|
Identity of the design system the manifest describes. |
|
Use when: Help tooling label, group, and switch between design systems. Origin: Authored metadata, carried through by generators. Related: Example usage |
||
|
|
object
|
Provenance data recording where the manifest was generated from. |
|
Use when: Make generated files auditable by recording the source files and their state. Origin: Recorded by generators. Related: Example usage |
||
|
|
Counts
|
Summary counts for the manifest. |
|
Use when: Give consumers quick totals without scanning every token. Origin: Computed by generators. Example usage |
||
|
|
Conditions
|
Condition set that generated the manifest, such as themes or platforms. |
|
Use when: Document the axes a consumer can use to select resolved values. Origin: Recorded by generators. Related: Example usage |
||
|
|
Collections
|
Named token collections, with per-collection defaults. |
|
Use when: Group tokens into authored collections that tooling can present. Origin: Authored metadata, carried through by generators. Related: Example usage |
||
|
|
array
|
Relationships between tokens, such as derived tokens. |
|
Use when: Express how tokens are derived from one another so tools can navigate them. Origin: Authored metadata, carried through by generators. Related: Example usage |
||
|
|
array
|
Resolved tokens in the manifest. |
|
Use when: Provide the token data that tooling completes, documents, and consumes. Origin: Resolved by generators from authored token sources. Related: Example usage |
||
Token fields
Each item in tokens follows this shape.
| Field | Type | Description |
|---|---|---|
|
|
string
|
Stable identifier for the token. |
|
Use when: Reference the token from tooling, manifests, and relations. Origin: Stable token identity; authored or assigned by tooling. Related: Example usage |
||
|
|
array
|
Path-like identifier for the token. |
|
Use when: Locate the token within its naming hierarchy. Origin: Stable token identity; authored or assigned by tooling. Related: Example usage |
||
|
|
array
|
Path-like identifier at authoring time. |
|
Use when: Trace the token back to its original naming. Origin: Stable token identity; preserved from authored sources. Related: Example usage |
||
|
|
string
|
Human-readable label for the token. |
|
Use when: Display the token in documentation and pickers. Origin: Authored metadata. Example usage |
||
|
|
string
|
Top-level category the token belongs to. |
|
Use when: Group and filter tokens in documentation and tooling. Origin: Authored metadata; carried through by generators. Related: Example usage |
||
|
|
string, null
|
Optional subcategory within the token's category. |
|
Use when: Add finer grouping for documentation and filters. Origin: Authored metadata; carried through by generators. Related: Example usage |
||
|
|
string
|
Collection the token belongs to. |
|
Use when: Present tokens in their authored collection context. Origin: Authored metadata, carried through by generators. Related: Example usage |
||
|
|
string
|
Token tier, such as primitive or semantic. |
|
Use when: Show how abstract or application-specific a token is. Origin: Authored metadata. Example usage |
||
|
|
string, null
|
Type of the token, such as color or dimension. |
|
Use when: Drive type-aware completion and validation in tooling. Origin: Authored metadata; carried through by generators. Related: Example usage |
||
|
|
string, null
|
Human-readable description of the token. |
|
Use when: Explain what the token is for in documentation and hover text. Origin: Authored metadata. Example usage |
||
|
|
string, null
|
Deprecated in v0.3. A legacy CSS custom-property name for this token. |
|
Use when: Carry over existing CSS variable names during migration. Origin: Authored metadata; deprecated by the schema. Related: Example usage |
||
|
|
object
values: PlatformMapping
|
Platform-specific metadata for the token. |
|
Use when: Map the token to concrete implementation details per platform. Origin: Authored metadata; carried through by generators. Related: Example usage |
||
|
|
object
|
Resolved values of the token, keyed by condition. Each value is a string, a number, an object for composite values, or (since 0.4.4) an array of strings with one entry per layer, for multi-layer shadows and gradient stops. |
|
Use when: Provide the concrete values consumers render or consume. Origin: Computed by resolution tooling. Related: Example usage |
||
|
|
object
|
Explicit mode names the token supports. |
|
Use when: Tell consumers which mode variants exist. Origin: Computed by resolution tooling. Related: Example usage |
||
|
|
Format
|
Format metadata for the token, such as color space or unit. |
|
Use when: Interpret and normalize token values in tooling. Origin: Authored metadata; carried through by generators. Related: Example usage |
||
|
|
Usage
|
Usage guidance for the token. |
|
Use when: Document allowed properties, context, and anti-patterns. Origin: Authored metadata. Example usage |
||
|
|
A11y
|
Accessibility guidance for the token. |
|
Use when: Record contrast, target size, and motion-safety guidance. Origin: Authored metadata. Related: Example usage |
||
|
|
integer
|
Priority or importance of the token. |
|
Use when: Order tokens in documentation and tooling output. Origin: Authored metadata. Example usage |
||
|
|
string
|
Version when the token was introduced. |
|
Use when: Show when the token entered the design system. Origin: Authored metadata; maintained over time. Example usage |
||
|
|
lifecycle.json#/definitions/Status
|
Lifecycle status for the token; 'deprecated' and 'removed' are normative, other values are informational. |
|
Use when: Declare the normative lifecycle state of the token, or carry informational states such as 'experimental'. Origin: Authored metadata. Related: Example usage |
||
|
|
array
|
Keywords for search and discovery. |
|
Use when: Improve token search in documentation and tooling. Origin: Authored metadata. Example usage |
||
|
|
Docs
|
Links to documentation and related resources. |
|
Use when: Point consumers to deeper references and tools. Origin: Authored metadata. Example usage |
||
|
|
lifecycle.json#/definitions/NativeDeprecation
|
Deprecation record from the shared v0.4 lifecycle fragment; may be false, null, or a record with a message. |
|
Use when: Guide consumers away from a token while it remains available, recording its replacement and removal target. Origin: Authored metadata. Related: Example usage |
||
|
|
array
|
Free-form tags for filtering and classification. |
|
Use when: Group tokens beyond categories for ad-hoc filters. Origin: Authored metadata. Related: Example usage |
||
|
|
array
|
Source files the token was derived from. |
|
Use when: Trace resolved data back to its authored origin. Origin: Recorded by generators. Related: Example usage |
||
|
|
object
|
Additional metadata, such as token relations. |
|
Use when: Carry structured extras the manifest schema does not model as top-level fields. Origin: Authored metadata; carried through by generators. Related: Example usage |
||
Nested definitions
Reusable shapes referenced by the fields above.
A11y
Accessibility guidance for a token, covering contrast, minimum target size, and motion safety.
| Field | Type | Description |
|---|---|---|
|
|
— | WCAG contrast guidance for the token. |
|
Use when: Record the contrast level the token must meet. Origin: Authored metadata. Related: Example usage |
||
|
|
string
|
Minimum target size guidance for the token. |
|
Use when: Record the minimum size for touch and pointer targets. Origin: Authored metadata. Related: Example usage |
||
|
|
boolean
|
Whether the token is safe under reduced-motion preferences. |
|
Use when: Flag tokens whose use must respect reduced motion. Origin: Authored metadata. Related: Example usage |
||
Collections
Named token collections, keyed by collection ID, each with optional conditions and defaults.
| Field | Type | Description |
|---|---|---|
|
|
string
|
Display name of the collection. |
|
Use when: Present the collection in documentation and tooling. Origin: Authored metadata. Example usage |
||
|
|
string
|
Human-readable description of the collection. |
|
Use when: Explain what the collection groups. Origin: Authored metadata. Example usage |
||
|
|
array
|
Conditions the collection varies by. |
|
Use when: Tell consumers which condition axes apply to the collection. Origin: Authored metadata. Related: Example usage |
||
|
|
object
|
Default condition values for the collection. |
|
Use when: State the values that apply when none are selected. Origin: Authored metadata. Related: Example usage |
||
CompositeValue
A value composed of parts, for example a font stack or a gradient.
This definition accepts type-specific keys, described in the raw schema.
Conditions
The condition set that generated the manifest, keyed by condition name.
| Field | Type | Description |
|---|---|---|
|
|
string
|
Human-readable description of the condition. |
|
Use when: Explain what the condition controls. Origin: Authored metadata. Example usage |
||
|
|
string
|
Type of the condition, such as theme or platform. |
|
Use when: Tell consumers how to interpret the condition. Origin: Authored metadata. Example usage |
||
|
|
array
|
Values the condition can take. |
|
Use when: List the selectable values for the condition. Origin: Authored metadata. Example usage |
||
|
|
string
|
Default value of the condition. |
|
Use when: State which value applies when none is selected. Origin: Authored metadata. Related: Example usage |
||
ContrastInfo
A measured contrast ratio, the reference it is measured against, and the WCAG level it meets.
| Field | Type | Description |
|---|---|---|
|
|
number
|
Measured contrast ratio for the token. |
|
Use when: Record the numeric contrast value. Origin: Computed by analysis tooling. Related: Example usage |
||
|
|
string
|
Background or reference the ratio is measured against. |
|
Use when: State what the contrast ratio is measured against. Origin: Computed by analysis tooling. Related: Example usage |
||
|
|
string
|
WCAG level the contrast meets. |
|
Use when: Record which WCAG level the ratio satisfies. Origin: Computed by analysis tooling. Related: Example usage |
||
Counts
Total counts plus per-dimension breakdowns for the manifest.
| Field | Type | Description |
|---|---|---|
|
|
integer
|
Total number of items, such as tokens. |
|
Use when: Give consumers the total without scanning the manifest. Origin: Computed by generators. Example usage |
||
|
|
object
|
Counts grouped by a dimension, such as type or category. |
|
Use when: Summarize the manifest by each dimension. Origin: Computed by generators. Related: Example usage |
||
Deprecated
Deprecation record for a native manifest entity; defined in the shared lifecycle fragment (lifecycle.json) and referenced from this schema, permissive of unknown properties.
lifecycle.json#/definitions/Deprecated
DesignSystemMeta
Identity and packaging metadata for the design system the manifest describes.
| Field | Type | Description |
|---|---|---|
|
|
string
|
Display name of the design system. |
|
Use when: Identify the design system in documentation and tooling. Origin: Authored metadata. Example usage |
||
|
|
string
|
Version of the design system. |
|
Use when: Track which design-system version a manifest describes. Origin: Authored metadata; maintained with releases. Example usage |
||
|
|
string
|
Documentation links for the design system. |
|
Use when: Point consumers to the design system's documentation. Origin: Authored metadata. Example usage |
||
|
|
string
|
Package identifier of the design system. |
|
Use when: Map the manifest to its published package. Origin: Authored metadata. Example usage |
||
|
|
object
|
Documentation template configuration. |
|
Use when: Configure how documentation is generated from the design system. Origin: Authored metadata. Example usage |
||
Docs
Documentation and design-tool links for a token.
| Field | Type | Description |
|---|---|---|
|
|
string
|
URL of the documentation for the token. |
|
Use when: Link to the token's documentation. Origin: Authored metadata. Related: Example usage |
||
|
|
string
|
Figma file or node link for the token. |
|
Use when: Point to the design source in Figma. Origin: Authored metadata. Related: Example usage |
||
|
|
string
|
Storybook link for the token. |
|
Use when: Point to live examples in Storybook. Origin: Authored metadata. Related: Example usage |
||
Format
Format metadata for a token, such as its color space or unit.
| Field | Type | Description |
|---|---|---|
|
|
string
|
Color space for color tokens. |
|
Use when: Interpret color values in tooling. Origin: Authored metadata. Related: Example usage |
||
|
|
string
|
Unit for dimension-like tokens. |
|
Use when: Interpret numeric values in tooling. Origin: Authored metadata. Related: Example usage |
||
PlatformMapping
The platform-specific reference developers use for a token.
| Field | Type | Description |
|---|---|---|
|
|
string
|
Platform-specific identifier developers use for the token. |
|
Use when: Map the token to the concrete identifier on a platform. Origin: Authored metadata; carried through by generators. Related: Example usage |
||
TokenRelation
A named relationship between tokens, such as a derived token.
| Field | Type | Description |
|---|---|---|
|
|
string
|
Type of the relationship. |
|
Use when: Classify how the related tokens are connected. Origin: Authored metadata. Related: Example usage |
||
|
|
array
|
Tokens involved in the relationship. |
|
Use when: Identify the tokens the relationship connects. Origin: Authored metadata. Related: Example usage |
||
|
|
string
|
Human-readable description of the relationship. |
|
Use when: Explain the relationship in documentation. Origin: Authored metadata. Example usage |
||
Usage
Usage guidance for a token: allowed properties, intended context, and anti-patterns.
| Field | Type | Description |
|---|---|---|
|
|
array
|
Properties the token may be used with. |
|
Use when: Constrain how tooling applies the token. Origin: Authored metadata. Related: Example usage |
||
|
|
string
|
Context in which the token is intended to be used. |
|
Use when: Guide consumers to the right usage scenario. Origin: Authored metadata. Related: Example usage |
||
|
|
array
|
Anti-patterns for the token. |
|
Use when: Warn consumers about incorrect usage. Origin: Authored metadata. Related: Example usage |
||