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

Remove all hardcoded font sizes with replacing them on em #726

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ tagcloud:
# light, light italic, normal, normal italic, bold, bold italic
# Be aware that setting too much fonts will cause site running slowly
# ---------------------------------------------------------------
# To avoid space between header and sidebar in scheme Pisces / Gemini, Web Safe fonts are recommended for `global` (and `logo`):
# To avoid space between header and sidebar in scheme Pisces / Gemini, Web Safe fonts are recommended for `global` (and `title`):
# Arial | Tahoma | Helvetica | Times New Roman | Courier New | Verdana | Georgia | Palatino | Garamond | Comic Sans MS | Trebuchet MS
# ---------------------------------------------------------------

Expand All @@ -457,22 +457,21 @@ font:
family: Lato
size:

# Font settings for Headlines (H1, H2, H3, H4, H5, H6).
# Fallback to `global` font settings.
# Font settings for headlines (<h1> to <h6>).
headings:
external: true
family:
size:

# Font settings for posts.
# Fallback to `global` font settings.
# Fallback to `global` font size settings.
posts:
external: true
family:
size:

# Font settings for Logo.
# Fallback to `global` font settings.
logo:
# Font settings for site title.
title:
external: true
family:
size:
Expand All @@ -481,7 +480,6 @@ font:
codes:
external: true
family:
size:


