Skip to content

Commit 26c0f63

Browse files
authored
Merge pull request iissnan#1879 from julianxhokaxhiu/feature/font-configuration
Improve font configurations for global and headings
2 parents 00bb2d6 + ea97ca6 commit 26c0f63

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

_config.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ sidebar:
161161

162162
# Scroll percent label in b2t button
163163
scrollpercent: false
164-
164+
165165
# Enable sidebar on narrow view
166166
onmobile: false
167167

@@ -264,32 +264,46 @@ font:
264264
global:
265265
# external: true will load this font family from host.
266266
external: true
267+
# family: the font family
267268
family: Lato
269+
# size: the font size. Use `px` as unit
270+
size:
268271

269272
# Font settings for Headlines (h1, h2, h3, h4, h5, h6)
270273
# Fallback to `global` font settings.
271274
headings:
275+
# external: true will load this font family from host.
272276
external: true
277+
# family: the font family
273278
family:
279+
# size: the font size. Use `px` as unit
280+
size:
274281

275282
# Font settings for posts
276283
# Fallback to `global` font settings.
277284
posts:
285+
# external: true will load this font family from host.
278286
external: true
287+
# family: the font family
279288
family:
280289

281290
# Font settings for Logo
282291
# Fallback to `global` font settings.
283-
# The `size` option use `px` as unit
284292
logo:
293+
# external: true will load this font family from host.
285294
external: true
295+
# family: the font family
286296
family:
297+
# size: the font size. Use `px` as unit
287298
size:
288299

289300
# Font settings for <code> and code blocks.
290301
codes:
302+
# external: true will load this font family from host.
291303
external: true
304+
# family: the font family
292305
family:
306+
# size: the font size. Use `px` as unit
293307
size:
294308

295309

@@ -330,8 +344,8 @@ changyan:
330344
appid:
331345
appkey:
332346

333-
334-
# Valine.
347+
348+
# Valine.
335349
# You can get your appid and appkey from https://leancloud.cn
336350
# more info please open https://github.com/xCss/Valine
337351
valine:

source/css/_common/components/post/post-title.styl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
.posts-expand .post-title {
2-
font-size: 26px;
32
text-align: center;
43
word-break: break-word;
54
font-weight: $posts-expand-title-font-weight
6-
7-
+mobile() {
8-
font-size: 22px;
9-
}
105
}
116
.posts-expand .post-title-link {
127
display: inline-block;

source/css/_variables/base.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ $font-weight-bolder = 700
9292

9393
// Font size
9494
$font-size-base = 14px
95+
$font-size-base = unit(hexo-config('font.global.size'), px) if hexo-config('font.global.size') is a 'unit'
9596
$font-size-small = $font-size-base - 2px
9697
$font-size-smaller = $font-size-base - 4px
9798
$font-size-large = $font-size-base + 2px
@@ -101,6 +102,7 @@ $font-size-larger = $font-size-base + 4px
101102
// Headings font size
102103
$font-size-headings-step = 2px
103104
$font-size-headings-base = 24px
105+
$font-size-headings-base = unit(hexo-config('font.headings.size'), px) if hexo-config('font.headings.size') is a 'unit'
104106
$font-size-headings-small = $font-size-headings-base - $font-size-headings-step
105107
$font-size-headings-smaller = $font-size-headings-small - $font-size-headings-step
106108
$font-size-headings-large = $font-size-headings-base + $font-size-headings-step

0 commit comments

Comments
 (0)