Skip to content

Commit

Permalink
Merge pull request #311 from fi3ework/dev
Browse files Browse the repository at this point in the history
fix: remove lazy modern code
  • Loading branch information
LolipopJ committed Aug 24, 2021
2 parents 7bc7eea + ed6f131 commit 8642201
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ z=\dfrac{3\pi}{2}(1+2t)\sin(\dfrac{3\pi}{2}(1+2t)), &

**实验性功能**,自定义字体依赖于 CSS Variables 能力,部分浏览器存在**兼容性问题**

为了确保 `hexo generate` 构建成功,建议使用 Node.js 14.x 或更新版本。

您需要首先引入自定义字体功能,在 `layout/layout.ejs` 中对应部分添加如下字段:

``` ejs
Expand Down
4 changes: 2 additions & 2 deletions layout/_partial/custom-font.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- Check browser compatibility of CSS variables -->
<script>
var browserSupportCSSVariables = window.CSS?.supports && window.CSS.supports('--a', 0)
var browserSupportCSSVariables = window.CSS && window.CSS.supports && window.CSS.supports('--a', 0);
</script>
<!-- Custom Font -->
<% if (theme.custom_font?.enable) { %>
<% if (theme.custom_font && theme.custom_font.enable) { %>
<script>
if (browserSupportCSSVariables) {
var customFontName = '<%= theme.custom_font.name %>'
Expand Down

0 comments on commit 8642201

Please sign in to comment.