# ---------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions layout/_third-party/copy-code.swig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
{% endif %}
ta.blur(); // For iOS
$(this).blur();
document.body.removeChild(ta);
})).on('mouseleave', function(e) {
var $b = $(this).find('.copy-btn');
setTimeout(function() {
Expand Down
1 change: 0 additions & 1 deletion source/css/_common/components/comments.styl

This file was deleted.

1 change: 0 additions & 1 deletion source/css/_common/components/components.styl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

@import "buttons";
@import "pagination";
@import "comments";
@import (hexo-config('back2top.sidebar') ? "back-to-top-sidebar" : "back-to-top") if (hexo-config('back2top.enable'));

@import "header";
Expand Down
2 changes: 1 addition & 1 deletion source/css/_common/components/footer/footer.styl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.footer {
font-size: 14px;
font-size: $font-size-base;
color: $grey-dark;

img { border: none; }
Expand Down
2 changes: 1 addition & 1 deletion source/css/_common/components/header/menu.styl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

a, span.exturl {
show();
font-size: 13px;
font-size: $font-size-small;
line-height: inherit;
border-bottom: 1px solid $menu-link-border;
transition-property: border-color;
Expand Down
3 changes: 2 additions & 1 deletion source/css/_common/components/header/site-meta.styl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
color: $brand-color;
background: $brand-bg;
border-bottom: none;
line-height: $logo-font-size;
&:hover { color: $brand-hover-color; }
}

Expand All @@ -25,7 +26,7 @@
.site-title {
display: inline-block;
vertical-align: top;
line-height: 36px;
line-height: $logo-font-size * 1.5;
font-size: $logo-font-size;
font-weight: normal;
font-family: $font-family-logo;
Expand Down
2 changes: 0 additions & 2 deletions source/css/_common/components/highlight/highlight.styl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ $code-block {
overflow: auto;
margin: 20px 0;
padding: 0;
font-size $code-font-size;
color: $highlight-foreground;
background: $highlight-background;
line-height: $line-height-code-block;
Expand All @@ -22,7 +21,6 @@ code {
color: $code-foreground;
background: $code-background;
border-radius: $code-border-radius;
font-size: $code-font-size;
}

pre {
Expand Down
1 change: 0 additions & 1 deletion source/css/_common/components/pages/archive.styl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
}

.fa-external-link {
font-size: 15px;
margin-left: 5px;
}
}
2 changes: 1 addition & 1 deletion source/css/_common/components/pages/breadcrumb.styl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ul.breadcrumb {
margin: 1em 0;
padding: 0 2em;
text-align: center;
font-size: $font-size-small
font-size: $font-size-smaller;

& li {
display: inline;
Expand Down
1 change: 0 additions & 1 deletion source/css/_common/components/pages/pages.styl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
@import "archive";
@import "categories";
@import "schedule";
@import "post-detail";
@import "breadcrumb";
@import "tag-cloud";
6 changes: 0 additions & 6 deletions source/css/_common/components/pages/post-detail.styl

This file was deleted.

8 changes: 4 additions & 4 deletions source/css/_common/components/post/post-collapse.styl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
content: " ";
position: absolute;
left: 0;
top: 12px;
top: $font-size-smaller;
width: 6px;
height: 6px;
margin-left: -4px;
Expand All @@ -85,16 +85,16 @@

.post-meta {
position: absolute;
font-size: 12px;
font-size: $font-size-smaller;
left: 20px;
top: 5px;
}

.post-comments-count { display: none; }

.post-title {
margin-left: 60px;
font-size: 16px;
margin-left: $font-size-smaller * 5;
font-size: $font-size-large;
font-weight: normal;
line-height: inherit;

Expand Down
4 changes: 0 additions & 4 deletions source/css/_common/components/post/post-copyright.styl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@
border-left: $post-copyright.border.width $post-copyright.border.style $post-copyright.border.color;
background-color: $post-copyright.bg;
list-style: none;

i.fa {
font-size: 15px;
}
}
4 changes: 2 additions & 2 deletions source/css/_common/components/post/post-meta.styl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
margin: 3px 0 60px 0;
color: $grey-dark;
font-family: $font-family-posts;
font-size: 12px;
font-size: $font-size-smaller;
text-align: center;

.post-category-list {
Expand All @@ -13,7 +13,7 @@
.post-category-list-link { color: $grey-dark; }

.post-description {
font-size: 14px;
font-size: $font-size-base;
margin-top: 2px;
}

Expand Down
4 changes: 2 additions & 2 deletions source/css/_common/components/post/post-nav.styl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
position: relative;
show();
line-height: 25px;
font-size: 14px;
font-size: $font-size-base;
color: $link-color;
border-bottom: none;

Expand All @@ -33,7 +33,7 @@
}

.fa {
font-size: 12px;
font-size: $font-size-smaller;
margin-right: 5px;
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/css/_common/components/post/post-tags.styl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
a {
display: inline-block;
margin-right: 10px;
font-size: 13px;
font-size: $font-size-small;
}
}
1 change: 0 additions & 1 deletion source/css/_common/components/post/post-title.styl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
}

.fa {
font-size: 20px;
margin-left: 5px;
}
}
2 changes: 1 addition & 1 deletion source/css/_common/components/post/post-widgets.styl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

.social-like {
font-size: 14px;
font-size: $font-size-base;
text-align: center;
display: flex;
justify-content: center;
Expand Down
9 changes: 7 additions & 2 deletions source/css/_common/components/post/post.styl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.post-body {
word-wrap();
font-family: $font-family-posts;
font-size: $font-size-posts;
}

.post-body span.exturl {
.fa {
font-size: 14px;
margin-left: 4px;
}
}
Expand All @@ -29,10 +29,15 @@

.post-sticky-flag {
display: inline-block;
font-size: 16px;
font-size: $font-size-large;
transform: rotate(30deg);
}

.comments {
margin: 60px 20px 0;
overflow: hidden;
}

.use-motion {
if hexo-config('motion.transition.post_block') {
.post-block,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
margin-right: 10px;
margin-bottom: 10px;
border-bottom-color: $black-light;
font-size: 13px;
font-size: $font-size-small;
if hexo-config('social_icons.transition') { the-transition(); }

&:before {
Expand Down
4 changes: 2 additions & 2 deletions source/css/_common/components/sidebar/sidebar-blogroll.styl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.links-of-blogroll {
margin-top: 10px;
font-size: 13px;
font-size: $font-size-small;
}

.links-of-blogroll-title {
margin-top: 0;
font-size: 14px;
font-size: $font-size-base;
font-weight: $font-weight-bold;
}
.links-of-blogroll-list {
Expand Down
2 changes: 1 addition & 1 deletion source/css/_common/components/sidebar/sidebar-button.styl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

i {
color: rgb(252, 100, 35);
font-size: 14px;
font-size: $font-size-base;
}

&:hover {
Expand Down
2 changes: 1 addition & 1 deletion source/css/_common/components/sidebar/sidebar-nav.styl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
display: inline-block;
cursor: pointer;
border-bottom: 1px solid transparent;
font-size: 14px;
font-size: $font-size-base;
color: $sidebar-nav-color;

&:hover { color: $sidebar-nav-hover-color; }
Expand Down
4 changes: 2 additions & 2 deletions source/css/_common/components/sidebar/sidebar-toc.styl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.post-toc-empty {
font-size: 14px;
font-size: $font-size-base;
color: $grey-dim;
}

Expand All @@ -12,7 +12,7 @@
padding: 0 2px 5px 10px;
text-align: left;
list-style: none;
font-size: 14px;
font-size: $font-size-base;

& > ol { padding-left: 0; }

Expand Down
2 changes: 0 additions & 2 deletions source/css/_common/components/third-party/copy-code.styl
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
.copy-btn {
display: inline-block;
padding: 6px 12px;
font-size: 13px;
font-weight: 700;
line-height: 20px;
color: #333;
white-space: nowrap;
vertical-align: middle;
Expand Down
2 changes: 1 addition & 1 deletion source/css/_common/components/third-party/gitment.styl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
padding: 0 15px;
color: #0a9caf;
cursor: pointer;
font-size: 14px;
font-size: $font-size-base;
border: 1px solid #0a9caf;
border-radius: 4px;
}
Expand Down
8 changes: 1 addition & 7 deletions source/css/_common/scaffolding/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@ h1, h2, h3, h4, h5, h6 {
for headline in (1..6) {
h{headline} {
font-size: $font-size-headings-base - $font-size-headings-step * headline;
code {
font-size: 1em;
}
}

+mobile() {
h{headline} {
font-size: $font-size-headings-base - $font-size-headings-step * headline - 4px;
code {
font-size: 1em;
}
font-size: $font-size-headings-base - $font-size-headings-step * headline - 2px;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/css/_common/scaffolding/helpers.styl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

.translation {
margin-top: -20px;
font-size: 14px;
font-size: $font-size-base;
color: $grey-dark;
}

Expand Down
Loading