desktop-theme.schema.json 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 minimum set of colors needed to generate a theme",
  45. "required": ["neutral", "primary", "success", "warning", "error", "info", "interactive", "diffAdd", "diffDelete"],
  46. "properties": {
  47. "neutral": {
  48. "$ref": "#/definitions/HexColor",
  49. "description": "Base neutral color for generating the gray scale"
  50. },
  51. "primary": {
  52. "$ref": "#/definitions/HexColor",
  53. "description": "Primary brand/accent color"
  54. },
  55. "success": {
  56. "$ref": "#/definitions/HexColor",
  57. "description": "Success state color (typically green)"
  58. },
  59. "warning": {
  60. "$ref": "#/definitions/HexColor",
  61. "description": "Warning state color (typically yellow/orange)"
  62. },
  63. "error": {
  64. "$ref": "#/definitions/HexColor",
  65. "description": "Error/critical state color (typically red)"
  66. },
  67. "info": {
  68. "$ref": "#/definitions/HexColor",
  69. "description": "Informational state color (typically purple/blue)"
  70. },
  71. "interactive": {
  72. "$ref": "#/definitions/HexColor",
  73. "description": "Interactive element color (links, buttons)"
  74. },
  75. "diffAdd": {
  76. "$ref": "#/definitions/HexColor",
  77. "description": "Color for diff additions"
  78. },
  79. "diffDelete": {
  80. "$ref": "#/definitions/HexColor",
  81. "description": "Color for diff deletions"
  82. }
  83. }
  84. },
  85. "ThemeVariant": {
  86. "type": "object",
  87. "description": "A theme variant (light or dark) with seed colors and optional overrides",
  88. "required": ["seeds"],
  89. "properties": {
  90. "seeds": {
  91. "$ref": "#/definitions/ThemeSeedColors",
  92. "description": "Seed colors used to generate the full palette"
  93. },
  94. "overrides": {
  95. "type": "object",
  96. "description": "Optional direct overrides for any CSS variable (without -- prefix)",
  97. "additionalProperties": {
  98. "$ref": "#/definitions/ColorValue"
  99. }
  100. }
  101. }
  102. }
  103. }
  104. }