前言
排版设置。
基本信息
- 英文名称:
Typography Control - 中文名称:排版控件
- Schema ID:
bricks://controls/typography - Schema 版本:
2.3 - 类型:
object
属性
font-family(string)font-size(string)font-weight(["string", "integer"])font-style(string)line-height(string)letter-spacing(string)text-align(string)text-transform(string)text-decoration(string)color:各种格式的颜色值。
Schema 定义
完整 JSON 定义
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "bricks://controls/typography",
"schemaVersion": "2.3",
"title": "Typography Control",
"description": "Typography settings",
"controlProperties": [
"type",
"label",
"group",
"css",
"hasRequired",
"tab",
"inline",
"deprecated"
],
"type": "object",
"properties": {
"font-family": {
"type": "string"
},
"font-size": {
"type": "string"
},
"font-weight": {
"type": [
"string",
"integer"
]
},
"font-style": {
"type": "string",
"enum": [
"normal",
"italic",
"oblique"
]
},
"line-height": {
"type": "string"
},
"letter-spacing": {
"type": "string"
},
"text-align": {
"type": "string",
"enum": [
"left",
"center",
"right",
"justify"
]
},
"text-transform": {
"type": "string",
"enum": [
"none",
"uppercase",
"lowercase",
"capitalize"
]
},
"text-decoration": {
"type": "string"
},
"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": "各种格式的颜色值。"
}
},
"titleZh": "排版控件",
"descriptionZh": "排版设置。"
}
补充说明
更多细节可参考 Bricks 官方 Academy 文档。