From 7ec31e8948288dabc7c9855df70acaf8fb8895dd Mon Sep 17 00:00:00 2001 From: Song-Zi Vong Date: Mon, 17 Apr 2023 01:31:49 +0800 Subject: [PATCH] refactor: enhance the configurability of fonts (#986) --- _sass/addon/commons.scss | 2 +- _sass/addon/module.scss | 2 +- _sass/addon/variables.scss | 5 +++++ _sass/jekyll-theme-chirpy.scss | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/_sass/addon/commons.scss b/_sass/addon/commons.scss index e16184f..69ec76e 100644 --- a/_sass/addon/commons.scss +++ b/_sass/addon/commons.scss @@ -34,7 +34,7 @@ body { env(safe-area-inset-bottom) env(safe-area-inset-left); color: var(--text-color); -webkit-font-smoothing: antialiased; - font-family: 'Source Sans Pro', 'Microsoft Yahei', sans-serif; + font-family: $font-family-base; line-height: 1.75; } diff --git a/_sass/addon/module.scss b/_sass/addon/module.scss index 44f21d2..b13083a 100644 --- a/_sass/addon/module.scss +++ b/_sass/addon/module.scss @@ -7,7 +7,7 @@ %heading { color: var(--heading-color); font-weight: 400; - font-family: Lato, 'Microsoft Yahei', sans-serif; + font-family: $font-family-heading; } %section { diff --git a/_sass/addon/variables.scss b/_sass/addon/variables.scss index 1db532e..83faba1 100644 --- a/_sass/addon/variables.scss +++ b/_sass/addon/variables.scss @@ -28,3 +28,8 @@ $bottom-min-height: 35rem !default; /* syntax highlight */ $code-font-size: 0.85rem !default; + +/* fonts */ + +$font-family-base: 'Source Sans Pro', 'Microsoft Yahei', sans-serif; +$font-family-heading: Lato, 'Microsoft Yahei', sans-serif; diff --git a/_sass/jekyll-theme-chirpy.scss b/_sass/jekyll-theme-chirpy.scss index 5716f9d..1424a57 100644 --- a/_sass/jekyll-theme-chirpy.scss +++ b/_sass/jekyll-theme-chirpy.scss @@ -10,9 +10,9 @@ "colors/light-typography", "colors/dark-typography", - "addon/module", "addon/variables", "variables-hook", + "addon/module", "addon/syntax", "addon/commons",