Skip to content

Commit

Permalink
add: option for left column width 左边栏宽度定制
Browse files Browse the repository at this point in the history
Enlarge left column width via _config.yml and then
related elements will adapt to the change
设置中调整左边栏宽度后相关元素会自适应调整
  • Loading branch information
MOxFIVE committed Jan 21, 2016
1 parent d922f01 commit 5c7ff88
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ blockquote_style:
blockquote: 1 # Value: 0 - 7 可选
# 自定义文章「引用部分」的样式

# 左边栏宽度 px
left_col_width: 300

# 目录中标题不换行
# Keep TOC title on the same line |
toc_nowrap: false
Expand Down
4 changes: 2 additions & 2 deletions source/css/_partial/article.styl
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ li:hover {
#tocButton {
position: fixed;
border: none;
left: 220px;
left: left-col-width - 80px;
top: 382px;
background: none;
font-size: .9em;
Expand All @@ -432,7 +432,7 @@ li:hover {
}
.toc-article {
position: fixed;
width: 230px;
width: left-col-width - 70px;
top: 378px;
bottom: 1em;
left: 0;
Expand Down
12 changes: 6 additions & 6 deletions source/css/_partial/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
.left-col {
background: rgba(255,255,255,.85);
width: 300px;
width: left-col-width;
position:fixed;
opacity:1;
transition:all .2s ease-in;
Expand Down Expand Up @@ -65,7 +65,7 @@
right:0;
min-height:100%;
background: rgba(255,255,255,.8);
left: 300px;
left: left-col-width;
width: auto;
}

Expand Down Expand Up @@ -94,7 +94,7 @@
text-align: center;
display: block;
border: 5px solid #fff;
border-radius: 300px;
border-radius: 50%;
width: 128px;
height: 128px;
margin: 0 auto;
Expand All @@ -110,7 +110,7 @@
img{
width: 20%;
height: 20%;
border-radius: 300px;
border-radius: 50%;
opacity: 0;
-webkit-transition: all 0.2s ease-in;
&.show{
Expand Down Expand Up @@ -168,7 +168,7 @@
cursor: default;
a{
font-size: 14px;
min-width: 300px;
min-width: left-col-width;
}
}
}
Expand Down Expand Up @@ -439,7 +439,7 @@
}

#post-nav-button {
left: 300px;
left: left-col-width;
top: 61.8%;
a {
border-bottom-color: transparent;
Expand Down
3 changes: 2 additions & 1 deletion source/css/_variables.styl
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ mq-mobile = "screen and (max-width: 479px)"
mq-tablet = "screen and (min-width: 480px) and (max-width: 767px)"
mq-normal = "screen and (min-width: 768px)"

hover-color = #9c9
hover-color = #9c9
left-col-width = hexo-config("left_col_width")px

0 comments on commit 5c7ff88

Please sign in to comment.