theme.json 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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": [
  92. "primary",
  93. "secondary",
  94. "accent",
  95. "text",
  96. "textMuted",
  97. "background"
  98. ],
  99. "additionalProperties": false
  100. }
  101. },
  102. "required": ["theme"],
  103. "additionalProperties": false,
  104. "definitions": {
  105. "colorValue": {
  106. "oneOf": [
  107. {
  108. "type": "string",
  109. "pattern": "^#[0-9a-fA-F]{6}$",
  110. "description": "Hex color value (same for dark and light)"
  111. },
  112. {
  113. "type": "integer",
  114. "minimum": 0,
  115. "maximum": 255,
  116. "description": "ANSI color code (0-255, same for dark and light)"
  117. },
  118. {
  119. "type": "string",
  120. "enum": ["none"],
  121. "description": "No color (uses terminal default)"
  122. },
  123. {
  124. "type": "string",
  125. "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
  126. "description": "Reference to another color in the theme or defs"
  127. },
  128. {
  129. "type": "object",
  130. "properties": {
  131. "dark": {
  132. "oneOf": [
  133. {
  134. "type": "string",
  135. "pattern": "^#[0-9a-fA-F]{6}$",
  136. "description": "Hex color value for dark mode"
  137. },
  138. {
  139. "type": "integer",
  140. "minimum": 0,
  141. "maximum": 255,
  142. "description": "ANSI color code for dark mode"
  143. },
  144. {
  145. "type": "string",
  146. "enum": ["none"],
  147. "description": "No color (uses terminal default)"
  148. },
  149. {
  150. "type": "string",
  151. "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
  152. "description": "Reference to another color for dark mode"
  153. }
  154. ]
  155. },
  156. "light": {
  157. "oneOf": [
  158. {
  159. "type": "string",
  160. "pattern": "^#[0-9a-fA-F]{6}$",
  161. "description": "Hex color value for light mode"
  162. },
  163. {
  164. "type": "integer",
  165. "minimum": 0,
  166. "maximum": 255,
  167. "description": "ANSI color code for light mode"
  168. },
  169. {
  170. "type": "string",
  171. "enum": ["none"],
  172. "description": "No color (uses terminal default)"
  173. },
  174. {
  175. "type": "string",
  176. "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
  177. "description": "Reference to another color for light mode"
  178. }
  179. ]
  180. }
  181. },
  182. "required": ["dark", "light"],
  183. "additionalProperties": false,
  184. "description": "Separate colors for dark and light modes"
  185. }
  186. ]
  187. }
  188. }
  189. }