theme.json 6.3 KB

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