-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.schema.json
More file actions
81 lines (81 loc) · 2.83 KB
/
theme.schema.json
File metadata and controls
81 lines (81 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
"$schema": "https://json-schema.org/draft-07/schema#",
"$id": "https://github.com/rozd/theme-kit/theme.schema.json",
"title": "ThemeKit Configuration",
"description": "Defines style tokens and generation settings for ThemeKit code generation.",
"type": "object",
"properties": {
"styles": {
"description": "Style token definitions for colors, gradients, mesh gradients, and shadows.",
"type": "object",
"properties": {
"colors": {
"description": "Color style tokens (resolved as ThemeAdaptiveStyle<Color>).",
"type": "array",
"items": { "$ref": "#/$defs/tokenEntry" }
},
"gradients": {
"description": "Gradient style tokens (resolved as ThemeAdaptiveStyle<Gradient>).",
"type": "array",
"items": { "$ref": "#/$defs/tokenEntry" }
},
"meshGradients": {
"description": "Mesh gradient style tokens (resolved as ThemeAdaptiveStyle<MeshGradient>).",
"type": "array",
"items": { "$ref": "#/$defs/tokenEntry" }
},
"shadows": {
"description": "Shadow style tokens (resolved as ThemeAdaptiveStyle<Shadow>).",
"type": "array",
"items": { "$ref": "#/$defs/tokenEntry" }
}
},
"additionalProperties": false
},
"config": {
"description": "Generation configuration settings.",
"type": "object",
"properties": {
"outputPath": {
"type": "string",
"description": "Relative path from the generation root where generated files should be written (e.g., 'UI/Theme'). Defaults to '.' if not specified."
},
"shouldGeneratePreview": {
"type": "boolean",
"description": "To generate a Theme+Preview.swift with all tokens as visual palette."
}
},
"required": ["outputPath"],
"additionalProperties": false
}
},
"required": ["styles"],
"additionalProperties": false,
"$defs": {
"tokenEntry": {
"description": "A style token. Use a string when the ShapeStyle name matches the token name, or an object to override the ShapeStyle name.",
"oneOf": [
{
"type": "string",
"description": "Token name, used for both the struct property and the ShapeStyle extension."
},
{
"type": "object",
"description": "Token with a custom ShapeStyle name.",
"properties": {
"name": {
"type": "string",
"description": "The struct property name (e.g. \"primary\")."
},
"style": {
"type": "string",
"description": "The ShapeStyle extension name (e.g. \"primaryColor\")."
}
},
"required": ["name", "style"],
"additionalProperties": false
}
]
}
}
}