Bricks Schema 中文文档:背景控件

📄 原始资料  |  展开查看原始 JSON(background.json){ “$schema”: “https://json-schema.org/draft/2020-12/schema”, “$id”: “bricks://controls/background”, “schemaVersion”: “2.3”, “title”: “Background Control”, “description”: “Background settings”, “controlProperties”: [ “type”, “label”, “group”, “css”, “t…

📄 原始资料  |  展开查看原始 JSON(background.json)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "bricks://controls/background",
  "schemaVersion": "2.3",
  "title": "Background Control",
  "description": "Background settings",
  "controlProperties": [
    "type",
    "label",
    "group",
    "css",
    "tab"
  ],
  "type": "object",
  "properties": {
    "color": {
      "description": "Color value in various formats",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "hex": {
              "type": "string",
              "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
            }
          },
          "required": [
            "hex"
          ]
        },
        {
          "type": "object",
          "properties": {
            "rgb": {
              "type": "string",
              "pattern": "^rgba?\\("
            }
          },
          "required": [
            "rgb"
          ]
        },
        {
          "type": "object",
          "properties": {
            "hsl": {
              "type": "string",
              "pattern": "^hsla?\\("
            }
          },
          "required": [
            "hsl"
          ]
        },
        {
          "type": "object",
          "properties": {
            "raw": {
              "type": "string",
              "description": "Raw color value or CSS variable",
              "descriptionZh": "原始颜色值或 CSS 变量。"
            }
          },
          "required": [
            "raw"
          ]
        }
      ],
      "descriptionZh": "各种格式的颜色值。"
    },
    "image": {
      "type": "object",
      "description": "Image settings",
      "properties": {
        "id": {
          "type": [
            "string",
            "integer"
          ]
        },
        "filename": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "size": {
          "type": "string"
        },
        "full": {
          "type": "string"
        },
        "useDynamicData": {
          "type": "string"
        }
      },
      "descriptionZh": "图像设置。"
    },
    "video": {
      "type": "object",
      "description": "Video settings",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "media",
            "youtube",
            "vimeo",
            "url"
          ]
        },
        "id": {
          "type": [
            "string",
            "integer"
          ]
        },
        "url": {
          "type": "string"
        },
        "youtubeId": {
          "type": "string"
        },
        "vimeoId": {
          "type": "string"
        },
        "autoplay": {
          "type": "boolean"
        },
        "loop": {
          "type": "boolean"
        },
        "muted": {
          "type": "boolean"
        },
        "controls": {
          "type": "boolean"
        }
      },
      "descriptionZh": "视频设置。"
    },
    "size": {
      "type": "string"
    },
    "position": {
      "type": "string"
    },
    "repeat": {
      "type": "string",
      "enum": [
        "repeat",
        "repeat-x",
        "repeat-y",
        "no-repeat"
      ]
    },
    "attachment": {
      "type": "string",
      "enum": [
        "scroll",
        "fixed",
        "local"
      ]
    }
  },
  "titleZh": "背景控件",
  "descriptionZh": "背景设置。"
}

前言

背景设置。

基本信息

  • 英文名称Background Control
  • 中文名称:背景控件
  • Schema IDbricks://controls/background
  • Schema 版本2.3
  • 类型object

属性

  • color:各种格式的颜色值。
  • image (object):图像设置。
  • video (object):视频设置。
  • size (string)
  • position (string)
  • repeat (string)
  • attachment (string)

Schema 定义

完整 JSON 定义

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "bricks://controls/background",
  "schemaVersion": "2.3",
  "title": "Background Control",
  "description": "Background settings",
  "controlProperties": [
    "type",
    "label",
    "group",
    "css",
    "tab"
  ],
  "type": "object",
  "properties": {
    "color": {
      "description": "Color value in various formats",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "hex": {
              "type": "string",
              "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
            }
          },
          "required": [
            "hex"
          ]
        },
        {
          "type": "object",
          "properties": {
            "rgb": {
              "type": "string",
              "pattern": "^rgba?\\("
            }
          },
          "required": [
            "rgb"
          ]
        },
        {
          "type": "object",
          "properties": {
            "hsl": {
              "type": "string",
              "pattern": "^hsla?\\("
            }
          },
          "required": [
            "hsl"
          ]
        },
        {
          "type": "object",
          "properties": {
            "raw": {
              "type": "string",
              "description": "Raw color value or CSS variable",
              "descriptionZh": "原始颜色值或 CSS 变量。"
            }
          },
          "required": [
            "raw"
          ]
        }
      ],
      "descriptionZh": "各种格式的颜色值。"
    },
    "image": {
      "type": "object",
      "description": "Image settings",
      "properties": {
        "id": {
          "type": [
            "string",
            "integer"
          ]
        },
        "filename": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "size": {
          "type": "string"
        },
        "full": {
          "type": "string"
        },
        "useDynamicData": {
          "type": "string"
        }
      },
      "descriptionZh": "图像设置。"
    },
    "video": {
      "type": "object",
      "description": "Video settings",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "media",
            "youtube",
            "vimeo",
            "url"
          ]
        },
        "id": {
          "type": [
            "string",
            "integer"
          ]
        },
        "url": {
          "type": "string"
        },
        "youtubeId": {
          "type": "string"
        },
        "vimeoId": {
          "type": "string"
        },
        "autoplay": {
          "type": "boolean"
        },
        "loop": {
          "type": "boolean"
        },
        "muted": {
          "type": "boolean"
        },
        "controls": {
          "type": "boolean"
        }
      },
      "descriptionZh": "视频设置。"
    },
    "size": {
      "type": "string"
    },
    "position": {
      "type": "string"
    },
    "repeat": {
      "type": "string",
      "enum": [
        "repeat",
        "repeat-x",
        "repeat-y",
        "no-repeat"
      ]
    },
    "attachment": {
      "type": "string",
      "enum": [
        "scroll",
        "fixed",
        "local"
      ]
    }
  },
  "titleZh": "背景控件",
  "descriptionZh": "背景设置。"
}

补充说明

更多细节可参考 Bricks 官方 Academy 文档