Skip to content

Commit

Permalink
refactor: add 12 list styles 列表样式
Browse files Browse the repository at this point in the history
  • Loading branch information
MOxFIVE committed May 7, 2016
1 parent 41beb86 commit 06a8406
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 39 deletions.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ blockquote_style:
blockquote: 1 # Value: 0 - 7 可选
# 自定义文章「引用部分」的样式

## List style type (ul) | 无序列表项标记样式
list_style: 0 # value: 0 - 12 可选

# 左边栏宽度 px
left_col_width: 300

Expand Down
40 changes: 2 additions & 38 deletions source/css/_partial/article.styl
Original file line number Diff line number Diff line change
Expand Up @@ -153,45 +153,9 @@
margin: .85em auto;
line-height: 1.7;
}
li{
margin: 0.1em
font-size: 1rem;
}
em {
font-style: italic;
}
ul{
li:before{
display inline-block;
content: "";
width: .4em;
height: .4em;
margin-right: .5em;
margin-bottom: .11em;
border: 1px solid lightgray;
border-radius: 50%;
background: lightgray;
}
}
ul,ol{
font-size: 14px;
margin: 10px 0px;
}
li{
ul,ol{
margin-left: 30px;
li:before{
content: "";
background: #dedede;
}
}
}
li.task-list {
list-style: none;
&::before{
display: none;
}
}
h1{
margin-top: 30px;
}
Expand Down Expand Up @@ -286,6 +250,7 @@
white-space: nowrap;
}
}
@import "customise/list"
figure{
table {
border: none;
Expand Down Expand Up @@ -534,5 +499,4 @@ if hexo-config("toc_nowrap")
cursor: pointer;
}
}
}

}
56 changes: 56 additions & 0 deletions source/css/_partial/customise/list.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
list_style = hexo-config("list_style")

li
margin .1em
font-size 1rem

ul, ol
margin 10px 0
li.task-list
list-style none
margin-left 0
&::before
display none

li ul, li ol
margin-left 30px

if !list_style
ul > li:before
content ""
background #dedede

ul > li:before
display inline-block
content ""
width .4em
height .4em
margin-right .5em
margin-bottom .11em
border 1px solid #d3d3d3
border-radius 50%
background #d3d3d3

css-list = 1 disc, 2 circle, 3 square

for i in css-list
if list_style == i[0]
ul > li
margin-left 1.1em
list-style-type i[1]

icon-list = 4 f054, 5 f0a4, 6 f0fe,
7 f061, 8 f0a9, 9 f005,
10 f006, 11 f192, 12 f05b

for i in icon-list
if list_style == i[0]
ul > li
list-style none
margin 0
ul > li:before
content "\" + i[1]
font-family FontAwesome
font-size .8em
margin-right .5em
color #c8c8c8
2 changes: 1 addition & 1 deletion source/css/_partial/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ if hexo-config("progressBar.on") && hexo-config("progressBar.type") == "minimal"
background #77b6ff
box-shadow 0 0 10px rgba(@background, .7)

.social,
.article-entry ul > li,
.share,
.article-category::before,
.article-tag::before,
Expand Down

1 comment on commit 06a8406

@MOxFIVE
Copy link
Owner Author

@MOxFIVE MOxFIVE commented on 06a8406 May 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#85

Please sign in to comment.