-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest-schema.json
483 lines (482 loc) · 15.1 KB
/
manifest-schema.json
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Theme Manifest",
"description": "The manifest file for a CSS Loader Theme.",
"type": "object",
"default": {
"name": "An Awesome Theme",
"description": "Something to spice up your Steamdeck experience!",
"author": "You",
"version": "v1.0.0",
"manifest_version": 8,
"target": "Home",
"tabs": {
"default": [ "bigpicture" ]
},
"inject": {
"shared.css": []
}
},
"properties": {
"$schema": {
"description": "The JSON schema for a CSS Loader Theme Manifest.",
"type": [
"string",
"null"
]
},
"name": {
"description": "The name of the theme. Make it short and catchy! (IMPORTANT: Once submitted, this name can not be changed)",
"type": "string"
},
"description": {
"description": "A description of the theme. This should explain what it does, and any side effects it has (breaks navigation, etc), as well as any incompatabilities with other themes.",
"type": "string"
},
"author": {
"description": "The author of the theme. Can be a discord tag, or just your name/username",
"type": "string"
},
"version": {
"description": "The version of the theme. It should follow Semantic Versioning.\n\nSemVer reference: https://docs.npmjs.com/about-semantic-versioning",
"type": "string"
},
"manifest_version": {
"description": "The manifest version. This should almost always be the latest version.\n\nLatest Version: 8",
"const": 8
},
"flags": {
"description": "A list of flags that modify the behavior of the theme.",
"type": "array",
"items": {
"anyOf": [
{
"description": "A flag that modifies the behavior of the theme.",
"enum": [
"PRESET",
"KEEP_DEPENDENCIES",
"OPTIONAL_DEPENDENCIES"
]
}
]
},
"uniqueItems": true
},
"target": {
"description": "A theme target. This helps users tell what the theme styles at a glance.",
"enum": [
"System-Wide",
"Home",
"Library",
"Store",
"Friends and Chat",
"Tweak",
"Keyboard",
"Other",
"Preset",
"Snippet",
"Media",
"Lock Screen",
"Background",
"Downloads",
"Settings",
"Desktop",
"Desktop-Library",
"Desktop-Store",
"Desktop-Friends",
"Desktop-Tweak"
]
},
"tabs": {
"description": "A dictionary of reuseable injection targets, where the key is the label, and the value is an array of injection targets.",
"type": "object",
"properties": {
"default": {
"description": "The default injection target. This is used when a file's injection target is \"[]\"."
}
},
"patternProperties": {
".*": {
"$ref": "#/definitions/TabTarget"
}
}
},
"inject": {
"description": "A dictionary of files and css variables to inject.\n\nFor files, the key should be the relative path to the .css file, and the value is an array of injection targets.\n\nFor css variables, the key should be the variable name (including the --), and the value should be an array of injection targets, with index 0 being the variable's value.",
"type": "object",
"patternProperties": {
"^(\\-\\-[a-z0-9\\-\\_]+)|.*\\.css$": {
"$ref": "#/definitions/InjectionTarget"
}
}
},
"dependencies": {
"description": "A dictionary of other themes that will be installed if not present along with this theme.",
"type": "object",
"patternProperties": {
".*": {
"description": "A dependency of this theme. Can be configured to set patch values that will override the defaults.",
"type": "object",
"patternProperties": {
".*": {
"anyOf": [
{
"description": "An override for a patch.",
"type": "string"
},
{
"description": "An override for a patch.",
"type": "object",
"properties": {
"value": {
"description": "The override value.",
"type": "string"
},
"components": {
"description": "A dictionary of this patch's components to override.",
"type": "object",
"patternProperties": {
".*": {
"description": "A component of this patch to override.",
"type": "string"
}
}
}
},
"required": [
"value",
"components"
]
}
]
}
}
}
}
},
"patches": {
"description": "A dictionary of options for this theme, where the key is the option's name, and the value is a patch.",
"type": "object",
"patternProperties": {
".*": {
"$ref": "#/definitions/Patch"
}
}
}
},
"required": [
"name",
"description",
"author",
"version",
"manifest_version",
"target"
],
"additionalProperties": false,
"definitions": {
"TabTarget": {
"description": "A reuseable injection target.",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/InjectionTargets"
}
},
"InjectionTarget": {
"description": "A file to inject into Steam. The path should be relative to the theme.json file, with no preceding slashes. (\"./\" or \"/\")",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/InjectionTargets"
}
},
"InjectionTargets": {
"anyOf": [
{
"description": "A predefined injection target resolved by CSS Loader.",
"enum": [
".*",
"desktop",
"desktopchat",
"desktoppopup",
"desktopoverlay",
"desktopcontextmenu",
"bigpicture",
"bigpictureoverlay",
"store"
]
},
{
"description": "A legacy injection target. These should be avoided in new themes, but are fine to leave in old ones.",
"enum": [
"SP",
"Steam Big Picture Mode",
"MainMenu",
"MainMenu_.*",
"QuickAccess",
"QuickAccess_.*",
"Steam",
"SteamLibraryWindow",
"All"
]
},
{
"description": "A custom injection target or variable value. This is typically a key defined in \"tabs\", a tab url, a regex expression, or the value of a variable.",
"type": "string"
}
]
},
"Patch": {
"description": "A patch for this theme. Allows users to configure parts of the theme.",
"oneOf": [
{
"description": "A generic patch, used for perminantly showing a component.",
"type": "object",
"properties": {
"type": {
"description": "The type of this patch.",
"const": "none"
},
"default": {
"description": "The defualt value of this patch. Should be a key in the \"values\" dictionary.",
"type": "string"
},
"values": {
"description": "Should be a dictionary with a \"_\" prop.",
"type": "object",
"patternProperties": {
".*": {
"description": "An empty dictionary.",
"type": "object",
"properties": {},
"additionalItems": false
}
},
"minProperties": 1,
"maxProperties": 1
},
"components": {
"$ref": "#/definitions/Components"
}
},
"required": [
"type",
"values"
],
"additionalItems": false
},
{ "$ref": "#/definitions/TogglePatch" },
{ "$ref": "#/definitions/DropdownPatch" },
{ "$ref": "#/definitions/SliderPatch" }
]
},
"TogglePatch": {
"description": "A patch for letting users toggle part of the Theme on/off.",
"type": "object",
"properties": {
"type": {
"description": "The type of this patch.",
"const": "checkbox"
},
"default": {
"description": "The defualt value of this patch. Should be a key in the \"values\" dictionary.",
"type": "string"
},
"values": {
"description": "The values for this patch.",
"type": "object",
"properties": {
"Yes": {
"description": "A dictionary of files and css variables to inject when the checkbox is checked.",
"type": "object",
"patternProperties": {
".*": {
"$ref": "#/definitions/InjectionTarget"
}
}
},
"No": {
"description": "A dictionary of files and css variables to inject when the checkbox is not checked.",
"type": "object",
"patternProperties": {
".*": {
"$ref": "#/definitions/InjectionTarget"
}
}
}
},
"required": [
"Yes",
"No"
]
},
"components": {
"$ref": "#/definitions/Components"
}
},
"required": [
"type",
"values"
],
"additionalItems": false
},
"DropdownPatch": {
"description": "A patch for letting users select an option from a predefined list.",
"type": "object",
"properties": {
"type": {
"description": "The type of this patch.",
"const": "dropdown"
},
"default": {
"description": "The defualt value of this patch. Should be a key in the \"values\" dictionary.",
"type": "string"
},
"values": {
"description": "The values for this dropdown. These are typically words, as otherwise a slider is a better solution.",
"type": "object",
"patternProperties": {
".*": {
"description": "A dictionary of files and css variables to inject when this option is selected.",
"type": "object",
"patternProperties": {
".*": {
"$ref": "#/definitions/InjectionTarget"
}
}
}
}
},
"components": {
"$ref": "#/definitions/Components"
}
},
"required": [
"type",
"values"
],
"additionalItems": false
},
"SliderPatch": {
"description": "A patch for letting users choose values in an interval.",
"type": "object",
"properties": {
"type": {
"description": "The type of this patch.",
"const": "slider"
},
"default": {
"description": "The defualt value of this patch. Should be a key in the \"values\" dictionary.",
"type": "string"
},
"values": {
"description": "The values for this slider. These are typically numbers, as otherwise a dropdown is a better solution.",
"type": "object",
"patternProperties": {
".*": {
"description": "A dictionary of files and css variables to inject when this option is selected.",
"type": "object",
"patternProperties": {
".*": {
"$ref": "#/definitions/InjectionTarget"
}
}
}
}
},
"components": {
"$ref": "#/definitions/Components"
}
},
"required": [
"type",
"values"
],
"additionalItems": false
},
"Components": {
"description": "An array of components used in this theme.",
"type": "array",
"items": {
"anyOf": [
{ "$ref": "#/definitions/ImageComponent" },
{ "$ref": "#/definitions/ColorComponent" }
]
}
},
"ImageComponent": {
"description": "A component for allowing the user to pick an image.",
"type": "object",
"properties": {
"name": {
"description": "The name of the patch this component should be associated with.",
"type": "string"
},
"type": {
"description": "The type of the component.",
"const": "image-picker"
},
"on": {
"description": "The value of the patch that should show this component.",
"type": "string"
},
"default": {
"description": "The default value of the image picker. Should be a file path starting with the name of this Theme.\n\nExample: \"An Awesome Theme/default-image.png\"",
"type": "string",
"pattern": "^(?:[\\w]\\:|\\\\)(\\\\[a-z_\\-\\s0-9\\.]+)+\\.(png|apng|jpg|jpeg|webp|gif)$"
},
"css_variable": {
"description": "The name of the css variable this component should use to store its value.",
"type": "string",
"pattern": "^(\\-\\-[a-z0-9\\-\\_]+)$"
},
"tabs": {
"description": "The injection targets for this component.",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/InjectionTargets"
}
}
},
"additionalItems": false
},
"ColorComponent": {
"description": "A component for allowing the user to set a color.",
"type": "object",
"properties": {
"name": {
"description": "The name of the patch this component should be associated with.",
"type": "string"
},
"type": {
"description": "The type of the component.",
"const": "color-picker"
},
"on": {
"description": "The value of the patch that should show this component.",
"type": "string"
},
"default": {
"description": "The default value of the color picker. Should be in hexadecimal form.\n\nExample: \"#59BF40\"",
"type": "string",
"pattern": "^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
},
"css_variable": {
"description": "The name of the css variable this component should use to store its value.",
"type": "string",
"pattern": "^(\\-\\-[a-z0-9\\-\\_]+)$"
},
"tabs": {
"description": "The injection targets for this component.",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/InjectionTargets"
}
}
},
"additionalItems": false
}
}
}