{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://www.schemastore.org/devup.json",
  "$defs": {
    "ColorValue": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ColorValue"
          }
        }
      ]
    },
    "ColorTheme": {
      "description": "Color theme with color name to value mappings. Supports nested objects for color scales.",
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          {
            "description": "Color value (e.g., '#000', 'rgb(0,0,0)')",
            "type": "string"
          },
          {
            "description": "Nested color object",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/$defs/ColorValue"
            }
          }
        ]
      }
    },
    "Theme": {
      "type": "object",
      "properties": {
        "breakpoints": {
          "description": "Breakpoints in pixels for responsive typography (default: [0, 480, 768, 992, 1280, 1600])",
          "type": "array",
          "default": [0, 480, 768, 992, 1280, 1600],
          "items": {
            "type": "integer",
            "maximum": 65535,
            "minimum": 0
          }
        },
        "colors": {
          "description": "Color themes by mode name (e.g., \"light\", \"dark\")",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ColorTheme"
          },
          "default": {}
        },
        "typography": {
          "description": "Typography definitions by name (e.g., \"h1\", \"body\", \"caption\")",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/Typographies"
          },
          "default": {}
        }
      }
    },
    "Typographies": {
      "description": "Typography definition supporting both traditional array format and compact object format",
      "oneOf": [
        {
          "description": "Traditional array format: array of Typography objects or null for each breakpoint",
          "type": "array",
          "items": {
            "oneOf": [
              {
                "$ref": "#/$defs/Typography"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        {
          "description": "Compact object format: each property can be a single value or array of values per breakpoint",
          "type": "object",
          "properties": {
            "fontFamily": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "fontSize": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "fontStyle": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "fontWeight": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "letterSpacing": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "lineHeight": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "Typography": {
      "type": "object",
      "properties": {
        "fontFamily": {
          "type": ["string", "null"]
        },
        "fontSize": {
          "type": ["string", "null"]
        },
        "fontWeight": {
          "default": null,
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "letterSpacing": {
          "type": ["string", "null"]
        },
        "lineHeight": {
          "default": null,
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  },
  "title": "DevupJson",
  "description": "Root devup.json configuration",
  "type": "object",
  "properties": {
    "theme": {
      "description": "Theme configuration including colors, typography, and breakpoints",
      "anyOf": [
        {
          "$ref": "#/$defs/Theme"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  }
}
