Skip to content

Commit 0b95652

Browse files
committed
字体优化
使用 fontTools 将 `NotoSansSC-VariableFont_wght.ttf` 转换为 7.4MB 的 WOFF2,并在 `extra.css` 中加入 `font-display: swap` 及权重范围声明,降低首屏阻塞风险并保留 TTF 作为回退。
1 parent f5a08ff commit 0b95652

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

7.4 MB
Binary file not shown.

docs/stylesheets/extra.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,9 @@ img[alt="logo"] {
5353

5454
@font-face {
5555
font-family: "Noto Sans SC - local";
56-
src: "NotoSansSC-VariableFont_wght.ttf";
57-
}
56+
src: url("NotoSansSC-VariableFont_wght.woff2") format("woff2"),
57+
url("NotoSansSC-VariableFont_wght.ttf") format("truetype");
58+
font-display: swap;
59+
font-style: normal;
60+
font-weight: 100 900;
61+
}

0 commit comments

Comments
 (0)