From ee4b27a5f925a86c46923df2aaced60c26a4ec79 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Wed, 24 Jun 2020 22:46:01 +0800 Subject: [PATCH] New mixin round-icon --- .../components/post/post-collapse.styl | 15 +++--------- .../outline/sidebar/sidebar-author-links.styl | 24 ++++--------------- source/css/_common/scaffolding/buttons.styl | 1 - .../scaffolding/highlight/copy-code.styl | 5 +--- source/css/_mixins.styl | 9 +++++-- source/css/_schemes/Muse/_sidebar.styl | 24 +++++++++++++++++++ source/css/_schemes/Pisces/_sidebar.styl | 9 ------- 7 files changed, 39 insertions(+), 48 deletions(-) diff --git a/source/css/_common/components/post/post-collapse.styl b/source/css/_common/components/post/post-collapse.styl index f10ecff..e720e6c 100644 --- a/source/css/_common/components/post/post-collapse.styl +++ b/source/css/_common/components/post/post-collapse.styl @@ -14,14 +14,11 @@ &::before { background: $grey-dark; border: 1px solid white; - border-radius: 50%; - content: ' '; - height: 10px; margin-left: -6px; margin-top: -4px; position: absolute; top: 50%; - width: 10px; + round-icon(10px); } } @@ -33,14 +30,11 @@ &::before { background: $grey; - border-radius: 50%; - content: ' '; - height: 8px; margin-left: -4px; margin-top: -4px; position: absolute; top: 50%; - width: 8px; + round-icon(8px); } } @@ -64,14 +58,11 @@ &::before { background: $grey; border: 1px solid white; - border-radius: 50%; - content: ' '; - height: 6px; left: -4px; position: absolute; top: $font-size-smallest; transition: background $transition-ease; - width: 6px; + round-icon(6px); } &:hover { diff --git a/source/css/_common/outline/sidebar/sidebar-author-links.styl b/source/css/_common/outline/sidebar/sidebar-author-links.styl index f15f4da..7eb9f7d 100644 --- a/source/css/_common/outline/sidebar/sidebar-author-links.styl +++ b/source/css/_common/outline/sidebar/sidebar-author-links.styl @@ -1,27 +1,11 @@ .links-of-author { - margin-top: 15px; - a, span.exturl { - border-bottom-color: $black-light; - display: inline-block; font-size: $font-size-smaller; - margin-bottom: 10px; - margin-right: 10px; - vertical-align: middle; + } - if (hexo-config('social_icons.transition')) { - transition: all $transition-ease; - } - - &::before { - background: rgb(random-color(0, 255) - 50%, random-color(0, 255) - 50%, random-color(0, 255) - 50%); - border-radius: 50%; - content: ' '; - display: inline-block; - height: 4px; - margin-right: 3px; - vertical-align: middle; - width: 4px; + if (!hexo-config('social_icons.icons_only')) { + .fa, .fab, .far, .fas { + margin-right: 2px; } } } diff --git a/source/css/_common/scaffolding/buttons.styl b/source/css/_common/scaffolding/buttons.styl index cd012cc..a54372f 100644 --- a/source/css/_common/scaffolding/buttons.styl +++ b/source/css/_common/scaffolding/buttons.styl @@ -7,7 +7,6 @@ font-size: $font-size-small; line-height: 2; padding: 0 20px; - text-decoration: none; transition: background-color $transition-ease; &:hover { diff --git a/source/css/_common/scaffolding/highlight/copy-code.styl b/source/css/_common/scaffolding/highlight/copy-code.styl index 0088132..b8fb039 100644 --- a/source/css/_common/scaffolding/highlight/copy-code.styl +++ b/source/css/_common/scaffolding/highlight/copy-code.styl @@ -45,14 +45,11 @@ if (hexo-config('codeblock.copy_button.style') == 'mac') { &::before { background: #fc625d; - border-radius: 50%; box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b; - content: ' '; - height: 12px; left: 12px; margin-top: -20px; position: absolute; - width: 12px; + round-icon(12px); } } } diff --git a/source/css/_mixins.styl b/source/css/_mixins.styl index f6cb4b3..3baf4b1 100644 --- a/source/css/_mixins.styl +++ b/source/css/_mixins.styl @@ -73,8 +73,6 @@ sidebar-inline-links-item() { a, span.exturl { box-sizing: border-box; display: inline-block; - margin-bottom: 0; - margin-right: 0; max-width: 216px; overflow: hidden; padding: 0 5px; @@ -144,3 +142,10 @@ sidebar-toggle() { opacity: $b2t-opacity-hover; } } + +round-icon($diameter) { + border-radius: 50%; + content: ' '; + height: $diameter; + width: $diameter; +} diff --git a/source/css/_schemes/Muse/_sidebar.styl b/source/css/_schemes/Muse/_sidebar.styl index f2028ce..b660a46 100644 --- a/source/css/_schemes/Muse/_sidebar.styl +++ b/source/css/_schemes/Muse/_sidebar.styl @@ -51,6 +51,30 @@ if (hexo-config('sidebar.position') == 'right') { } } +.links-of-author { + margin-top: 15px; + + a, span.exturl { + border-bottom-color: $black-light; + display: inline-block; + margin-bottom: 10px; + margin-right: 10px; + vertical-align: middle; + + if (hexo-config('social_icons.transition')) { + transition: all $transition-ease; + } + + &::before { + background: rgb(random-color(0, 255) - 50%, random-color(0, 255) - 50%, random-color(0, 255) - 50%); + display: inline-block; + margin-right: 3px; + transform: translateY(-2px); + round-icon(4px); + } + } +} + .links-of-blogroll-item { if (hexo-config('links_settings.layout') == 'inline') { display: inline-block; diff --git a/source/css/_schemes/Pisces/_sidebar.styl b/source/css/_schemes/Pisces/_sidebar.styl index c043ae6..14f50e0 100644 --- a/source/css/_schemes/Pisces/_sidebar.styl +++ b/source/css/_schemes/Pisces/_sidebar.styl @@ -72,21 +72,12 @@ a, span.exturl { border-bottom: none; display: block; - text-decoration: none; - - &::before { - display: none; - } &:hover { background: var(--body-bg-color); border-radius: 4px; } } - - .fa, .fab, .far, .fas { - margin-right: 2px; - } } .links-of-blogroll-item {