From 6ae95666ababef0c0138aaddd7248530d12c4e96 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Wed, 12 Oct 2022 23:19:10 +0800 Subject: [PATCH] font-family --- _config.yml | 4 ++++ source/css/_custom.styl | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index d2cde00..37234f5 100755 --- a/_config.yml +++ b/_config.yml @@ -365,6 +365,10 @@ plugins: style: darkmode: auto # auto / always / false smooth_scroll: true # true / false + font-family: + logo: system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif + body: system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif + code: Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif theme: light: '#f8f8f8' dark: '#313438' diff --git a/source/css/_custom.styl b/source/css/_custom.styl index 363c036..b2667ed 100644 --- a/source/css/_custom.styl +++ b/source/css/_custom.styl @@ -38,9 +38,18 @@ $dark-site-bg-mobile = black $ff-body = system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif $ff-code = Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif - $ff-logo = $ff-body +if hexo-config('style.font-family.body') + $ff-body = convert(hexo-config('style.font-family.body')) + +if hexo-config('style.font-family.code') + $ff-code = convert(hexo-config('style.font-family.code')) + +if hexo-config('style.font-family.logo') + $ff-logo = convert(hexo-config('style.font-family.logo')) + + // font size $fs-root = 16px $fs-15 = .9375rem