From 0e46f3c5a8c4b9bfd4ccc34fa3c171502927b315 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sun, 22 Mar 2020 18:02:55 +0800 Subject: [PATCH] update css --- _config.yml | 4 +-- layout/_partial/post.ejs | 6 ++-- source/css/_defines/layout.styl | 4 +-- source/css/_highlight/index.styl | 2 +- source/css/_layout/archive.styl | 1 - source/css/_layout/article.styl | 44 ++++++++++++--------------- source/css/_layout/friends.styl | 1 - source/css/_layout/main.styl | 32 +++++-------------- source/css/_layout/pagination.styl | 1 - source/css/_layout/search.styl | 5 --- source/css/_layout/sidebar.styl | 15 ++------- source/css/_tag-plugins/btns.styl | 3 -- source/css/_tag-plugins/folding.styl | 12 ++++---- source/css/_tag-plugins/note.styl | 10 +++--- source/css/_tag-plugins/tabs.styl | 11 +++---- source/css/_third-party/fancybox.styl | 2 +- source/css/_third-party/valine.styl | 8 +---- 17 files changed, 57 insertions(+), 104 deletions(-) diff --git a/_config.yml b/_config.yml index 4ea6957..60fbcec 100755 --- a/_config.yml +++ b/_config.yml @@ -31,8 +31,8 @@ style: h2: 48px # Spacing above H2 (only px unit) h3: 32px # Spacing above H3 (only px unit) h4: 16px # Spacing above H4 (only px unit) - line: 1rem # Paragraph spacing - inline: .5rem # Paragraph spacing within a block + block: 1rem # Paragraph spacing between blocks + p: .5rem # Paragraph spacing within a block border_radius: card: 12px codeblock: 4px diff --git a/layout/_partial/post.ejs b/layout/_partial/post.ejs index 2a5b8fd..b56fb34 100755 --- a/layout/_partial/post.ejs +++ b/layout/_partial/post.ejs @@ -2,10 +2,12 @@ <%- partial('meta',{post:post, position:'header'}) %>
- <% if (post.description) { %> + <% if (post.excerpt) { %> + <%- post.excerpt %> + <% } else if (post.description) { %>

<%- post.description %>

<% } else { %> - <%- post.excerpt || post.content %> + <%- post.content %> <% } %> <% if (theme.layout.on_list.readmore) { %> <% if ((post.readmore != false) && (post.excerpt || post.description || post.link)) { %> diff --git a/source/css/_defines/layout.styl b/source/css/_defines/layout.styl index 9350199..9e761f3 100644 --- a/source/css/_defines/layout.styl +++ b/source/css/_defines/layout.styl @@ -21,8 +21,8 @@ $gap = convert(hexo-config('style.gap.base')) || 16px $gap-h2 = convert(hexo-config('style.gap.h2')) || 48px $gap-h3 = convert(hexo-config('style.gap.h3')) || 32px $gap-h4 = convert(hexo-config('style.gap.h4')) || 16px -$gap-line = convert(hexo-config('style.gap.line')) || 1rem // 段落间距 -$gap-inline = convert(hexo-config('style.gap.inline')) || .5rem // 块内行间距 +$gap-block = convert(hexo-config('style.gap.block')) || 1rem // 区块间距 +$gap-p = convert(hexo-config('style.gap.p')) || .5rem // 段落间距 $gap-card = $gap // border width diff --git a/source/css/_highlight/index.styl b/source/css/_highlight/index.styl index 4107ef4..984c4c6 100644 --- a/source/css/_highlight/index.styl +++ b/source/css/_highlight/index.styl @@ -6,7 +6,7 @@ .highlight position: relative width: 100% - margin: $gap-line 0 + margin: $gap-block 0 display: block background: $color-codeblock font-size: $fontsize-code diff --git a/source/css/_layout/archive.styl b/source/css/_layout/archive.styl index d8df0ab..c391667 100644 --- a/source/css/_layout/archive.styl +++ b/source/css/_layout/archive.styl @@ -25,7 +25,6 @@ border-left: $border-line solid transparent border-radius: $border-line vertical-align: middle - text-decoration: none font-size: $fontsize-meta &.child padding-left: 2 * $gap diff --git a/source/css/_layout/article.styl b/source/css/_layout/article.styl index 0920f19..9703d11 100644 --- a/source/css/_layout/article.styl +++ b/source/css/_layout/article.styl @@ -20,7 +20,7 @@ h1,h2,h3,h4,h5,h6 &:first-child - margin-top: $gap-line + margin-top: $gap-block padding-top: 0 &.title left: 0 @@ -49,17 +49,17 @@ h5 font-weight: bold color: $color-h5 - margin-top: $gap-line + margin-top: $gap-block h6 color: $color-h6 - margin-top: $gap-line + margin-top: $gap-block center &,p text-align: center .aplayer - margin: $gap-line 0 + margin: $gap-block 0 display: inline-block width: 400px max-width: 100% @@ -78,8 +78,8 @@ u color: $color-hover p - margin-top: $gap-line - margin-bottom: $gap-line + margin-top: $gap-block + margin-bottom: $gap-block text-align: $textalign-p max-width: 100% @@ -98,8 +98,8 @@ list-style: initial padding-left: 8px margin-left: $gap - margin-top: $gap-line - margin-bottom: $gap-line + margin-top: $gap-block + margin-bottom: $gap-block ul,ol margin-top: 0 margin-bottom: 0 @@ -117,10 +117,7 @@ list-style: initial ol>li list-style: decimal - a - &:before - display: none - trans() + >a,>p>a,blockquote a,div.note a &:hover color: $color-hover text-decoration: underline @@ -150,8 +147,8 @@ text-align: left word-wrap: normal font-size: $fontsize-list - margin-top: $gap-inline - margin-bottom: $gap-inline + margin-top: $gap-p + margin-bottom: $gap-p box-shadow: $boxshadow-card position: relative width: 100% @@ -162,7 +159,7 @@ text-align: justify color: inherit font-style: italic - margin: $gap-inline 0 + margin: $gap-p 0 cite &::before content: '----' @@ -183,8 +180,8 @@ display: block -moz-box-sizing: border-box box-sizing: border-box - margin-top: $gap-line - margin-bottom: $gap-line + margin-top: $gap-block + margin-bottom: $gap-block overflow: auto background: $color-codeblock font-size: $fontsize-code @@ -226,7 +223,7 @@ .widget background: transparent - margin: $gap-line 0 + margin: $gap-block 0 box-shadow: none border-radius: $border-codeblock cursor: auto @@ -266,6 +263,7 @@ color: $color-link font-weight: normal &:hover,&.active,&:active + text-decoration: underline border-left: none background: none color: $color-hover @@ -312,17 +310,15 @@ h4 &:before margin-top: $gap-h4 - $navbar-height - 2 * $gap - margin-bottom: $gap-line + margin-bottom: $gap-block h5 font-weight: bold - margin-bottom: $gap-line + margin-bottom: $gap-block h6 - margin-bottom: $gap-line + margin-bottom: $gap-block article .readmore - margin-top: $gap-line + margin-top: $gap-block >a font-size: $fontsize-meta - &:hover - text-decoration: none diff --git a/source/css/_layout/friends.styl b/source/css/_layout/friends.styl index c047955..1affa76 100644 --- a/source/css/_layout/friends.styl +++ b/source/css/_layout/friends.styl @@ -30,7 +30,6 @@ width: "calc(100%/2 - %s)" % $gap &:hover - text-decoration: none .friend-left .avatar transform: scale(1.2) rotate(12deg) diff --git a/source/css/_layout/main.styl b/source/css/_layout/main.styl index 68cecd6..865e196 100644 --- a/source/css/_layout/main.styl +++ b/source/css/_layout/main.styl @@ -67,13 +67,6 @@ columns: 320px // 支持多列 - ul.popular-posts - h3 - padding: 0 - margin: 0 - font-size: $fontsize-body - - .post-wrapper column-break-inside: avoid break-inside: avoid-column @@ -102,13 +95,13 @@ .widget .content p,ul,ol,table,.tabs,details - margin-top: $gap-inline - margin-bottom: $gap-inline + margin-top: $gap-p + margin-bottom: $gap-p .post padding-top: 0 padding-bottom: 0 - margin-top: $gap-inline - margin-bottom: $gap-inline + margin-top: $gap-p + margin-bottom: $gap-p &.grid .content .grid.fixed a width: "calc(100%/8 - 0 * %s)" % $gap @media screen and (max-width: $device-laptop) @@ -176,7 +169,6 @@ display: inline font-weight: normal color: $color-text - text-decoration: none &:hover color: $color-hover @@ -216,16 +208,12 @@ color: white p color: white - .notlink cursor: default &:hover color: $color-meta p color: $color-meta - - - display: flex align-items: center justify-content: center @@ -234,10 +222,8 @@ border-radius: 4px &:last-child margin-right: 0 - img,i display: inline - i margin-right: 4px border-radius: 0 @@ -247,7 +233,6 @@ color: $color-meta padding-left: 0 padding-right: 4px - a display: flex justify-content: center @@ -257,18 +242,15 @@ width: 1.2em margin-right: 5px transform: translateY(-1px) - p margin: 0 padding-top: 2px font-weight: normal trans() - &:hover color: $color-hover p color: $color-hover - text-decoration: none .author img,i @@ -350,12 +332,12 @@ div.hoverbox .article p[ct] margin-top: 0 - margin-bottom: $gap-inline + margin-bottom: $gap-p font-size: $fontsize-h4 color: $color-text p[cst] - margin-top: $gap-inline - margin-bottom: $gap-inline + margin-top: $gap-p + margin-bottom: $gap-p font-size: $fontsize-meta diff --git a/source/css/_layout/pagination.styl b/source/css/_layout/pagination.styl index b3342ea..f4d0383 100644 --- a/source/css/_layout/pagination.styl +++ b/source/css/_layout/pagination.styl @@ -46,7 +46,6 @@ background: $color-block border-radius: $border-codeblock &:hover - text-decoration: none background: bgcolor($color-hover) p.title color: $color-hover diff --git a/source/css/_layout/search.styl b/source/css/_layout/search.styl index c89aaa7..2a751d1 100644 --- a/source/css/_layout/search.styl +++ b/source/css/_layout/search.styl @@ -214,17 +214,12 @@ position: relative display: block padding: $gap - text-decoration: none border-radius: $border-card b[mark] color: darken($color-theme, 10) text-decoration: underline &:hover background: bgcolor($color-theme) - // .digest, .icon - // color: $color-hover - // .title - // color: $color-hover diff --git a/source/css/_layout/sidebar.styl b/source/css/_layout/sidebar.styl index b919d9f..06ff62c 100644 --- a/source/css/_layout/sidebar.styl +++ b/source/css/_layout/sidebar.styl @@ -58,8 +58,8 @@ max-height: "calc(100% - %s)" % $offset max-width: 100% p - margin-top: $gap-inline - margin-bottom: $gap-inline + margin-top: $gap-p + margin-bottom: $gap-p ul>li a color: $color-meta @@ -210,8 +210,6 @@ font-size: $fontsize-meta font-weight: bold line-height: 2.4em - &:hover - text-decoration: none i margin-left: 1px img @@ -282,19 +280,12 @@ width: "calc(100%/3 - 0 * %s)" % $gap - - - - // &.category - // .content - // font-weight: bold - &.tagcloud .content text-align: justify padding: $gap * 0.5 $gap a - display:inline-block + display: inline-block trans() line-height: 1.6em &:hover diff --git a/source/css/_tag-plugins/btns.styl b/source/css/_tag-plugins/btns.styl index a2c273f..10faceb 100644 --- a/source/css/_tag-plugins/btns.styl +++ b/source/css/_tag-plugins/btns.styl @@ -10,7 +10,6 @@ trans() &:hover color: $color-inner - text-decoration: none background: $color-hover &[regular] a @@ -125,8 +124,6 @@ div.btns line-height: 1.3 img margin: .4em auto - &:hover - text-decoration: none &:not([href]) cursor: default color: inherit diff --git a/source/css/_tag-plugins/folding.styl b/source/css/_tag-plugins/folding.styl index e7a4944..d488903 100644 --- a/source/css/_tag-plugins/folding.styl +++ b/source/css/_tag-plugins/folding.styl @@ -1,7 +1,7 @@ details display: block padding: $gap - margin: $gap-line 0 + margin: $gap-block 0 overflow: hidden border-radius: $border-codeblock border: 1px solid darken($color-block, 4) @@ -24,8 +24,8 @@ details float: right content: '+' div.content - margin-top: $gap-line - margin-bottom: unit($gap-line, px) - unit($gap, px) + margin-top: $gap-block + margin-bottom: unit($gap-block, px) - unit($gap, px) &[blue] border: 1px solid darken(bgcolor($color-md-blue), 4) >summary @@ -73,11 +73,11 @@ details[open] border-bottom: 1px solid darken(bgcolor($color-mac-red), 8) >summary color: $color-p - margin-bottom: $gap-line + margin-bottom: $gap-block &:hover &:after content: '-' > p,.tabs,ul,ol - margin-top: $gap-inline - margin-bottom: $gap-inline + margin-top: $gap-p + margin-bottom: $gap-p diff --git a/source/css/_tag-plugins/note.styl b/source/css/_tag-plugins/note.styl index b6d56dd..446ac3a 100644 --- a/source/css/_tag-plugins/note.styl +++ b/source/css/_tag-plugins/note.styl @@ -5,9 +5,9 @@ div.note border($c) return mix($c, $color-card, 80) position: relative - margin-top: $gap-line - margin-bottom: $gap-line - padding: $gap-inline $gap + margin-top: $gap-block + margin-bottom: $gap-block + padding: $gap-p $gap padding-left: "calc(16px + %s)" % $gap border-radius: $border-codeblock @@ -33,8 +33,8 @@ div.note blockquote, img font-size: $fontsize-list - margin-top: $gap-inline - margin-bottom: $gap-inline + margin-top: $gap-p + margin-bottom: $gap-p &::before position: absolute diff --git a/source/css/_tag-plugins/tabs.styl b/source/css/_tag-plugins/tabs.styl index 2ddffb7..b5c8ad4 100644 --- a/source/css/_tag-plugins/tabs.styl +++ b/source/css/_tag-plugins/tabs.styl @@ -4,14 +4,14 @@ $tbr = 4px div.tabs display: block position: relative - margin-top: $gap-line - margin-bottom: $gap-line + margin-top: $gap-block + margin-bottom: $gap-block border-radius: $tbr background: $color-card border: 1px solid $border-color .highlight,p,ul,ol - margin-top: $gap-inline - margin-bottom: $gap-inline + margin-top: $gap-p + margin-bottom: $gap-p div.tabs ul.nav-tabs @@ -36,7 +36,6 @@ div.tabs color: $color-meta border: 1px solid transparent &:hover - text-decoration: none color: $color-p &.active a cursor: default @@ -49,7 +48,7 @@ div.tabs border-top: 1px solid $border-color margin-top: -1px .tab-pane - padding: $gap-inline $gap + padding: $gap-p $gap &:not(.active) display: none &.active diff --git a/source/css/_third-party/fancybox.styl b/source/css/_third-party/fancybox.styl index f1fe3b2..a08b4cf 100644 --- a/source/css/_third-party/fancybox.styl +++ b/source/css/_third-party/fancybox.styl @@ -1,5 +1,5 @@ div.fancybox - margin: $gap-line 0 + margin: $gap-block 0 $sp = 1px >a,>p>a margin: $sp diff --git a/source/css/_third-party/valine.styl b/source/css/_third-party/valine.styl index 493b0cd..81d8517 100644 --- a/source/css/_third-party/valine.styl +++ b/source/css/_third-party/valine.styl @@ -40,7 +40,6 @@ margin-top: 6px background: transparent .vedit .vctrl span - color: $color-link padding: 0 margin: 10px @@ -71,7 +70,6 @@ trans() &:hover color: $color-hover - text-decoration: underline div.info box-shadow: none @@ -82,15 +80,13 @@ span &.vnick color: $color-meta - - + cursor: default a &.vnick color: #ff9800 font-weight: bold &:hover color: $color-hover - text-decoration: underline @@ -122,8 +118,6 @@ &:hover color: $color-hover text-decoration: underline - &:active - color: darken($color-hover, .25) .vinput color: $color-text