{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://williamzujkowski.github.io/remarque/tokens.schema.json",
  "title": "Remarque design tokens (tokens.json)",
  "description": "JSON Schema for remarque-tokens' generated tokens.json — GENERATED by scripts/tokens-json.mjs, do not hand-edit. Conformant in spirit with the Design Tokens Community Group format ($value/$type on every token), with two deliberate divergences (oklch()-string color values; per-token light/dark nesting) — see the tokens.json $extensions.remarque.dtcg block and REMARQUE.md \"DTCG Conformance\" for the full rationale and ratification triggers.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$description",
    "$extensions",
    "core",
    "palette"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "$description": {
      "type": "string"
    },
    "$extensions": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "remarque"
      ],
      "properties": {
        "remarque": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "version",
            "tiers",
            "dtcg"
          ],
          "properties": {
            "version": {
              "type": "string"
            },
            "tiers": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "core",
                "palette"
              ],
              "properties": {
                "core": {
                  "type": "string"
                },
                "palette": {
                  "type": "string"
                }
              }
            },
            "dtcg": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "conformance",
                "divergences",
                "note"
              ],
              "properties": {
                "conformance": {
                  "type": "string"
                },
                "divergences": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "aspect",
                      "detail",
                      "gatedOn"
                    ],
                    "properties": {
                      "aspect": {
                        "type": "string"
                      },
                      "detail": {
                        "type": "string"
                      },
                      "gatedOn": {
                        "type": "string"
                      }
                    }
                  }
                },
                "note": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "core": {
      "type": "object",
      "additionalProperties": false,
      "patternProperties": {
        "^[a-z][a-z0-9-]*$": {
          "$ref": "#/$defs/coreEntry"
        }
      }
    },
    "palette": {
      "type": "object",
      "additionalProperties": false,
      "patternProperties": {
        "^[a-z][a-z0-9-]*$": {
          "$ref": "#/$defs/paletteEntry"
        }
      }
    }
  },
  "$defs": {
    "tokenType": {
      "type": "string",
      "enum": [
        "color",
        "dimension",
        "number",
        "fontFamily",
        "fontWeight",
        "duration",
        "string"
      ]
    },
    "coreEntry": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "$value",
        "$type"
      ],
      "properties": {
        "$value": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            }
          ]
        },
        "$type": {
          "$ref": "#/$defs/tokenType"
        }
      }
    },
    "paletteSideValue": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "$value"
      ],
      "properties": {
        "$value": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            }
          ]
        },
        "$extensions": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "remarque": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "inheritedFromLight": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "paletteEntry": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "$type",
        "light",
        "dark"
      ],
      "properties": {
        "$type": {
          "$ref": "#/$defs/tokenType"
        },
        "light": {
          "$ref": "#/$defs/paletteSideValue"
        },
        "dark": {
          "$ref": "#/$defs/paletteSideValue"
        }
      }
    }
  }
}
