desktop-theme.schema.json 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "$id": "https://opencode.ai/desktop-theme.json",
  4. "title": "OpenCode Desktop Theme",
  5. "description": "A theme definition for the OpenCode desktop application",
  6. "type": "object",
  7. "required": ["name", "id", "light", "dark"],
  8. "properties": {
  9. "$schema": {
  10. "type": "string",
  11. "description": "JSON Schema reference"
  12. },
  13. "name": {
  14. "type": "string",
  15. "description": "Human-readable theme name"
  16. },
  17. "id": {
  18. "type": "string",
  19. "description": "Unique theme identifier (slug)",
  20. "pattern": "^[a-z0-9-]+$"
  21. },
  22. "light": {
  23. "$ref": "#/definitions/ThemeVariant",
  24. "description": "Light mode color variant"
  25. },
  26. "dark": {
  27. "$ref": "#/definitions/ThemeVariant",
  28. "description": "Dark mode color variant"
  29. }
  30. },
  31. "definitions": {
  32. "HexColor": {
  33. "type": "string",
  34. "pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
  35. "description": "A hex color value like #fff, #ffff, #ffffff, or #ffffffff"
  36. },
  37. "ColorValue": {
  38. "type": "string",
  39. "pattern": "^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|var\\(--[a-z0-9-]+\\))$",
  40. "description": "Either a hex color value (#rgb/#rgba/#rrggbb/#rrggbbaa) or a CSS variable reference"
  41. },
  42. "ThemeSeedColors": {
  43. "type": "object",
  44. "description": "The legacy semantic seed set used to generate a theme",
  45. "additionalProperties": false,
  46. "required": ["neutral", "primary", "success", "warning", "error", "info", "interactive", "diffAdd", "diffDelete"],
  47. "properties": {
  48. "neutral": {
  49. "$ref": "#/definitions/HexColor",
  50. "description": "Base neutral color for generating the gray scale"
  51. },
  52. "primary": {
  53. "$ref": "#/definitions/HexColor",
  54. "description": "Primary brand/accent color"
  55. },
  56. "success": {
  57. "$ref": "#/definitions/HexColor",
  58. "description": "Success state color (typically green)"
  59. },
  60. "warning": {
  61. "$ref": "#/definitions/HexColor",
  62. "description": "Warning state color (typically yellow/orange)"
  63. },
  64. "error": {
  65. "$ref": "#/definitions/HexColor",
  66. "description": "Error/critical state color (typically red)"
  67. },
  68. "info": {
  69. "$ref": "#/definitions/HexColor",
  70. "description": "Informational state color (typically purple/blue)"
  71. },
  72. "interactive": {
  73. "$ref": "#/definitions/HexColor",
  74. "description": "Interactive element color (links, buttons)"
  75. },
  76. "diffAdd": {
  77. "$ref": "#/definitions/HexColor",
  78. "description": "Color for diff additions"
  79. },
  80. "diffDelete": {
  81. "$ref": "#/definitions/HexColor",
  82. "description": "Color for diff deletions"
  83. }
  84. }
  85. },
  86. "ThemePaletteColors": {
  87. "type": "object",
  88. "description": "A compact semantic palette used to derive the full theme programmatically",
  89. "additionalProperties": false,
  90. "required": ["neutral", "ink", "primary", "success", "warning", "error", "info"],
  91. "properties": {
  92. "neutral": {
  93. "$ref": "#/definitions/HexColor",
  94. "description": "Base neutral color for generating the gray scale"
  95. },
  96. "ink": {
  97. "$ref": "#/definitions/HexColor",
  98. "description": "Foreground or chrome color used to derive text and border tones"
  99. },
  100. "primary": {
  101. "$ref": "#/definitions/HexColor",
  102. "description": "Primary brand color used for brand surfaces and strong emphasis"
  103. },
  104. "success": {
  105. "$ref": "#/definitions/HexColor",
  106. "description": "Success state color"
  107. },
  108. "warning": {
  109. "$ref": "#/definitions/HexColor",
  110. "description": "Warning state color"
  111. },
  112. "error": {
  113. "$ref": "#/definitions/HexColor",
  114. "description": "Error or critical state color"
  115. },
  116. "info": {
  117. "$ref": "#/definitions/HexColor",
  118. "description": "Informational state color"
  119. },
  120. "accent": {
  121. "$ref": "#/definitions/HexColor",
  122. "description": "Optional extra expressive accent for syntax and rich content"
  123. },
  124. "interactive": {
  125. "$ref": "#/definitions/HexColor",
  126. "description": "Optional dedicated interactive color; falls back to primary"
  127. },
  128. "diffAdd": {
  129. "$ref": "#/definitions/HexColor",
  130. "description": "Optional diff-add seed; falls back to a softened success color"
  131. },
  132. "diffDelete": {
  133. "$ref": "#/definitions/HexColor",
  134. "description": "Optional diff-delete seed; falls back to error"
  135. }
  136. }
  137. },
  138. "ThemeVariant": {
  139. "type": "object",
  140. "description": "A theme variant (light or dark) with either a compact palette or legacy seeds and optional overrides",
  141. "oneOf": [{ "required": ["seeds"] }, { "required": ["palette"] }],
  142. "properties": {
  143. "seeds": {
  144. "$ref": "#/definitions/ThemeSeedColors",
  145. "description": "Legacy seed colors used to generate the full palette"
  146. },
  147. "palette": {
  148. "$ref": "#/definitions/ThemePaletteColors",
  149. "description": "Compact palette used to derive the full token set"
  150. },
  151. "overrides": {
  152. "type": "object",
  153. "description": "Optional direct overrides for any CSS variable (without -- prefix)",
  154. "additionalProperties": {
  155. "$ref": "#/definitions/ColorValue"
  156. }
  157. }
  158. }
  159. }
  160. }
  161. }