{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "color": {
            "type": "string",
            "pattern": "^(#([\\da-f]{3}){1,2}|(rgb|hsl)a\\((\\d{1,3}%?,\\s?){3}(1|0?\\.\\d+)\\)|(rgb|hsl)\\(\\d{1,3}%?(,\\s?\\d{1,3}%?){2}\\))$"
        },
        "shadow": {
            "type": "string",
            "minLength": 1
        },
        "icon": {
            "type": "string",
            "minLength": 1,
            "pattern": "^\\s*<([A-Za-z]+).+?(\\/>|\\/\\1>)\\s*$"
        }
    },
    "type": "object",
    "properties": {
        "theme": {
            "type": "object",
            "properties": {
                "settings": {
                    "type": "object"
                },
                "typography": {
                    "type": "object",
                    "properties": {
                        "family": {
                            "type": "string",
                            "minLength": 1
                        },
                        "rootSize": {
                            "type": "integer",
                            "minimum": 4,
                            "maximum": 22
                        },
                        "lineHeight": {
                            "type": "number",
                            "minimum": 1,
                            "maximum": 2
                        }
                    },
                    "required": [
                        "family",
                        "rootSize",
                        "lineHeight"
                    ]
                },
                "colors": {
                    "type": "object",
                    "properties": {
                        "background": {
                            "$ref": "#/definitions/color"
                        },
                        "light": {
                            "$ref": "#/definitions/color"
                        },
                        "dark": {
                            "$ref": "#/definitions/color"
                        },
                        "placeholder": {
                            "$ref": "#/definitions/color"
                        },
                        "primary": {
                            "$ref": "#/definitions/color"
                        },
                        "primaryContrast": {
                            "$ref": "#/definitions/color"
                        },
                        "accent": {
                            "$ref": "#/definitions/color"
                        },
                        "accentContrast": {
                            "$ref": "#/definitions/color"
                        },
                        "cta": {
                            "$ref": "#/definitions/color"
                        },
                        "ctaContrast": {
                            "$ref": "#/definitions/color"
                        },
                        "darkGray": {
                            "$ref": "#/definitions/color"
                        },
                        "focus": {
                            "$ref": "#/definitions/color"
                        },
                        "shade3": {
                            "$ref": "#/definitions/color"
                        },
                        "shade4": {
                            "$ref": "#/definitions/color"
                        },
                        "shade5": {
                            "$ref": "#/definitions/color"
                        },
                        "shade6": {
                            "$ref": "#/definitions/color"
                        },
                        "shade7": {
                            "$ref": "#/definitions/color"
                        },
                        "shade8": {
                            "$ref": "#/definitions/color"
                        },
                        "shade9": {
                            "$ref": "#/definitions/color"
                        },
                        "shade10": {
                            "$ref": "#/definitions/color"
                        },
                        "shade11": {
                            "$ref": "#/definitions/color"
                        },
                        "shade12": {
                            "$ref": "#/definitions/color"
                        },
                        "success": {
                            "$ref": "#/definitions/color"
                        },
                        "warning": {
                            "$ref": "#/definitions/color"
                        },
                        "error": {
                            "$ref": "#/definitions/color"
                        }
                    },
                    "required": [
                        "background",
                        "light",
                        "dark",
                        "placeholder",
                        "primary",
                        "primaryContrast",
                        "accent",
                        "accentContrast",
                        "cta",
                        "ctaContrast",
                        "focus",
                        "shade3",
                        "shade4",
                        "shade5",
                        "shade6",
                        "shade7",
                        "shade8",
                        "shade9",
                        "shade10",
                        "shade11",
                        "shade12",
                        "success",
                        "warning",
                        "error"
                    ]
                },
                "variables": {
                    "type": "object",
                    "properties": {
                        "toast": {
                            "type": "object",
                            "properties": {
                                "duration": {
                                    "type": "integer"
                                }
                            },
                            "required": [
                                "duration"
                            ]
                        }
                    },
                    "required": [
                        "toast"
                    ]
                },
                "shadows": {
                    "type": "object",
                    "properties": {
                        "material": {
                            "$ref": "#/definitions/shadow"
                        },
                        "navDrawer": {
                            "$ref": "#/definitions/shadow"
                        },
                        "productCard": {
                            "$ref": "#/definitions/shadow"
                        },
                        "productImage": {
                            "$ref": "#/definitions/shadow"
                        },
                        "filter": {
                            "type": "object",
                            "properties": {
                                "sort": {
                                    "$ref": "#/definitions/shadow"
                                },
                                "priceSlider": {
                                    "$ref": "#/definitions/shadow"
                                }
                            },
                            "required": [
                                "sort",
                                "priceSlider"
                            ]
                        },
                        "cart": {
                            "type": "object",
                            "properties": {
                                "paymentBar": {
                                    "$ref": "#/definitions/shadow"
                                }
                            },
                            "required": [
                                "paymentBar"
                            ]
                        },
                        "dialog": {
                            "$ref": "#/definitions/shadow"
                        },
                        "toast": {
                            "$ref": "#/definitions/shadow"
                        },
                        "contextMenu": {
                            "$ref": "#/definitions/shadow"
                        },
                        "buttons": {
                            "type": "object",
                            "properties": {
                                "disabled": {
                                    "$ref": "#/definitions/shadow"
                                },
                                "elevated": {
                                    "$ref": "#/definitions/shadow"
                                }
                            },
                            "required": [
                                "disabled",
                                "elevated"
                            ]
                        },
                        "scannerBar": {
                            "$ref": "#/definitions/shadow"
                        },
                        "sheet": {
                            "$ref": "#/definitions/shadow"
                        }
                    },
                    "required": [
                        "material",
                        "navDrawer",
                        "productCard",
                        "productImage",
                        "filter",
                        "cart",
                        "dialog",
                        "toast",
                        "contextMenu",
                        "buttons",
                        "scannerBar",
                        "sheet"
                    ]
                },
                "icons": {
                    "type": "object",
                    "properties": {
                        "accountBox": {
                            "$ref": "#/definitions/icon"
                        },
                        "addMore": {
                            "$ref": "#/definitions/icon"
                        },
                        "arrowDrop": {
                            "$ref": "#/definitions/icon"
                        },
                        "arrow": {
                            "$ref": "#/definitions/icon"
                        },
                        "arrowShadowed": {
                            "$ref": "#/definitions/icon"
                        },
                        "barcodeScanner": {
                            "$ref": "#/definitions/icon"
                        },
                        "box": {
                            "$ref": "#/definitions/icon"
                        },
                        "browse": {
                            "$ref": "#/definitions/icon"
                        },
                        "burger": {
                            "$ref": "#/definitions/icon"
                        },
                        "cart": {
                            "$ref": "#/definitions/icon"
                        },
                        "cartPlus": {
                            "$ref": "#/definitions/icon"
                        },
                        "checked": {
                            "$ref": "#/definitions/icon"
                        },
                        "check": {
                            "$ref": "#/definitions/icon"
                        },
                        "chevron": {
                            "$ref": "#/definitions/icon"
                        },
                        "creditCard": {
                            "$ref": "#/definitions/icon"
                        },
                        "cross": {
                            "$ref": "#/definitions/icon"
                        },
                        "description": {
                            "$ref": "#/definitions/icon"
                        },
                        "filter": {
                            "$ref": "#/definitions/icon"
                        },
                        "flashDisabled": {
                            "$ref": "#/definitions/icon"
                        },
                        "flashEnabled": {
                            "$ref": "#/definitions/icon"
                        },
                        "grid": {
                            "$ref": "#/definitions/icon"
                        },
                        "heart": {
                            "$ref": "#/definitions/icon"
                        },
                        "heartOutline": {
                            "$ref": "#/definitions/icon"
                        },
                        "home": {
                            "$ref": "#/definitions/icon"
                        },
                        "info": {
                            "$ref": "#/definitions/icon"
                        },
                        "infoOutline": {
                            "$ref": "#/definitions/icon"
                        },
                        "list": {
                            "$ref": "#/definitions/icon"
                        },
                        "localShipping": {
                            "$ref": "#/definitions/icon"
                        },
                        "lock": {
                            "$ref": "#/definitions/icon"
                        },
                        "logout": {
                            "$ref": "#/definitions/icon"
                        },
                        "magnifier": {
                            "$ref": "#/definitions/icon"
                        },
                        "more": {
                            "$ref": "#/definitions/icon"
                        },
                        "moreVert": {
                            "$ref": "#/definitions/icon"
                        },
                        "placeholder": {
                            "$ref": "#/definitions/icon"
                        },
                        "radioChecked": {
                            "$ref": "#/definitions/icon"
                        },
                        "radioUnchecked": {
                            "$ref": "#/definitions/icon"
                        },
                        "security": {
                            "$ref": "#/definitions/icon"
                        },
                        "share": {
                            "$ref": "#/definitions/icon"
                        },
                        "shoppingCart": {
                            "$ref": "#/definitions/icon"
                        },
                        "sort": {
                            "$ref": "#/definitions/icon"
                        },
                        "starHalf": {
                            "$ref": "#/definitions/icon"
                        },
                        "star": {
                            "$ref": "#/definitions/icon"
                        },
                        "starOutline": {
                            "$ref": "#/definitions/icon"
                        },
                        "tick": {
                            "$ref": "#/definitions/icon"
                        },
                        "trash": {
                            "$ref": "#/definitions/icon"
                        },
                        "unchecked": {
                            "$ref": "#/definitions/icon"
                        },
                        "viewList": {
                            "$ref": "#/definitions/icon"
                        },
                        "visibility": {
                            "$ref": "#/definitions/icon"
                        },
                        "visibilityOff": {
                            "$ref": "#/definitions/icon"
                        }
                    }
                },
                "assets": {
                    "type": "object"
                },
                "pages": {
                    "type": "array"
                }
            },
            "required": [
                "settings",
                "typography",
                "colors",
                "variables",
                "shadows",
                "icons",
                "assets",
                "pages"
            ]
        }
    },
    "required": [
        "theme"
    ]
}