theme.json 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "type": "object",
  4. "properties": {
  5. "$schema": {
  6. "type": "string",
  7. "description": "JSON schema reference for configuration validation"
  8. },
  9. "defs": {
  10. "type": "object",
  11. "description": "Color definitions that can be referenced in the theme",
  12. "patternProperties": {
  13. "^[a-zA-Z][a-zA-Z0-9_]*$": {
  14. "oneOf": [
  15. {
  16. "type": "string",
  17. "pattern": "^#[0-9a-fA-F]{6}$",
  18. "description": "Hex color value"
  19. },
  20. {
  21. "type": "integer",
  22. "minimum": 0,
  23. "maximum": 255,
  24. "description": "ANSI color code (0-255)"
  25. },
  26. {
  27. "type": "string",
  28. "enum": ["none"],
  29. "description": "No color (uses terminal default)"
  30. }
  31. ]
  32. }
  33. },
  34. "additionalProperties": false
  35. },
  36. "theme": {
  37. "type": "object",
  38. "description": "Theme color definitions",
  39. "properties": {
  40. "primary": { "$ref": "#/definitions/colorValue" },
  41. "secondary": { "$ref": "#/definitions/colorValue" },
  42. "accent": { "$ref": "#/definitions/colorValue" },
  43. "error": { "$ref": "#/definitions/colorValue" },
  44. "warning": { "$ref": "#/definitions/colorValue" },
  45. "success": { "$ref": "#/definitions/colorValue" },
  46. "info": { "$ref": "#/definitions/colorValue" },
  47. "text": { "$ref": "#/definitions/colorValue" },
  48. "textMuted": { "$ref": "#/definitions/colorValue" },
  49. "background": { "$ref": "#/definitions/colorValue" },
  50. "backgroundPanel": { "$ref": "#/definitions/colorValue" },
  51. "backgroundElement": { "$ref": "#/definitions/colorValue" },
  52. "border": { "$ref": "#/definitions/colorValue" },
  53. "borderActive": { "$ref": "#/definitions/colorValue" },
  54. "borderSubtle": { "$ref": "#/definitions/colorValue" },
  55. "diffAdded": { "$ref": "#/definitions/colorValue" },
  56. "diffRemoved": { "$ref": "#/definitions/colorValue" },
  57. "diffContext": { "$ref": "#/definitions/colorValue" },
  58. "diffHunkHeader": { "$ref": "#/definitions/colorValue" },
  59. "diffHighlightAdded": { "$ref": "#/definitions/colorValue" },
  60. "diffHighlightRemoved": { "$ref": "#/definitions/colorValue" },
  61. "diffAddedBg": { "$ref": "#/definitions/colorValue" },
  62. "diffRemovedBg": { "$ref": "#/definitions/colorValue" },
  63. "diffContextBg": { "$ref": "#/definitions/colorValue" },
  64. "diffLineNumber": { "$ref": "#/definitions/colorValue" },
  65. "diffAddedLineNumberBg": { "$ref": "#/definitions/colorValue" },
  66. "diffRemovedLineNumberBg": { "$ref": "#/definitions/colorValue" },
  67. "markdownText": { "$ref": "#/definitions/colorValue" },
  68. "markdownHeading": { "$ref": "#/definitions/colorValue" },
  69. "markdownLink": { "$ref": "#/definitions/colorValue" },
  70. "markdownLinkText": { "$ref": "#/definitions/colorValue" },
  71. "markdownCode": { "$ref": "#/definitions/colorValue" },
  72. "markdownBlockQuote": { "$ref": "#/definitions/colorValue" },
  73. "markdownEmph": { "$ref": "#/definitions/colorValue" },
  74. "markdownStrong": { "$ref": "#/definitions/colorValue" },
  75. "markdownHorizontalRule": { "$ref": "#/definitions/colorValue" },
  76. "markdownListItem": { "$ref": "#/definitions/colorValue" },
  77. "markdownListEnumeration": { "$ref": "#/definitions/colorValue" },
  78. "markdownImage": { "$ref": "#/definitions/colorValue" },
  79. "markdownImageText": { "$ref": "#/definitions/colorValue" },
  80. "markdownCodeBlock": { "$ref": "#/definitions/colorValue" },
  81. "syntaxComment": { "$ref": "#/definitions/colorValue" },
  82. "syntaxKeyword": { "$ref": "#/definitions/colorValue" },
  83. "syntaxFunction": { "$ref": "#/definitions/colorValue" },
  84. "syntaxVariable": { "$ref": "#/definitions/colorValue" },
  85. "syntaxString": { "$ref": "#/definitions/colorValue" },
  86. "syntaxNumber": { "$ref": "#/definitions/colorValue" },
  87. "syntaxType": { "$ref": "#/definitions/colorValue" },
  88. "syntaxOperator": { "$ref": "#/definitions/colorValue" },
  89. "syntaxPunctuation": { "$ref": "#/definitions/colorValue" }
  90. },
  91. "required": ["primary", "secondary", "accent", "text", "textMuted", "background"],
  92. "additionalProperties": false
  93. }
  94. },
  95. "required": ["theme"],
  96. "additionalProperties": false,
  97. "definitions": {
  98. "colorValue": {
  99. "oneOf": [
  100. {
  101. "type": "string",
  102. "pattern": "^#[0-9a-fA-F]{6}$",
  103. "description": "Hex color value (same for dark and light)"
  104. },
  105. {
  106. "type": "integer",
  107. "minimum": 0,
  108. "maximum": 255,
  109. "description": "ANSI color code (0-255, same for dark and light)"
  110. },
  111. {
  112. "type": "string",
  113. "enum": ["none"],
  114. "description": "No color (uses terminal default)"
  115. },
  116. {
  117. "type": "string",
  118. "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
  119. "description": "Reference to another color in the theme or defs"
  120. },
  121. {
  122. "type": "object",
  123. "properties": {
  124. "dark": {
  125. "oneOf": [
  126. {
  127. "type": "string",
  128. "pattern": "^#[0-9a-fA-F]{6}$",
  129. "description": "Hex color value for dark mode"
  130. },
  131. {
  132. "type": "integer",
  133. "minimum": 0,
  134. "maximum": 255,
  135. "description": "ANSI color code for dark mode"
  136. },
  137. {
  138. "type": "string",
  139. "enum": ["none"],
  140. "description": "No color (uses terminal default)"
  141. },
  142. {
  143. "type": "string",
  144. "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
  145. "description": "Reference to another color for dark mode"
  146. }
  147. ]
  148. },
  149. "light": {
  150. "oneOf": [
  151. {
  152. "type": "string",
  153. "pattern": "^#[0-9a-fA-F]{6}$",
  154. "description": "Hex color value for light mode"
  155. },
  156. {
  157. "type": "integer",
  158. "minimum": 0,
  159. "maximum": 255,
  160. "description": "ANSI color code for light mode"
  161. },
  162. {
  163. "type": "string",
  164. "enum": ["none"],
  165. "description": "No color (uses terminal default)"
  166. },
  167. {
  168. "type": "string",
  169. "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
  170. "description": "Reference to another color for light mode"
  171. }
  172. ]
  173. }
  174. },
  175. "required": ["dark", "light"],
  176. "additionalProperties": false,
  177. "description": "Separate colors for dark and light modes"
  178. }
  179. ]
  180. }
  181. }
  182. }