Skip to content

Commit 1f857f8

Browse files
committed
update docs
1 parent 3463b40 commit 1f857f8

File tree

1 file changed

+59
-7
lines changed

1 file changed

+59
-7
lines changed

content/docs/themes/yohaku/config.mdx

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,16 @@ Yohaku 的配置沿用 Shiro 的配置体系,在 Mix Space 后台「配置与
4545

4646
### Title 模板 (`title.template`)
4747

48-
包括多个元素(如 `h1`, `code`, `span`),每个元素都可以自定义文本内容和样式(通过 CSS 类)
48+
包括多个元素(如 `span`, `code`, `h1`),每个元素都可以自定义文本内容和样式。
4949

50-
**如何使用**: 修改 `text``class` 字段来自定义标题的文本内容和样式。你可以通过添加或删除元素来调整标题的结构。
50+
| 字段 | 类型 | 说明 |
51+
|------|------|------|
52+
| `type` | `string` | 渲染标签,如 `span``code``br``br` 表示显式换行。 |
53+
| `text` | `string` | 文本内容。 |
54+
| `class` | `string` | Tailwind CSS 类名。 |
55+
| `style` | `object` | **推荐**。内联样式对象,可直接写 CSS 属性(如 `fontWeight``color``animation` 等),不依赖 Tailwind JIT 扫描,且能跟随 CSS 变量自动适配暗色主题。 |
56+
57+
**如何使用**: 修改 `text``style` 字段来自定义标题的文本内容和样式。你可以通过添加或删除元素来调整标题的结构。
5158

5259
### 描述 (`description`)
5360

@@ -208,15 +215,60 @@ interface Hitokoto {
208215
"hero": {
209216
"title": {
210217
"template": [
211-
{ "type": "h1", "text": "Hi, I'm ", "class": "font-light text-4xl" },
212-
{ "type": "h1", "text": "Name", "class": "font-medium mx-2 text-4xl" },
213-
{ "type": "h1", "text": "👋。", "class": "font-light text-4xl" },
218+
{
219+
"type": "span",
220+
"text": "Hi, I'm ",
221+
"style": { "fontWeight": 300, "opacity": 0.85 }
222+
},
223+
{
224+
"type": "span",
225+
"text": "Innei",
226+
"style": {
227+
"fontWeight": 500,
228+
"color": "var(--color-accent)",
229+
"letterSpacing": "-0.02em"
230+
}
231+
},
232+
{
233+
"type": "span",
234+
"text": " 👋",
235+
"style": {
236+
"fontWeight": 300,
237+
"display": "inline-block",
238+
"transform": "rotate(-8deg)"
239+
}
240+
},
214241
{ "type": "br" },
215-
{ "type": "h1", "text": "A ", "class": "font-light text-4xl" },
242+
{
243+
"type": "span",
244+
"text": "A NodeJS Full Stack ",
245+
"style": { "fontWeight": 300, "opacity": 0.8 }
246+
},
216247
{
217248
"type": "code",
218249
"text": "<Developer />",
219-
"class": "font-medium mx-2 text-3xl rounded p-1"
250+
"style": {
251+
"display": "inline-block",
252+
"fontFamily": "var(--font-mono)",
253+
"fontSize": "0.72em",
254+
"fontWeight": 500,
255+
"padding": "0.25em 0.55em",
256+
"borderRadius": "0.35em",
257+
"backgroundColor": "color-mix(in srgb, var(--color-accent) 10%, transparent)",
258+
"color": "var(--color-accent)",
259+
"border": "1px solid color-mix(in srgb, var(--color-accent) 22%, transparent)"
260+
}
261+
},
262+
{
263+
"type": "span",
264+
"style": {
265+
"display": "inline-block",
266+
"width": "2px",
267+
"height": "0.9em",
268+
"backgroundColor": "var(--color-accent)",
269+
"marginLeft": "2px",
270+
"animation": "blink 1.2s linear infinite"
271+
}
220272
}
221273
]
222274
},

0 commit comments

Comments
 (0)