theme.json 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. }
  28. },
  29. "additionalProperties": false
  30. },
  31. "theme": {
  32. "type": "object",
  33. "description": "Theme color definitions",
  34. "properties": {
  35. "primary": { "$ref": "#/definitions/colorValue" },
  36. "secondary": { "$ref": "#/definitions/colorValue" },
  37. "accent": { "$ref": "#/definitions/colorValue" },
  38. "error": { "$ref": "#/definitions/colorValue" },
  39. "warning": { "$ref": "#/definitions/colorValue" },
  40. "success": { "$ref": "#/definitions/colorValue" },
  41. "info": { "$ref": "#/definitions/colorValue" },
  42. "text": { "$ref": "#/definitions/colorValue" },
  43. "textMuted": { "$ref": "#/definitions/colorValue" },
  44. "background": { "$ref": "#/definitions/colorValue" },
  45. "backgroundPanel": { "$ref": "#/definitions/colorValue" },
  46. "backgroundElement": { "$ref": "#/definitions/colorValue" },
  47. "border": { "$ref": "#/definitions/colorValue" },
  48. "borderActive": { "$ref": "#/definitions/colorValue" },
  49. "borderSubtle": { "$ref": "#/definitions/colorValue" },
  50. "diffAdded": { "$ref": "#/definitions/colorValue" },
  51. "diffRemoved": { "$ref": "#/definitions/colorValue" },
  52. "diffContext": { "$ref": "#/definitions/colorValue" },
  53. "diffHunkHeader": { "$ref": "#/definitions/colorValue" },
  54. "diffHighlightAdded": { "$ref": "#/definitions/colorValue" },
  55. "diffHighlightRemoved": { "$ref": "#/definitions/colorValue" },
  56. "diffAddedBg": { "$ref": "#/definitions/colorValue" },
  57. "diffRemovedBg": { "$ref": "#/definitions/colorValue" },
  58. "diffContextBg": { "$ref": "#/definitions/colorValue" },
  59. "diffLineNumber": { "$ref": "#/definitions/colorValue" },
  60. "diffAddedLineNumberBg": { "$ref": "#/definitions/colorValue" },
  61. "diffRemovedLineNumberBg": { "$ref": "#/definitions/colorValue" },
  62. "markdownText": { "$ref": "#/definitions/colorValue" },
  63. "markdownHeading": { "$ref": "#/definitions/colorValue" },
  64. "markdownLink": { "$ref": "#/definitions/colorValue" },
  65. "markdownLinkText": { "$ref": "#/definitions/colorValue" },
  66. "markdownCode": { "$ref": "#/definitions/colorValue" },
  67. "markdownBlockQuote": { "$ref": "#/definitions/colorValue" },
  68. "markdownEmph": { "$ref": "#/definitions/colorValue" },
  69. "markdownStrong": { "$ref": "#/definitions/colorValue" },
  70. "markdownHorizontalRule": { "$ref": "#/definitions/colorValue" },
  71. "markdownListItem": { "$ref": "#/definitions/colorValue" },
  72. "markdownListEnumeration": { "$ref": "#/definitions/colorValue" },
  73. "markdownImage": { "$ref": "#/definitions/colorValue" },
  74. "markdownImageText": { "$ref": "#/definitions/colorValue" },
  75. "markdownCodeBlock": { "$ref": "#/definitions/colorValue" },
  76. "syntaxComment": { "$ref": "#/definitions/colorValue" },
  77. "syntaxKeyword": { "$ref": "#/definitions/colorValue" },
  78. "syntaxFunction": { "$ref": "#/definitions/colorValue" },
  79. "syntaxVariable": { "$ref": "#/definitions/colorValue" },
  80. "syntaxString": { "$ref": "#/definitions/colorValue" },
  81. "syntaxNumber": { "$ref": "#/definitions/colorValue" },
  82. "syntaxType": { "$ref": "#/definitions/colorValue" },
  83. "syntaxOperator": { "$ref": "#/definitions/colorValue" },
  84. "syntaxPunctuation": { "$ref": "#/definitions/colorValue" }
  85. },
  86. "required": [
  87. "primary",
  88. "secondary",
  89. "accent",
  90. "text",
  91. "textMuted",
  92. "background"
  93. ],
  94. "additionalProperties": false
  95. }
  96. },
  97. "required": ["theme"],
  98. "additionalProperties": false,
  99. "definitions": {
  100. "colorValue": {
  101. "oneOf": [
  102. {
  103. "type": "string",
  104. "pattern": "^#[0-9a-fA-F]{6}$",
  105. "description": "Hex color value (same for dark and light)"
  106. },
  107. {
  108. "type": "integer",
  109. "minimum": 0,
  110. "maximum": 255,
  111. "description": "ANSI color code (0-255, same for dark and light)"
  112. },
  113. {
  114. "type": "string",
  115. "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
  116. "description": "Reference to another color in the theme or defs"
  117. },
  118. {
  119. "type": "object",
  120. "properties": {
  121. "dark": {
  122. "oneOf": [
  123. {
  124. "type": "string",
  125. "pattern": "^#[0-9a-fA-F]{6}$",
  126. "description": "Hex color value for dark mode"
  127. },
  128. {
  129. "type": "integer",
  130. "minimum": 0,
  131. "maximum": 255,
  132. "description": "ANSI color code for dark mode"
  133. },
  134. {
  135. "type": "string",
  136. "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
  137. "description": "Reference to another color for dark mode"
  138. }
  139. ]
  140. },
  141. "light": {
  142. "oneOf": [
  143. {
  144. "type": "string",
  145. "pattern": "^#[0-9a-fA-F]{6}$",
  146. "description": "Hex color value for light mode"
  147. },
  148. {
  149. "type": "integer",
  150. "minimum": 0,
  151. "maximum": 255,
  152. "description": "ANSI color code for light mode"
  153. },
  154. {
  155. "type": "string",
  156. "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
  157. "description": "Reference to another color for light mode"
  158. }
  159. ]
  160. }
  161. },
  162. "required": ["dark", "light"],
  163. "additionalProperties": false,
  164. "description": "Separate colors for dark and light modes"
  165. }
  166. ]
  167. }
  168. }
  169. }