feat(doc-data): Add md-font component and update md-bg

This commit is contained in:
hyper 2026-06-30 18:40:22 +08:00
parent 548d6a0510
commit 0886a406bb
1 changed files with 52 additions and 5 deletions

View File

@ -116,25 +116,72 @@ CSV 要求包含 label, body 列,可选 group 列分组。支持 YAML front ma
fixed `,
usage: "用于战斗地图标注、地牢房间标记、任务地点指示等。",
},
{
tag: "md-font",
icon: "🔤",
title: "字体组件",
description:
"设置整个文档的字体和文字颜色,支持 Google Fonts、emfont 和系统本地字体三种来源。",
syntax:
':md-font[Noto Sans SC]{source="google" weight="400" color="#ff00dd"}',
props: [
{
name: "source",
type: "google | emfont | local",
default: "local",
desc: "字体来源",
},
{ name: "weight", type: "string", default: '"400"', desc: "字体粗细" },
{
name: "color",
type: "string",
desc: "文字颜色CSS 颜色值,如 #ff00dd、rgb(255,0,0)",
},
],
examples: `**Google 字体:**
:md-font[Noto Sans SC]{source="google"}
**Emfont **
:md-font[Source Han Serif]{source="emfont" weight="700"}
****
:md-font[STSong]
****
:md-font[Noto Sans SC]{source="google" color="#1a1a2e"}
:md-font[Noto Sans SC]{source="google" weight="700" color="crimson"}
`,
usage: "用于切换文档的显示字体和文字颜色,适配不同风格需求。",
},
{
tag: "md-bg",
icon: "🖼️",
title: "背景组件",
description: "将图片设置为当前文章卡片的背景,支持多种适配方式。",
syntax: ':md-bg[./images/dungeon-bg.jpg]{fit="cover"}',
description: "设置背景图片或纯色作为文章卡片背景,支持多种适配方式。",
syntax: ":md-bg[#ff00dd]",
props: [
{
name: "fit",
type: "cover | contain | fill | none | scale-down",
default: "cover",
desc: "背景适配方式",
desc: "背景适配方式(仅图片时生效)",
},
],
examples: `**设置背景图:**
:md-bg[./images/dungeon-bg.jpg]{fit="cover"}
`,
usage: "用于营造场景氛围,如地牢、森林、城镇等不同环境的背景。",
****
:md-bg[#2a1a3a]
:md-bg[rgb(200,50,50)]
:md-bg[#ff00dd]
CSS hexrgb`,
usage:
"用于营造场景氛围,如地牢、森林、城镇等不同环境的背景,或纯色区分不同主题。",
},
{
tag: "md-font",