summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-20 13:00:03 -0500
committeradamdottv <[email protected]>2025-06-20 13:00:32 -0500
commitdf95c49401853a71b5874e564427e7d0cc65c30c (patch)
treed178a205de2962b66c029b0dc88943bbabc8ee12
parent8b73c52f00661a516cd89d9bb45b036dcc93c0f0 (diff)
downloadopencode-df95c49401853a71b5874e564427e7d0cc65c30c.tar.gz
opencode-df95c49401853a71b5874e564427e7d0cc65c30c.zip
docs: theme schema
-rw-r--r--packages/web/public/theme.json166
1 files changed, 166 insertions, 0 deletions
diff --git a/packages/web/public/theme.json b/packages/web/public/theme.json
new file mode 100644
index 000000000..04d4342d8
--- /dev/null
+++ b/packages/web/public/theme.json
@@ -0,0 +1,166 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "type": "object",
+ "properties": {
+ "defs": {
+ "type": "object",
+ "description": "Color definitions that can be referenced in the theme",
+ "patternProperties": {
+ "^[a-zA-Z][a-zA-Z0-9_]*$": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "description": "Hex color value"
+ },
+ {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255,
+ "description": "ANSI color code (0-255)"
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "theme": {
+ "type": "object",
+ "description": "Theme color definitions",
+ "properties": {
+ "primary": { "$ref": "#/definitions/colorValue" },
+ "secondary": { "$ref": "#/definitions/colorValue" },
+ "accent": { "$ref": "#/definitions/colorValue" },
+ "error": { "$ref": "#/definitions/colorValue" },
+ "warning": { "$ref": "#/definitions/colorValue" },
+ "success": { "$ref": "#/definitions/colorValue" },
+ "info": { "$ref": "#/definitions/colorValue" },
+ "text": { "$ref": "#/definitions/colorValue" },
+ "textMuted": { "$ref": "#/definitions/colorValue" },
+ "background": { "$ref": "#/definitions/colorValue" },
+ "backgroundPanel": { "$ref": "#/definitions/colorValue" },
+ "backgroundElement": { "$ref": "#/definitions/colorValue" },
+ "border": { "$ref": "#/definitions/colorValue" },
+ "borderActive": { "$ref": "#/definitions/colorValue" },
+ "borderSubtle": { "$ref": "#/definitions/colorValue" },
+ "diffAdded": { "$ref": "#/definitions/colorValue" },
+ "diffRemoved": { "$ref": "#/definitions/colorValue" },
+ "diffContext": { "$ref": "#/definitions/colorValue" },
+ "diffHunkHeader": { "$ref": "#/definitions/colorValue" },
+ "diffHighlightAdded": { "$ref": "#/definitions/colorValue" },
+ "diffHighlightRemoved": { "$ref": "#/definitions/colorValue" },
+ "diffAddedBg": { "$ref": "#/definitions/colorValue" },
+ "diffRemovedBg": { "$ref": "#/definitions/colorValue" },
+ "diffContextBg": { "$ref": "#/definitions/colorValue" },
+ "diffLineNumber": { "$ref": "#/definitions/colorValue" },
+ "diffAddedLineNumberBg": { "$ref": "#/definitions/colorValue" },
+ "diffRemovedLineNumberBg": { "$ref": "#/definitions/colorValue" },
+ "markdownText": { "$ref": "#/definitions/colorValue" },
+ "markdownHeading": { "$ref": "#/definitions/colorValue" },
+ "markdownLink": { "$ref": "#/definitions/colorValue" },
+ "markdownLinkText": { "$ref": "#/definitions/colorValue" },
+ "markdownCode": { "$ref": "#/definitions/colorValue" },
+ "markdownBlockQuote": { "$ref": "#/definitions/colorValue" },
+ "markdownEmph": { "$ref": "#/definitions/colorValue" },
+ "markdownStrong": { "$ref": "#/definitions/colorValue" },
+ "markdownHorizontalRule": { "$ref": "#/definitions/colorValue" },
+ "markdownListItem": { "$ref": "#/definitions/colorValue" },
+ "markdownListEnumeration": { "$ref": "#/definitions/colorValue" },
+ "markdownImage": { "$ref": "#/definitions/colorValue" },
+ "markdownImageText": { "$ref": "#/definitions/colorValue" },
+ "markdownCodeBlock": { "$ref": "#/definitions/colorValue" },
+ "syntaxComment": { "$ref": "#/definitions/colorValue" },
+ "syntaxKeyword": { "$ref": "#/definitions/colorValue" },
+ "syntaxFunction": { "$ref": "#/definitions/colorValue" },
+ "syntaxVariable": { "$ref": "#/definitions/colorValue" },
+ "syntaxString": { "$ref": "#/definitions/colorValue" },
+ "syntaxNumber": { "$ref": "#/definitions/colorValue" },
+ "syntaxType": { "$ref": "#/definitions/colorValue" },
+ "syntaxOperator": { "$ref": "#/definitions/colorValue" },
+ "syntaxPunctuation": { "$ref": "#/definitions/colorValue" }
+ },
+ "required": [
+ "primary",
+ "secondary",
+ "accent",
+ "text",
+ "textMuted",
+ "background"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": ["theme"],
+ "additionalProperties": false,
+ "definitions": {
+ "colorValue": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "description": "Hex color value (same for dark and light)"
+ },
+ {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255,
+ "description": "ANSI color code (0-255, same for dark and light)"
+ },
+ {
+ "type": "string",
+ "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
+ "description": "Reference to another color in the theme or defs"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "dark": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "description": "Hex color value for dark mode"
+ },
+ {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255,
+ "description": "ANSI color code for dark mode"
+ },
+ {
+ "type": "string",
+ "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
+ "description": "Reference to another color for dark mode"
+ }
+ ]
+ },
+ "light": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "description": "Hex color value for light mode"
+ },
+ {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255,
+ "description": "ANSI color code for light mode"
+ },
+ {
+ "type": "string",
+ "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
+ "description": "Reference to another color for light mode"
+ }
+ ]
+ }
+ },
+ "required": ["dark", "light"],
+ "additionalProperties": false,
+ "description": "Separate colors for dark and light modes"
+ }
+ ]
+ }
+ }
+}
+