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 @@ -467,7 +467,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
6 changes: 4 additions & 2 deletions source/css/_common/components/highlight/copy-code.styl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
display: inline-block;
position: absolute;
padding: 2px 6px;
font-size: $font-size-smaller;
font-weight: $font-weight-bolder;
line-height: 1.6;
color: #333;
Expand All @@ -24,17 +23,20 @@
disable-user-select();

if hexo-config('codeblock.copy_button.style') == 'flat' {
font-size: $font-size-smaller;
background-color: #fff;
border: none;
right: 0px;
height: 42px;
top: 0px;
}
else if hexo-config('codeblock.copy_button.style') == 'mac' {
font-size: 14px;
color: #fff;
right: 0px;
top: 2px;
}
else {
font-size: $font-size-smaller;
background-color: #eee;
background-image: linear-gradient(#fcfcfc, #eee);
border: 1px solid #d5d5d5;
Expand Down
4 changes: 0 additions & 4 deletions source/css/_common/components/highlight/highlight.styl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ $highlight_theme = hexo-config("codeblock.highlight_theme");
// Placeholder: $code-block
$code-block {
margin: 20px 0;
font-size: $font-size-small;
color: $highlight-foreground;
background: $highlight-background;
line-height: $line-height-code-block;
Expand Down Expand Up @@ -63,7 +62,6 @@ pre {

figcaption {
clearfix();
font-size: 1em;
color: $highlight-foreground;
line-height: 1em;
margin: 0em;
Expand Down Expand Up @@ -92,8 +90,6 @@ pre {
padding-left: 10px
background-color: $highlight-background
}

.line { height: 20px; }
}

.gutter {
Expand Down
129 changes: 119 additions & 10 deletions source/css/_common/components/pages/archive.styl
Original file line number Diff line number Diff line change
@@ -1,30 +1,139 @@
.page-archive {
.page-archive .posts-collapse {

position: relative;
z-index: $zindex-1;
margin-left: $posts-collapse-left;

+mobile() {
margin-left: 20px;
margin-right: 20px;

.post-title, .post-meta {
display: block;
width: auto;
text-align: left;
}
}

.archive-move-on {
position: absolute;
top: 1em;
left: 0;
margin-left: -6px;
width: 10px;
height: 10px;
background: $grey-dark;
border: 1px solid white;
border-radius: 50%;
}

.archive-page-counter {
position: relative;
top: 3px;
left: 20px;
font-size: $font-size-large;

+mobile() {
top: 5px;
}
}

.posts-collapse {
.collection-title {
position: relative;
margin: 60px 0;

h1, h2 {
margin-left: 20px;
}

.archive-move-on {
small {
color: $grey;
margin-left: 5px;
}

&::before {
content: " ";
position: absolute;
top: 11px;
left: 0;
margin-left: -6px;
width: 10px;
height: 10px;
opacity: 0.5;
background: $black-light;
border: 1px solid white;
top: 50%;
margin-left: -4px;
margin-top: -4px;
width: 8px;
height: 8px;
background: $grey;
border-radius: 50%;
}
}

.post {
margin: 30px 0;
}

.post-header {
position: relative;
the-transition();
transition-property: border;
border-bottom: 1px dashed $grey-light;

&::before {
content: " ";
position: absolute;
left: 0;
top: $font-size-smallest;
width: 6px;
height: 6px;
margin-left: -4px;
background: $grey;
border-radius: 50%;
border: 1px solid white;
the-transition();
transition-property: background;
}

&:hover {
border-bottom-color: $grey-dim;

&::before {
background: $black-deep;
}
}
}

.post-title {
margin-left: $font-size-smallest * 5;
font-size: $font-size-medium;
font-weight: normal;
line-height: inherit;
margin-bottom: 0px;

&::after {
margin-left: 3px;
opacity: 0.6;
}

a, span.exturl {
color: $grey-dim;
border-bottom: none;
}
}

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

&::after {
content: " ";
position: absolute;
top: 1.25em;
left: 0;
margin-left: -2px;
width: 4px;
height: 100%;
background: $whitesmoke;
z-index: $zindex-bottom;
}

.fa-external-link {
Expand Down
111 changes: 0 additions & 111 deletions source/css/_common/components/post/post-collapse.styl

This file was deleted.

2 changes: 1 addition & 1 deletion source/css/_common/components/post/post-expand.styl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

img {
box-sizing: border-box;
margin: 0 auto 25px;
margin: 0 auto 20px;
padding: 3px;
border: 1px solid $gray-lighter;
}
Expand Down
11 changes: 7 additions & 4 deletions source/css/_common/components/post/post-meta.styl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
margin: 3px 0 60px 0;
color: $grey-dark;
font-family: $font-family-posts;
font-size: $font-size-smallest;
text-align: center;

.post-description {
Expand All @@ -16,12 +15,16 @@
}
}

.post-meta-divider {
.post-meta .post-meta-item + .post-meta-item::before {
content: "|";
margin: 0 .5em;
}

.post-meta .post-meta-item + .post-meta-item::before {
content: "|";
.post-meta .post-meta-item {
font-size: $font-size-smallest;
}

.post-meta-divider {
margin: 0 .5em;
}

Expand Down
1 change: 0 additions & 1 deletion source/css/_common/components/post/post-reward.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
padding: 0 15px;
border-radius: 5px;
line-height: 2;
font-size: $font-size-medium;
color: #fff;
background: #F44336;
letter-spacing: normal;
Expand Down
1 change: 1 addition & 0 deletions source/css/_common/components/post/post-title.styl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.posts-expand .post-title {
word-wrap();
margin: initial;
text-align: center;
font-weight: $posts-expand-title-font-weight;

Expand Down
2 changes: 0 additions & 2 deletions source/css/_common/components/post/post.styl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

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

Expand All @@ -38,7 +37,6 @@
}

@import "post-expand";
@import "post-collapse";
@import "post-type";
@import "post-title";
@import "post-meta";
Expand Down
Loading