Skip to content

Commit

Permalink
Font headers 1.75 default & backed foreach function
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-nginx committed Apr 26, 2019
1 parent ce511f8 commit 7a0c3d5
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 48 deletions.
10 changes: 6 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@ tagcloud:


# ---------------------------------------------------------------
# Font Settings. Introduced in NexT v5.0.1.
# Font Settings
# See: https://theme-next.org/docs/theme-settings/#Fonts-Customization
# ---------------------------------------------------------------
# Find fonts on Google Fonts (https://www.google.com/fonts)
# All fonts set here will have the following styles:
# light, light italic, normal, normal italic, bold, bold italic
Expand All @@ -441,6 +443,8 @@ tagcloud:
# ---------------------------------------------------------------

font:
# Use custom fonts families or not.
# Depended options: `external` and `family`.
enable: false

# Uri of fonts host, e.g. //fonts.googleapis.com (Default).
Expand All @@ -449,10 +453,8 @@ font:
# Font options:
# `external: true` will load this font family from `host` above.
# `family: Times New Roman`. Without any quotes.
# `size: x.x`. Use `em` as unit. Default: 0.875 (14px)
# `size: x.x`. Use `em` as unit. Default: 1 (16px)
# For all other font sizes classes will be relative from global size.
# //It's mean no need anymore to redefine sizes for each class,
# //but if you want it can be done with custom variables.

# Global font settings used for all elements inside <body>.
global:
Expand Down
32 changes: 20 additions & 12 deletions source/css/_common/scaffolding/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,33 @@ h1, h2, h3, h4, h5, h6 {
h1.post-title,
h2.post-title { font-size: $font-size-headings-title; }

div.post-body h1 { font-size: $font-size-headings-h1; }
div.post-body h2 { font-size: $font-size-headings-h2; }
div.post-body h3 { font-size: $font-size-headings-h3; }
div.post-body h4 { font-size: $font-size-headings-h4; }
div.post-body h5 { font-size: $font-size-headings-h5; }
div.post-body h6 { font-size: $font-size-headings-h6; }
//div.post-body h1 { font-size: $font-size-headings-h1; }
//div.post-body h2 { font-size: $font-size-headings-h2; }
//div.post-body h3 { font-size: $font-size-headings-h3; }
//div.post-body h4 { font-size: $font-size-headings-h4; }
//div.post-body h5 { font-size: $font-size-headings-h5; }
//div.post-body h6 { font-size: $font-size-headings-h6; }

for headline in (1..6) {
.posts-expand div.post-body h{headline} {
font-size: $font-size-headings-h + headline;
//code { font-size: $font-size-small; }
code { font-size: inherit; }
}
}

//for headline in (1..6) {
// h{headline} {
// font-size: $font-size-headings-base - $font-size-headings-step * headline;
// }
//}

div.post-body h1 code,
div.post-body h2 code,
div.post-body h3 code,
div.post-body h4 code,
div.post-body h5 code,
div.post-body h6 code { font-size: inherit; }
//div.post-body h1 code,
//div.post-body h2 code,
//div.post-body h3 code,
//div.post-body h4 code,
//div.post-body h5 code,
//div.post-body h6 code { font-size: inherit; }

p { margin: 0 0 20px 0; }

Expand Down
58 changes: 26 additions & 32 deletions source/css/_variables/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ $font-weight-bolder = 700


// Font size
//$font-size-base = 0.875rem // 14px
$font-size-base = 1em // 16px
$font-size-base = unit(hexo-config('font.global.size'), rem) if hexo-config('font.global.size') is a 'unit'

Expand All @@ -96,13 +95,6 @@ $font-size-large = unit($font-size-base + 0.125, rem) // 1.125rem | 1
$font-size-larger = unit($font-size-base + 0.25, rem) // 1.250rem | 20px
$font-size-largest = unit($font-size-base + 0.375, rem) // 1.375rem | 22px

//$font-size-smaller = unit($font-size-base - 0.125, rem) // 0.750rem | 12px
//$font-size-small = unit($font-size-base - 0.0625, rem) // 0.8125rem | 13px
//$font-size-large = unit($font-size-base + 0.125, rem) // 1rem | 16px
//$font-size-larger = unit($font-size-base + 0.25, rem) // 1.125rem | 18px
//$font-size-largest = unit($font-size-base + 0.375, rem) // 1.25rem | 20px
//$font-size-largestX = unit($font-size-base + 0.5, rem) // 1.375rem | 22px

// Headings font size
//$font-size-headings-title = 1.75em // 28px
//$font-size-headings-h1 = 1.625em // 26px
Expand All @@ -112,29 +104,31 @@ $font-size-largest = unit($font-size-base + 0.375, rem) // 1.375rem | 2
//$font-size-headings-h5 = 1.125em // 18px
//$font-size-headings-h6 = 1.0625em // 17px

// My Gemini
//$font-size-headings-title = 1.7em // 27.2px
//$font-size-headings-h1 = 1.6em // 25.6px
//$font-size-headings-h2 = 1.45em // 23.2px
//$font-size-headings-h3 = 1.3em // 20.8px
//$font-size-headings-h4 = 1.2em // 19.2px
//$font-size-headings-h5 = 1.08em // 17.28px
//$font-size-headings-h6 = 1.03em // 16.48px

// My Gemini Optimized
$font-size-headings-title = 1.6875em // 27px
$font-size-headings-h1 = 1.5625em // 25px
$font-size-headings-h2 = 1.4375em // 23px
$font-size-headings-h3 = 1.3125em // 21px
$font-size-headings-h4 = 1.1875em // 19px
$font-size-headings-h5 = 1.0625em // 17px
$font-size-headings-h6 = 1em // 16px

//$font-size-headings-step = 0.125em
//$font-size-headings-base = 1.6875em
//$font-size-headings-base = unit(hexo-config('font.headings.size'), em) if hexo-config('font.headings.size') is a 'unit'
//$font-size-headings-small = $font-size-headings-base - $font-size-headings-step
//$font-size-headings-large = $font-size-headings-base + $font-size-headings-step
// Gemini Optimized
//$font-size-headings-title = 1.6875em // 27px
//$font-size-headings-h1 = 1.5625em // 25px
//$font-size-headings-h2 = 1.4375em // 23px
//$font-size-headings-h3 = 1.3125em // 21px
//$font-size-headings-h4 = 1.1875em // 19px
//$font-size-headings-h5 = 1.0625em // 17px
//$font-size-headings-h6 = 1em // 16px

//$font-size-headings-base = 1.6875em // 27px
//$font-size-headings-base = 1.75em // 28px
//$font-size-headings-base = 1.8125em // 29px
//$font-size-headings-base = 1.875em // 30px
// Headings font size
$font-size-headings-step = 0.125em // 2px
$font-size-headings-base = 1.75em // 28px
$font-size-headings-base = unit(hexo-config('font.headings.size'), em) if hexo-config('font.headings.size') is a 'unit'

$font-size-headings-title = $font-size-headings-base // 1.75em | 28px
$font-size-headings-h1 = $font-size-headings-base - ($font-size-headings-step) // 1.625em | 26px
$font-size-headings-h2 = $font-size-headings-base - ($font-size-headings-step * 2) // 1.5em | 24px
$font-size-headings-h3 = $font-size-headings-base - ($font-size-headings-step * 3) // 1.375em | 22px
$font-size-headings-h4 = $font-size-headings-base - ($font-size-headings-step * 4) // 1.25em | 20px
$font-size-headings-h5 = $font-size-headings-base - ($font-size-headings-step * 5) // 1.125em | 18px
$font-size-headings-h6 = $font-size-headings-base - ($font-size-headings-step * 6 - $font-size-headings-step / 2) // 1.0625em | 17px

// Posts font size
//$font-size-posts = $font-size-base
Expand All @@ -160,7 +154,7 @@ $zindex-5 = 1050
// --------------------------------------------------
$table-width = 100%
$table-border-color = $gray-lighter
$table-font-size = $font-size-smaller
$table-font-size = $font-size-small
$table-content-alignment = left
$table-content-vertical = middle
$table-th-font-weight = 700
Expand Down

0 comments on commit 7a0c3d5

Please sign in to comment.