-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Improve font configurations for global and headings #1879
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,7 @@ $font-weight-bolder = 700 | |
|
||
// Font size | ||
$font-size-base = 14px | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems duplicate here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following the style of the other declaration, seems a safe "default" way in stylus. Isn't it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, but i think need to set 14px in config by default instead of reading font:
global:
size: 14 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I will create another PR then to get rid of this double declarations. I saw a lot of them during the patch making. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hope u know what u are doing. |
||
$font-size-base = unit(hexo-config('font.global.size'), px) if hexo-config('font.global.size') is a 'unit' | ||
$font-size-small = $font-size-base - 2px | ||
$font-size-smaller = $font-size-base - 4px | ||
$font-size-large = $font-size-base + 2px | ||
|
@@ -101,6 +102,7 @@ $font-size-larger = $font-size-base + 4px | |
// 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-small = $font-size-headings-base - $font-size-headings-step | ||
$font-size-headings-smaller = $font-size-headings-small - $font-size-headings-step | ||
$font-size-headings-large = $font-size-headings-base + $font-size-headings-step | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to define variables here like
font-size: $font-size-base;
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is inherited from the global h1...h6 declaration in the scaffolding part. While this one was just overriding it always with a fixed px value.