61 lines
2.1 KiB
JSON
61 lines
2.1 KiB
JSON
|
|
{
|
||
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||
|
|
"$id": "https://whynot.design/ir/schema/tokens.schema.json",
|
||
|
|
"title": "whynot IR — Design Tokens (W3C DTCG)",
|
||
|
|
"description": "ir/tokens.json adopts the W3C Design Tokens Community Group format ($value/$type) so the token layer is a standard, not a bespoke shape. NOTE: the repo's existing tokens/*.json use the older draft shape (value/type, no $); the IR extractor (T05) normalises to $-prefixed DTCG.",
|
||
|
|
"type": "object",
|
||
|
|
"$ref": "#/$defs/group",
|
||
|
|
"$defs": {
|
||
|
|
"token": {
|
||
|
|
"type": "object",
|
||
|
|
"required": ["$value"],
|
||
|
|
"properties": {
|
||
|
|
"$value": {
|
||
|
|
"description": "The token value. For type=color this is a hex/colour string; for dimension a CSS length; aliases use {group.token} reference syntax."
|
||
|
|
},
|
||
|
|
"$type": {
|
||
|
|
"type": "string",
|
||
|
|
"description": "DTCG type. May be inherited from an ancestor group.",
|
||
|
|
"enum": [
|
||
|
|
"color",
|
||
|
|
"dimension",
|
||
|
|
"fontFamily",
|
||
|
|
"fontWeight",
|
||
|
|
"duration",
|
||
|
|
"cubicBezier",
|
||
|
|
"number",
|
||
|
|
"string",
|
||
|
|
"shadow",
|
||
|
|
"border",
|
||
|
|
"typography",
|
||
|
|
"transition",
|
||
|
|
"gradient"
|
||
|
|
]
|
||
|
|
},
|
||
|
|
"$description": {
|
||
|
|
"type": "string",
|
||
|
|
"description": "Human-readable note. Carries over the `comment` field from the legacy token files."
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"$comment": "A token is any object carrying $value. Properties beyond the $-prefixed ones are disallowed at token level via the group dispatch below."
|
||
|
|
},
|
||
|
|
"group": {
|
||
|
|
"type": "object",
|
||
|
|
"description": "A DTCG group: a map of names to sub-groups or tokens. $-prefixed keys are group metadata; every other key is a child node.",
|
||
|
|
"properties": {
|
||
|
|
"$type": { "type": "string" },
|
||
|
|
"$description": { "type": "string" }
|
||
|
|
},
|
||
|
|
"patternProperties": {
|
||
|
|
"^[^$].*$": {
|
||
|
|
"oneOf": [
|
||
|
|
{ "$ref": "#/$defs/token" },
|
||
|
|
{ "$ref": "#/$defs/group" }
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"additionalProperties": false
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|