Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🛠 提高主题加载速度 #16

Closed
jinghu-moon opened this issue Aug 21, 2022 · 0 comments
Closed

🛠 提高主题加载速度 #16

jinghu-moon opened this issue Aug 21, 2022 · 0 comments
Assignees

Comments

@jinghu-moon
Copy link
Owner

jinghu-moon commented Aug 21, 2022

与朋友讨论,此功能将于下个版本内置,使用方法见主题说明文档

可能会存在一些细节问题,请酌情使用

提高主题加载速度的方法

如果你使用这种方法,开发者认为 HarmonyOS_Sans_SC_Regular 挺不错的。

使用此方法,主题加载时间与其他主题接近。

目前此代码未加入主题代码中,使用与否,由用户决定。

  1. 删除 / 注释 fonts.css 文件内所有代码。

  2. fonts.css 文件添加如下代码:

    @font-face {
      font-family : "玄宋45S";
      src         : url("../Fonts/Chinese-Fonts/HYXuanSong45S.woff2");
      font-display: swap;
    }
    
    @font-face {
      font-family : "Lora-Regular";
      src         : url("../Fonts/English-Fonts/Lora-Regular.woff2");
      font-display: swap;
    }
    
    /* 中、英文字体,请按自己的喜好选择 */
  3. root-element.css 文件添加以下代码:

    :root {
        --html-text-en-font: "Lora-Regular";
        --html-text-cn-font: "玄宋45S";;
    }
  4. see-yue.css 文件开头在 html 选择器添加以下代码:

    html {
        font-family: var(--html-text-en-font), var(--html-text-cn-font);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant