Skip to content

Commit 65a618b

Browse files
committed
docs(theme): correct font docs, close #4505
1 parent 52867bf commit 65a618b

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

docs/theme/src/guide/customize/font.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ For common font families, they can generally be divided into **serif**[^serif] a
1919

2020
## Modifying Fonts
2121

22-
The theme provides `$font-family`, `$font-family-heading` and `$font-family-mono` three variables to control the font in `.vuepress/styles/palette.scss`.
22+
The theme provides `$vp-font`, `$vp-font-heading` and `$vp-font-mono` three variables to control the font in `.vuepress/styles/palette.scss`.
2323

24-
- `$font-family`: the font used on normal text
25-
- `$font-family-heading:` font for heading elements
26-
- `$font-family-mono`: the font used in code block and inline codes
24+
- `$vp-font`: the font used on normal text
25+
- `$vp-font-heading:` font for heading elements
26+
- `$vp-font-mono`: the font used in code block and inline codes
2727

2828
By default, the theme uses sans serif with normal text.
2929

3030
::: tip Use Serifs
3131

32-
If you prefer serif fonts, you can modify `$font-family` to the font you want.
32+
If you prefer serif fonts, you can modify `$vp-font` to the font you want.
3333

3434
The following font families are our recommended first choice for serif fonts:
3535

3636
```scss
37-
$font-family: 'Georgia, -apple-system, "Nimbus Roman No9 L", sans-serif';
37+
$vp-font: 'Georgia, -apple-system, "Nimbus Roman No9 L", sans-serif';
3838
```
3939

4040
:::
@@ -100,11 +100,11 @@ export default defineUserConfig({
100100
});
101101
```
102102

103-
Also modify the `$font-family` variable in the palette file:
103+
Also modify the `$vp-font` variable in the palette file:
104104

105105
```scss title=".vuepress/styles/palette.scss"
106106
// apply font
107-
$font-family: "Lora, serif";
107+
$vp-font: "Lora, serif";
108108
```
109109

110110
In this way, you can use lora font in your website.

docs/theme/src/zh/guide/customize/font.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@ tag:
2525

2626
## 修改主题字体
2727

28-
主题在 `.vuepress/styles/palette.scss` 中提供了 `$font-family``$font-family-heading``$font-family-mono` 三个变量控制字体。
28+
主题在 `.vuepress/styles/palette.scss` 中提供了 `$vp-font``$vp-font-heading``$vp-font-mono` 三个变量控制字体。
2929

30-
- `$font-family`: 普通文本上使用的字体
31-
- `$font-family-heading:` 用于标题元素的字体
32-
- `$font-family-mono`: 代码上使用的字体
30+
- `$vp-font`: 普通文本上使用的字体
31+
- `$vp-font-heading:` 用于标题元素的字体
32+
- `$vp-font-mono`: 代码上使用的字体
3333

3434
默认情况下,主题在普通文本上使用无衬线体。
3535

3636
::: tip 使用衬线体
3737

38-
如果你更喜欢衬线体,你可以自行修改 `$font-family` 为你想要的字体。
38+
如果你更喜欢衬线体,你可以自行修改 `$vp-font` 为你想要的字体。
3939

4040
中文博客下最常使用的字体是 Adobe 发布的思源宋体[^noto-serif-sc],因为它具有非常宽松的协议。当然,思源宋体并不存在于大多设备上,所以你可能需要导入这个字体。你可以通过 [GitHub](https://github.com/googlefonts/noto-cjk) 下载该字体引入或直接使用 [Google Font CDN](https://fonts.google.com/noto/specimen/Noto+Serif+SC)
4141

4242
如下字体族是我们推荐的衬线体首选:
4343

4444
```scss
45-
$font-family: 'Georgia, -apple-system, "Nimbus Roman No9 L", "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Microsoft Yahei", "WenQuanYi Micro Hei", "ST Heiti", sans-serif';
45+
$vp-font: 'Georgia, -apple-system, "Nimbus Roman No9 L", "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Microsoft Yahei", "WenQuanYi Micro Hei", "ST Heiti", sans-serif';
4646
```
4747

4848
:::
@@ -108,11 +108,11 @@ export default defineUserConfig({
108108
});
109109
```
110110

111-
同时在调色板文件中修改 `$font-family` 变量:
111+
同时在调色板文件中修改 `$vp-font` 变量:
112112

113113
```scss title=".vuepress/styles/palette.scss"
114114
// 应用字体
115-
$font-family: '"Noto Serif SC", serif';
115+
$vp-font: '"Noto Serif SC", serif';
116116
```
117117

118118
这样你就可以在网站中使用思源宋体字体了。

0 commit comments

Comments
 (0)