@design-token-kit/core 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +159 -159
- package/README.md +57 -57
- package/lib/schemas/2025.10/format/group.json +55 -55
- package/lib/schemas/2025.10/format/groupOrToken.json +15 -15
- package/lib/schemas/2025.10/format/token.json +425 -425
- package/lib/schemas/2025.10/format/tokenType.json +23 -23
- package/lib/schemas/2025.10/format/values/border.json +45 -45
- package/lib/schemas/2025.10/format/values/color.json +515 -515
- package/lib/schemas/2025.10/format/values/cubicBezier.json +57 -57
- package/lib/schemas/2025.10/format/values/dimension.json +35 -35
- package/lib/schemas/2025.10/format/values/duration.json +35 -35
- package/lib/schemas/2025.10/format/values/fontFamily.json +34 -34
- package/lib/schemas/2025.10/format/values/fontWeight.json +39 -39
- package/lib/schemas/2025.10/format/values/gradient.json +53 -53
- package/lib/schemas/2025.10/format/values/number.json +8 -8
- package/lib/schemas/2025.10/format/values/shadow.json +103 -103
- package/lib/schemas/2025.10/format/values/strokeStyle.json +64 -64
- package/lib/schemas/2025.10/format/values/transition.json +45 -45
- package/lib/schemas/2025.10/format/values/typography.json +73 -73
- package/lib/schemas/2025.10/format.json +106 -106
- package/lib/schemas/2025.10/resolver/modifier.json +85 -85
- package/lib/schemas/2025.10/resolver/resolutionOrder.json +117 -117
- package/lib/schemas/2025.10/resolver/set.json +71 -71
- package/lib/schemas/2025.10/resolver.json +62 -62
- package/lib/schemas/hrdt-tokens.json +533 -533
- package/package.json +1 -1
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://www.designtokens.org/schemas/2025.10/format.json",
|
|
4
|
-
"title": "DTCG Format Schema",
|
|
5
|
-
"description": "JSON Schema for the Design Tokens Community Group (DTCG) Format specification.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"$schema": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"format": "uri-reference",
|
|
11
|
-
"description": "URI reference to this JSON schema.",
|
|
12
|
-
"$comment": "$schema is not part of the official DTCG specification."
|
|
13
|
-
},
|
|
14
|
-
"$type": {
|
|
15
|
-
"$ref": "format/tokenType.json",
|
|
16
|
-
"description": "The type for tokens in this group (inherited by nested tokens unless overridden)"
|
|
17
|
-
},
|
|
18
|
-
"$description": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"description": "A plain text description of the group"
|
|
21
|
-
},
|
|
22
|
-
"$extensions": {
|
|
23
|
-
"type": "object",
|
|
24
|
-
"description": "Vendor-specific extensions"
|
|
25
|
-
},
|
|
26
|
-
"$extends": {
|
|
27
|
-
"oneOf": [
|
|
28
|
-
{
|
|
29
|
-
"$ref": "#/definitions/curlyBraceReference"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"$ref": "#/definitions/jsonPointerReference"
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"description": "Reference to another group to inherit tokens and properties from"
|
|
36
|
-
},
|
|
37
|
-
"$deprecated": {
|
|
38
|
-
"oneOf": [
|
|
39
|
-
{
|
|
40
|
-
"type": "boolean"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"type": "string"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
"description": "Whether this group is deprecated"
|
|
47
|
-
},
|
|
48
|
-
"$root": {
|
|
49
|
-
"description": "Root token for this group. The $root token provides a base value for the group while allowing for variants or extensions.",
|
|
50
|
-
"$ref": "format/token.json"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"patternProperties": {
|
|
54
|
-
"^[^${}.][^{}.]*$": {
|
|
55
|
-
"description": "Nested groups and tokens (see #/definitions/tokenOrGroupName for pattern definition)",
|
|
56
|
-
"$ref": "format/groupOrToken.json"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"additionalProperties": false,
|
|
60
|
-
"definitions": {
|
|
61
|
-
"tokenOrGroupName": {
|
|
62
|
-
"title": "Token or Group Name",
|
|
63
|
-
"type": "string",
|
|
64
|
-
"pattern": "^[^${}.][^{}.]*$",
|
|
65
|
-
"description": "Valid token/group names: must not start with $ and must not contain {, }, or ."
|
|
66
|
-
},
|
|
67
|
-
"curlyBraceReference": {
|
|
68
|
-
"title": "Curly Brace Reference",
|
|
69
|
-
"type": "string",
|
|
70
|
-
"pattern": "^\\{[^${}.][^{}.]*(\\.[^${}.][^{}.]*)*\\}$",
|
|
71
|
-
"description": "Curly brace reference (e.g., '{tokenName}' or '{group.nested.token}')"
|
|
72
|
-
},
|
|
73
|
-
"jsonPointerReference": {
|
|
74
|
-
"title": "JSON Pointer Reference",
|
|
75
|
-
"type": "string",
|
|
76
|
-
"pattern": "^#/",
|
|
77
|
-
"format": "json-pointer-uri-fragment",
|
|
78
|
-
"description": "JSON Pointer reference (RFC 6901) to a location in the document (e.g., '#/path/to/target')"
|
|
79
|
-
},
|
|
80
|
-
"jsonPointerReferenceObject": {
|
|
81
|
-
"title": "JSON Pointer Reference Object",
|
|
82
|
-
"type": "object",
|
|
83
|
-
"properties": {
|
|
84
|
-
"$ref": {
|
|
85
|
-
"$ref": "#/definitions/jsonPointerReference"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"required": ["$ref"],
|
|
89
|
-
"additionalProperties": false,
|
|
90
|
-
"description": "Object containing a JSON Pointer reference for property-level references"
|
|
91
|
-
},
|
|
92
|
-
"tokenValueReference": {
|
|
93
|
-
"title": "Token Value Reference",
|
|
94
|
-
"oneOf": [
|
|
95
|
-
{
|
|
96
|
-
"$ref": "#/definitions/curlyBraceReference"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"$ref": "#/definitions/jsonPointerReferenceObject"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
"description": "A reference to a token value using either curly brace syntax or JSON Pointer syntax"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://www.designtokens.org/schemas/2025.10/format.json",
|
|
4
|
+
"title": "DTCG Format Schema",
|
|
5
|
+
"description": "JSON Schema for the Design Tokens Community Group (DTCG) Format specification.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"$schema": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"format": "uri-reference",
|
|
11
|
+
"description": "URI reference to this JSON schema.",
|
|
12
|
+
"$comment": "$schema is not part of the official DTCG specification."
|
|
13
|
+
},
|
|
14
|
+
"$type": {
|
|
15
|
+
"$ref": "format/tokenType.json",
|
|
16
|
+
"description": "The type for tokens in this group (inherited by nested tokens unless overridden)"
|
|
17
|
+
},
|
|
18
|
+
"$description": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "A plain text description of the group"
|
|
21
|
+
},
|
|
22
|
+
"$extensions": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"description": "Vendor-specific extensions"
|
|
25
|
+
},
|
|
26
|
+
"$extends": {
|
|
27
|
+
"oneOf": [
|
|
28
|
+
{
|
|
29
|
+
"$ref": "#/definitions/curlyBraceReference"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"$ref": "#/definitions/jsonPointerReference"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"description": "Reference to another group to inherit tokens and properties from"
|
|
36
|
+
},
|
|
37
|
+
"$deprecated": {
|
|
38
|
+
"oneOf": [
|
|
39
|
+
{
|
|
40
|
+
"type": "boolean"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "string"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"description": "Whether this group is deprecated"
|
|
47
|
+
},
|
|
48
|
+
"$root": {
|
|
49
|
+
"description": "Root token for this group. The $root token provides a base value for the group while allowing for variants or extensions.",
|
|
50
|
+
"$ref": "format/token.json"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"patternProperties": {
|
|
54
|
+
"^[^${}.][^{}.]*$": {
|
|
55
|
+
"description": "Nested groups and tokens (see #/definitions/tokenOrGroupName for pattern definition)",
|
|
56
|
+
"$ref": "format/groupOrToken.json"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"definitions": {
|
|
61
|
+
"tokenOrGroupName": {
|
|
62
|
+
"title": "Token or Group Name",
|
|
63
|
+
"type": "string",
|
|
64
|
+
"pattern": "^[^${}.][^{}.]*$",
|
|
65
|
+
"description": "Valid token/group names: must not start with $ and must not contain {, }, or ."
|
|
66
|
+
},
|
|
67
|
+
"curlyBraceReference": {
|
|
68
|
+
"title": "Curly Brace Reference",
|
|
69
|
+
"type": "string",
|
|
70
|
+
"pattern": "^\\{[^${}.][^{}.]*(\\.[^${}.][^{}.]*)*\\}$",
|
|
71
|
+
"description": "Curly brace reference (e.g., '{tokenName}' or '{group.nested.token}')"
|
|
72
|
+
},
|
|
73
|
+
"jsonPointerReference": {
|
|
74
|
+
"title": "JSON Pointer Reference",
|
|
75
|
+
"type": "string",
|
|
76
|
+
"pattern": "^#/",
|
|
77
|
+
"format": "json-pointer-uri-fragment",
|
|
78
|
+
"description": "JSON Pointer reference (RFC 6901) to a location in the document (e.g., '#/path/to/target')"
|
|
79
|
+
},
|
|
80
|
+
"jsonPointerReferenceObject": {
|
|
81
|
+
"title": "JSON Pointer Reference Object",
|
|
82
|
+
"type": "object",
|
|
83
|
+
"properties": {
|
|
84
|
+
"$ref": {
|
|
85
|
+
"$ref": "#/definitions/jsonPointerReference"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"required": ["$ref"],
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"description": "Object containing a JSON Pointer reference for property-level references"
|
|
91
|
+
},
|
|
92
|
+
"tokenValueReference": {
|
|
93
|
+
"title": "Token Value Reference",
|
|
94
|
+
"oneOf": [
|
|
95
|
+
{
|
|
96
|
+
"$ref": "#/definitions/curlyBraceReference"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"$ref": "#/definitions/jsonPointerReferenceObject"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"description": "A reference to a token value using either curly brace syntax or JSON Pointer syntax"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://www.designtokens.org/schemas/2025.10/resolver/modifier.json",
|
|
4
|
-
"title": "Modifier",
|
|
5
|
-
"description": "A modifier is similar to a set, but allows for conditional inclusion via the contexts map. A modifier MUST declare a contexts map of string values to arrays of token sources.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"required": ["contexts"],
|
|
8
|
-
"additionalProperties": false,
|
|
9
|
-
"properties": {
|
|
10
|
-
"description": {
|
|
11
|
-
"title": "Description",
|
|
12
|
-
"type": "string",
|
|
13
|
-
"description": "A human-readable description of the purpose of the modifier."
|
|
14
|
-
},
|
|
15
|
-
"contexts": {
|
|
16
|
-
"title": "Contexts",
|
|
17
|
-
"type": "object",
|
|
18
|
-
"description": "A map of context names to arrays of token sources. Each context represents a possible variant (e.g., 'light' vs 'dark' for theme, 'small' vs 'large' for size).",
|
|
19
|
-
"minProperties": 2,
|
|
20
|
-
"patternProperties": {
|
|
21
|
-
"^.+$": {
|
|
22
|
-
"$ref": "#/definitions/tokenSourcesForModifiers",
|
|
23
|
-
"description": "An array of token sources for this context. Can contain reference objects pointing to JSON files, inline token definitions, or any combination. If the array declares multiple sources, they will be merged in array order, meaning if a token is declared multiple times, the last occurrence in the array will be the final value."
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"additionalProperties": false
|
|
27
|
-
},
|
|
28
|
-
"default": {
|
|
29
|
-
"title": "Default Context",
|
|
30
|
-
"type": "string",
|
|
31
|
-
"description": "An optional default value that MUST match one of the keys in contexts. If provided, tools will use this context when no input is provided for this modifier.",
|
|
32
|
-
"$comment": "JSON Schema cannot validate that this value matches a key in 'contexts'. This validation must be performed at runtime by the implementation."
|
|
33
|
-
},
|
|
34
|
-
"$extensions": {
|
|
35
|
-
"title": "Extensions",
|
|
36
|
-
"type": "object",
|
|
37
|
-
"description": "Vendor-specific extensions. Keys are vendor-specific namespaces."
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"definitions": {
|
|
41
|
-
"referenceObjectForModifiers": {
|
|
42
|
-
"title": "Reference Object (For Modifiers)",
|
|
43
|
-
"type": "object",
|
|
44
|
-
"required": ["$ref"],
|
|
45
|
-
"properties": {
|
|
46
|
-
"$ref": {
|
|
47
|
-
"title": "JSON Reference",
|
|
48
|
-
"type": "string",
|
|
49
|
-
"format": "uri-reference",
|
|
50
|
-
"description": "A JSON Pointer (RFC 6901) or URI reference. Modifiers MUST NOT reference other modifiers (#/modifiers/...) or resolutionOrder items (#/resolutionOrder/...).",
|
|
51
|
-
"not": {
|
|
52
|
-
"anyOf": [
|
|
53
|
-
{
|
|
54
|
-
"pattern": "^#/modifiers/",
|
|
55
|
-
"$comment": "Modifiers cannot reference other modifiers"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"pattern": "^#/resolutionOrder/",
|
|
59
|
-
"$comment": "Nothing can reference resolutionOrder items"
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"description": "A reference object for use within modifier contexts. Cannot point to other modifiers or resolutionOrder items."
|
|
66
|
-
},
|
|
67
|
-
"tokenSourcesForModifiers": {
|
|
68
|
-
"title": "Token Sources (For Modifiers)",
|
|
69
|
-
"type": "array",
|
|
70
|
-
"description": "An array of token sources for modifier contexts - can reference sets but not other modifiers or resolutionOrder items.",
|
|
71
|
-
"items": {
|
|
72
|
-
"oneOf": [
|
|
73
|
-
{
|
|
74
|
-
"$ref": "#/definitions/referenceObjectForModifiers"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"$ref": "../format.json",
|
|
78
|
-
"description": "Inline design tokens in DTCG format"
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://www.designtokens.org/schemas/2025.10/resolver/modifier.json",
|
|
4
|
+
"title": "Modifier",
|
|
5
|
+
"description": "A modifier is similar to a set, but allows for conditional inclusion via the contexts map. A modifier MUST declare a contexts map of string values to arrays of token sources.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["contexts"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"description": {
|
|
11
|
+
"title": "Description",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "A human-readable description of the purpose of the modifier."
|
|
14
|
+
},
|
|
15
|
+
"contexts": {
|
|
16
|
+
"title": "Contexts",
|
|
17
|
+
"type": "object",
|
|
18
|
+
"description": "A map of context names to arrays of token sources. Each context represents a possible variant (e.g., 'light' vs 'dark' for theme, 'small' vs 'large' for size).",
|
|
19
|
+
"minProperties": 2,
|
|
20
|
+
"patternProperties": {
|
|
21
|
+
"^.+$": {
|
|
22
|
+
"$ref": "#/definitions/tokenSourcesForModifiers",
|
|
23
|
+
"description": "An array of token sources for this context. Can contain reference objects pointing to JSON files, inline token definitions, or any combination. If the array declares multiple sources, they will be merged in array order, meaning if a token is declared multiple times, the last occurrence in the array will be the final value."
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"additionalProperties": false
|
|
27
|
+
},
|
|
28
|
+
"default": {
|
|
29
|
+
"title": "Default Context",
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "An optional default value that MUST match one of the keys in contexts. If provided, tools will use this context when no input is provided for this modifier.",
|
|
32
|
+
"$comment": "JSON Schema cannot validate that this value matches a key in 'contexts'. This validation must be performed at runtime by the implementation."
|
|
33
|
+
},
|
|
34
|
+
"$extensions": {
|
|
35
|
+
"title": "Extensions",
|
|
36
|
+
"type": "object",
|
|
37
|
+
"description": "Vendor-specific extensions. Keys are vendor-specific namespaces."
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"definitions": {
|
|
41
|
+
"referenceObjectForModifiers": {
|
|
42
|
+
"title": "Reference Object (For Modifiers)",
|
|
43
|
+
"type": "object",
|
|
44
|
+
"required": ["$ref"],
|
|
45
|
+
"properties": {
|
|
46
|
+
"$ref": {
|
|
47
|
+
"title": "JSON Reference",
|
|
48
|
+
"type": "string",
|
|
49
|
+
"format": "uri-reference",
|
|
50
|
+
"description": "A JSON Pointer (RFC 6901) or URI reference. Modifiers MUST NOT reference other modifiers (#/modifiers/...) or resolutionOrder items (#/resolutionOrder/...).",
|
|
51
|
+
"not": {
|
|
52
|
+
"anyOf": [
|
|
53
|
+
{
|
|
54
|
+
"pattern": "^#/modifiers/",
|
|
55
|
+
"$comment": "Modifiers cannot reference other modifiers"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"pattern": "^#/resolutionOrder/",
|
|
59
|
+
"$comment": "Nothing can reference resolutionOrder items"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"description": "A reference object for use within modifier contexts. Cannot point to other modifiers or resolutionOrder items."
|
|
66
|
+
},
|
|
67
|
+
"tokenSourcesForModifiers": {
|
|
68
|
+
"title": "Token Sources (For Modifiers)",
|
|
69
|
+
"type": "array",
|
|
70
|
+
"description": "An array of token sources for modifier contexts - can reference sets but not other modifiers or resolutionOrder items.",
|
|
71
|
+
"items": {
|
|
72
|
+
"oneOf": [
|
|
73
|
+
{
|
|
74
|
+
"$ref": "#/definitions/referenceObjectForModifiers"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"$ref": "../format.json",
|
|
78
|
+
"description": "Inline design tokens in DTCG format"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://www.designtokens.org/schemas/2025.10/resolver/resolutionOrder.json",
|
|
4
|
-
"title": "Resolution Order",
|
|
5
|
-
"description": "An ordered array of sets and modifiers that determines the final resolution of tokens. Order is significant - tokens later in the array override earlier ones in case of conflict.",
|
|
6
|
-
"type": "array",
|
|
7
|
-
"minItems": 1,
|
|
8
|
-
"items": {
|
|
9
|
-
"oneOf": [
|
|
10
|
-
{
|
|
11
|
-
"title": "Reference Object (For Resolution Order)",
|
|
12
|
-
"type": "object",
|
|
13
|
-
"required": ["$ref"],
|
|
14
|
-
"properties": {
|
|
15
|
-
"$ref": {
|
|
16
|
-
"title": "JSON Reference",
|
|
17
|
-
"type": "string",
|
|
18
|
-
"format": "uri-reference",
|
|
19
|
-
"description": "A JSON Pointer (RFC 6901) or URI reference. Must point to a set (#/sets/...) or modifier (#/modifiers/...), never to resolutionOrder items (#/resolutionOrder/...).",
|
|
20
|
-
"not": {
|
|
21
|
-
"pattern": "^#/resolutionOrder/",
|
|
22
|
-
"$comment": "ResolutionOrder cannot reference items within itself"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"description": "A reference object for use within resolutionOrder. Can point to sets or modifiers but not other resolutionOrder items."
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"title": "Inline Set",
|
|
30
|
-
"description": "A set defined inline in the resolutionOrder array. Must include 'name' and 'type' properties.",
|
|
31
|
-
"type": "object",
|
|
32
|
-
"required": ["sources", "name", "type"],
|
|
33
|
-
"properties": {
|
|
34
|
-
"description": {
|
|
35
|
-
"title": "Description",
|
|
36
|
-
"type": "string",
|
|
37
|
-
"description": "A human-readable description of the purpose of the set."
|
|
38
|
-
},
|
|
39
|
-
"sources": {
|
|
40
|
-
"title": "Sources",
|
|
41
|
-
"$ref": "set.json#/definitions/tokenSourcesForSets",
|
|
42
|
-
"description": "An array of token sources. Can contain reference objects pointing to JSON files, inline token definitions, or any combination. If the array declares multiple sources, they will be merged in array order, meaning if a token is declared multiple times, the last occurrence in the array will be the final value."
|
|
43
|
-
},
|
|
44
|
-
"$extensions": {
|
|
45
|
-
"title": "Extensions",
|
|
46
|
-
"type": "object",
|
|
47
|
-
"description": "Vendor-specific extensions. Keys are vendor-specific namespaces."
|
|
48
|
-
},
|
|
49
|
-
"name": {
|
|
50
|
-
"title": "Name",
|
|
51
|
-
"type": "string",
|
|
52
|
-
"description": "A unique name that MUST NOT conflict with any other name in resolutionOrder.",
|
|
53
|
-
"$comment": "Uniqueness must be validated at runtime as JSON Schema cannot validate uniqueness across array items."
|
|
54
|
-
},
|
|
55
|
-
"type": {
|
|
56
|
-
"title": "Type",
|
|
57
|
-
"type": "string",
|
|
58
|
-
"const": "set",
|
|
59
|
-
"description": "MUST be 'set' for inline set definitions."
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"additionalProperties": false
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"title": "Inline Modifier",
|
|
66
|
-
"description": "A modifier defined inline in the resolutionOrder array. Must include 'name' and 'type' properties.",
|
|
67
|
-
"type": "object",
|
|
68
|
-
"required": ["contexts", "name", "type"],
|
|
69
|
-
"properties": {
|
|
70
|
-
"description": {
|
|
71
|
-
"title": "Description",
|
|
72
|
-
"type": "string",
|
|
73
|
-
"description": "A human-readable description of the purpose of the modifier."
|
|
74
|
-
},
|
|
75
|
-
"contexts": {
|
|
76
|
-
"title": "Contexts",
|
|
77
|
-
"type": "object",
|
|
78
|
-
"description": "A map of context names to arrays of token sources. Each context represents a possible variant (e.g., 'light' vs 'dark' for theme, 'small' vs 'large' for size).",
|
|
79
|
-
"minProperties": 2,
|
|
80
|
-
"patternProperties": {
|
|
81
|
-
"^.+$": {
|
|
82
|
-
"$ref": "modifier.json#/definitions/tokenSourcesForModifiers",
|
|
83
|
-
"description": "An array of token sources for this context. Can contain reference objects pointing to JSON files, inline token definitions, or any combination. If the array declares multiple sources, they will be merged in array order, meaning if a token is declared multiple times, the last occurrence in the array will be the final value."
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
"additionalProperties": false
|
|
87
|
-
},
|
|
88
|
-
"default": {
|
|
89
|
-
"title": "Default Context",
|
|
90
|
-
"type": "string",
|
|
91
|
-
"description": "An optional default value that MUST match one of the keys in contexts. If provided, tools will use this context when no input is provided for this modifier.",
|
|
92
|
-
"$comment": "JSON Schema cannot validate that this value matches a key in 'contexts'. This validation must be performed at runtime by the implementation."
|
|
93
|
-
},
|
|
94
|
-
"$extensions": {
|
|
95
|
-
"title": "Extensions",
|
|
96
|
-
"type": "object",
|
|
97
|
-
"description": "Vendor-specific extensions. Keys are vendor-specific namespaces."
|
|
98
|
-
},
|
|
99
|
-
"name": {
|
|
100
|
-
"title": "Name",
|
|
101
|
-
"type": "string",
|
|
102
|
-
"description": "A unique name that MUST NOT conflict with any other name in resolutionOrder.",
|
|
103
|
-
"$comment": "Uniqueness must be validated at runtime as JSON Schema cannot validate uniqueness across array items."
|
|
104
|
-
},
|
|
105
|
-
"type": {
|
|
106
|
-
"title": "Type",
|
|
107
|
-
"type": "string",
|
|
108
|
-
"const": "modifier",
|
|
109
|
-
"description": "MUST be 'modifier' for inline modifier definitions."
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"additionalProperties": false
|
|
113
|
-
}
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://www.designtokens.org/schemas/2025.10/resolver/resolutionOrder.json",
|
|
4
|
+
"title": "Resolution Order",
|
|
5
|
+
"description": "An ordered array of sets and modifiers that determines the final resolution of tokens. Order is significant - tokens later in the array override earlier ones in case of conflict.",
|
|
6
|
+
"type": "array",
|
|
7
|
+
"minItems": 1,
|
|
8
|
+
"items": {
|
|
9
|
+
"oneOf": [
|
|
10
|
+
{
|
|
11
|
+
"title": "Reference Object (For Resolution Order)",
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": ["$ref"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"$ref": {
|
|
16
|
+
"title": "JSON Reference",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"format": "uri-reference",
|
|
19
|
+
"description": "A JSON Pointer (RFC 6901) or URI reference. Must point to a set (#/sets/...) or modifier (#/modifiers/...), never to resolutionOrder items (#/resolutionOrder/...).",
|
|
20
|
+
"not": {
|
|
21
|
+
"pattern": "^#/resolutionOrder/",
|
|
22
|
+
"$comment": "ResolutionOrder cannot reference items within itself"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"description": "A reference object for use within resolutionOrder. Can point to sets or modifiers but not other resolutionOrder items."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"title": "Inline Set",
|
|
30
|
+
"description": "A set defined inline in the resolutionOrder array. Must include 'name' and 'type' properties.",
|
|
31
|
+
"type": "object",
|
|
32
|
+
"required": ["sources", "name", "type"],
|
|
33
|
+
"properties": {
|
|
34
|
+
"description": {
|
|
35
|
+
"title": "Description",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "A human-readable description of the purpose of the set."
|
|
38
|
+
},
|
|
39
|
+
"sources": {
|
|
40
|
+
"title": "Sources",
|
|
41
|
+
"$ref": "set.json#/definitions/tokenSourcesForSets",
|
|
42
|
+
"description": "An array of token sources. Can contain reference objects pointing to JSON files, inline token definitions, or any combination. If the array declares multiple sources, they will be merged in array order, meaning if a token is declared multiple times, the last occurrence in the array will be the final value."
|
|
43
|
+
},
|
|
44
|
+
"$extensions": {
|
|
45
|
+
"title": "Extensions",
|
|
46
|
+
"type": "object",
|
|
47
|
+
"description": "Vendor-specific extensions. Keys are vendor-specific namespaces."
|
|
48
|
+
},
|
|
49
|
+
"name": {
|
|
50
|
+
"title": "Name",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "A unique name that MUST NOT conflict with any other name in resolutionOrder.",
|
|
53
|
+
"$comment": "Uniqueness must be validated at runtime as JSON Schema cannot validate uniqueness across array items."
|
|
54
|
+
},
|
|
55
|
+
"type": {
|
|
56
|
+
"title": "Type",
|
|
57
|
+
"type": "string",
|
|
58
|
+
"const": "set",
|
|
59
|
+
"description": "MUST be 'set' for inline set definitions."
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"additionalProperties": false
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"title": "Inline Modifier",
|
|
66
|
+
"description": "A modifier defined inline in the resolutionOrder array. Must include 'name' and 'type' properties.",
|
|
67
|
+
"type": "object",
|
|
68
|
+
"required": ["contexts", "name", "type"],
|
|
69
|
+
"properties": {
|
|
70
|
+
"description": {
|
|
71
|
+
"title": "Description",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "A human-readable description of the purpose of the modifier."
|
|
74
|
+
},
|
|
75
|
+
"contexts": {
|
|
76
|
+
"title": "Contexts",
|
|
77
|
+
"type": "object",
|
|
78
|
+
"description": "A map of context names to arrays of token sources. Each context represents a possible variant (e.g., 'light' vs 'dark' for theme, 'small' vs 'large' for size).",
|
|
79
|
+
"minProperties": 2,
|
|
80
|
+
"patternProperties": {
|
|
81
|
+
"^.+$": {
|
|
82
|
+
"$ref": "modifier.json#/definitions/tokenSourcesForModifiers",
|
|
83
|
+
"description": "An array of token sources for this context. Can contain reference objects pointing to JSON files, inline token definitions, or any combination. If the array declares multiple sources, they will be merged in array order, meaning if a token is declared multiple times, the last occurrence in the array will be the final value."
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"additionalProperties": false
|
|
87
|
+
},
|
|
88
|
+
"default": {
|
|
89
|
+
"title": "Default Context",
|
|
90
|
+
"type": "string",
|
|
91
|
+
"description": "An optional default value that MUST match one of the keys in contexts. If provided, tools will use this context when no input is provided for this modifier.",
|
|
92
|
+
"$comment": "JSON Schema cannot validate that this value matches a key in 'contexts'. This validation must be performed at runtime by the implementation."
|
|
93
|
+
},
|
|
94
|
+
"$extensions": {
|
|
95
|
+
"title": "Extensions",
|
|
96
|
+
"type": "object",
|
|
97
|
+
"description": "Vendor-specific extensions. Keys are vendor-specific namespaces."
|
|
98
|
+
},
|
|
99
|
+
"name": {
|
|
100
|
+
"title": "Name",
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "A unique name that MUST NOT conflict with any other name in resolutionOrder.",
|
|
103
|
+
"$comment": "Uniqueness must be validated at runtime as JSON Schema cannot validate uniqueness across array items."
|
|
104
|
+
},
|
|
105
|
+
"type": {
|
|
106
|
+
"title": "Type",
|
|
107
|
+
"type": "string",
|
|
108
|
+
"const": "modifier",
|
|
109
|
+
"description": "MUST be 'modifier' for inline modifier definitions."
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|