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

Use em instead of px as the font size unit #1006

Merged
merged 18 commits into from
Jul 30, 2019
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ font:
# Font options:
# `external: true` will load this font family from `host` above.
# `family: Times New Roman`. Without any quotes.
# `size: x.x`. Use `px` as unit. Default: 16
# `size: x.x`. Use `em` as unit. Default: 1 (16px)

# Global font settings used for all elements inside <body>.
global:
Expand Down
2 changes: 1 addition & 1 deletion source/css/_schemes/Muse/_menu.styl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
+mobile() {
position: absolute;
left: 0;
top: 52px;
top: 77px;
margin: 0;
width: 100%;
padding: 0;
Expand Down
4 changes: 2 additions & 2 deletions source/css/_variables/Gemini.styl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// --------------------------------------------------
$body-bg-color = #eee

$font-size-headings-base = 30px
$font-size-headings-base = unit(hexo-config('font.headings.size'), px) if hexo-config('font.headings.size') is a 'unit'
$font-size-headings-base = 1.875em
$font-size-headings-base = unit(hexo-config('font.headings.size'), em) if hexo-config('font.headings.size') is a 'unit'

// Borders.
// --------------------------------------------------
Expand Down
24 changes: 12 additions & 12 deletions source/css/_variables/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,21 @@ $font-weight-bolder = 700


// Font size
$font-size-base = 16px
$font-size-base = unit(hexo-config('font.global.size'), px) if hexo-config('font.global.size') is a 'unit'
$font-size-smallest = $font-size-base - 4px
$font-size-smaller = $font-size-base - 3px
$font-size-small = $font-size-base - 2px
$font-size-base = 1em
$font-size-base = unit(hexo-config('font.global.size'), em) if hexo-config('font.global.size') is a 'unit'
$font-size-smallest = $font-size-base - 0.25em
$font-size-smaller = $font-size-base - 0.1875em
$font-size-small = $font-size-base - 0.125em
$font-size-medium = $font-size-base
$font-size-large = $font-size-base + 2px
$font-size-larger = $font-size-base + 4px
$font-size-largest = $font-size-base + 6px
$font-size-large = $font-size-base + 0.125em
$font-size-larger = $font-size-base + 0.25em
$font-size-largest = $font-size-base + 0.375em


// Headings font size
$font-size-headings-step = 2px
$font-size-headings-base = 24px
$font-size-headings-base = unit(hexo-config('font.headings.size'), px) if hexo-config('font.headings.size') is a 'unit'
$font-size-headings-step = 0.125em
$font-size-headings-base = 1.5em
$font-size-headings-base = unit(hexo-config('font.headings.size'), em) if hexo-config('font.headings.size') is a 'unit'


// Global line height
Expand Down Expand Up @@ -200,7 +200,7 @@ $brand-hover-color = white
$brand-bg = $black-deep

$title-font-size = $font-size-largest
$title-font-size = unit(hexo-config('font.title.size'), px) if hexo-config('font.title.size') is a 'unit'
$title-font-size = unit(hexo-config('font.title.size'), em) if hexo-config('font.title.size') is a 'unit'
$subtitle-font-size = $font-size-smaller
$subtitle-color = $grey-dark
$site-subtitle-color = $grey-dark
Expand Down