From 90962975c6eab1ea331509a08a18ccea7ae3bfe6 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Tue, 8 Dec 2020 00:43:02 +0800 Subject: [PATCH] Code style update --- source/css/_common/components/back-to-top.styl | 2 +- source/css/_common/components/index.styl | 4 ++-- .../css/_common/components/post/post-header.styl | 2 +- .../css/_common/outline/header/github-banner.styl | 4 ++-- .../outline/sidebar/sidebar-author-links.styl | 2 +- .../css/_common/outline/sidebar/sidebar-toc.styl | 2 +- .../css/_common/scaffolding/highlight/index.styl | 2 +- source/css/_common/scaffolding/tags/note.styl | 14 ++++++-------- source/css/_mixins.styl | 2 +- source/css/_schemes/Muse/_sidebar.styl | 2 +- source/css/_schemes/Pisces/_menu.styl | 2 +- source/css/_schemes/Pisces/_sidebar.styl | 4 ++-- 12 files changed, 20 insertions(+), 22 deletions(-) diff --git a/source/css/_common/components/back-to-top.styl b/source/css/_common/components/back-to-top.styl index 4fcfb6a..f804c7c 100644 --- a/source/css/_common/components/back-to-top.styl +++ b/source/css/_common/components/back-to-top.styl @@ -6,7 +6,7 @@ transition: bottom $transition-ease; sidebar-toggle(); - if (!hexo-config('back2top.scrollpercent')) { + if (not hexo-config('back2top.scrollpercent')) { width: 24px; } diff --git a/source/css/_common/components/index.styl b/source/css/_common/components/index.styl index 332578e..f63df08 100644 --- a/source/css/_common/components/index.styl +++ b/source/css/_common/components/index.styl @@ -2,7 +2,7 @@ if (hexo-config('back2top.enable')) { .back-to-top { font-size: $b2t-font-size; - if (!hexo-config('back2top.scrollpercent')) { + if (not hexo-config('back2top.scrollpercent')) { span { display: none; } @@ -14,7 +14,7 @@ if (hexo-config('back2top.enable')) { .noscript-warning { background-color: lighten($red, 20%); - color: #fff; + color: white; font-family: sans-serif; font-size: 1rem; font-weight: bold; diff --git a/source/css/_common/components/post/post-header.styl b/source/css/_common/components/post/post-header.styl index 8c8f77e..aaa7cd9 100644 --- a/source/css/_common/components/post/post-header.styl +++ b/source/css/_common/components/post/post-header.styl @@ -101,7 +101,7 @@ } .post-meta-item-text { - if (!hexo-config('post_meta.item_text')) { + if (not hexo-config('post_meta.item_text')) { display: none; } diff --git a/source/css/_common/outline/header/github-banner.styl b/source/css/_common/outline/header/github-banner.styl index 1346321..48ae955 100644 --- a/source/css/_common/outline/header/github-banner.styl +++ b/source/css/_common/outline/header/github-banner.styl @@ -29,12 +29,12 @@ } +tablet-mobile() { - if (hexo-config('local_search.enable') || hexo-config('algolia_search.enable')) { + if (hexo-config('local_search.enable') or hexo-config('algolia_search.enable')) { display: none; } svg { - if (($scheme == 'Pisces') || ($scheme == 'Gemini')) { + if (($scheme == 'Pisces') or ($scheme == 'Gemini')) { color: $bg-color; fill: white; } diff --git a/source/css/_common/outline/sidebar/sidebar-author-links.styl b/source/css/_common/outline/sidebar/sidebar-author-links.styl index 38d82d8..7921467 100644 --- a/source/css/_common/outline/sidebar/sidebar-author-links.styl +++ b/source/css/_common/outline/sidebar/sidebar-author-links.styl @@ -3,7 +3,7 @@ font-size: $font-size-smaller; } - if (!hexo-config('social_icons.icons_only')) { + if (not hexo-config('social_icons.icons_only')) { .fa, .fab, .far, .fas { margin-right: 2px; } diff --git a/source/css/_common/outline/sidebar/sidebar-toc.styl b/source/css/_common/outline/sidebar/sidebar-toc.styl index d93e43e..28c8bee 100644 --- a/source/css/_common/outline/sidebar/sidebar-toc.styl +++ b/source/css/_common/outline/sidebar/sidebar-toc.styl @@ -21,7 +21,7 @@ overflow: hidden; text-overflow: ellipsis; - if (!hexo-config('toc.wrap')) { + if (not hexo-config('toc.wrap')) { white-space: nowrap; } } diff --git a/source/css/_common/scaffolding/highlight/index.styl b/source/css/_common/scaffolding/highlight/index.styl index 006ab60..bec8238 100644 --- a/source/css/_common/scaffolding/highlight/index.styl +++ b/source/css/_common/scaffolding/highlight/index.styl @@ -48,7 +48,7 @@ kbd { white-space: nowrap; } -// `highlight.line_number: false` && `highlight.wrap: false` +// `highlight.line_number: false` and `highlight.wrap: false` // in Hexo config generates code.highlight elements figure.highlight { @extend $code-block; diff --git a/source/css/_common/scaffolding/tags/note.styl b/source/css/_common/scaffolding/tags/note.styl index e2a9aad..1be5efc 100644 --- a/source/css/_common/scaffolding/tags/note.styl +++ b/source/css/_common/scaffolding/tags/note.styl @@ -77,15 +77,13 @@ border-color: $note-modern-border[$type]; color: $note-modern-text[$type]; - a { - &:not(.btn) { - border-bottom-color: $note-modern-text[$type]; - color: $note-modern-text[$type]; + a:not(.btn) { + border-bottom-color: $note-modern-text[$type]; + color: $note-modern-text[$type]; - &:hover { - border-bottom-color: $note-modern-hover[$type]; - color: $note-modern-hover[$type]; - } + &:hover { + border-bottom-color: $note-modern-hover[$type]; + color: $note-modern-hover[$type]; } } } diff --git a/source/css/_mixins.styl b/source/css/_mixins.styl index cce9d99..cce5fc6 100644 --- a/source/css/_mixins.styl +++ b/source/css/_mixins.styl @@ -122,7 +122,7 @@ main-container() { sidebar-toggle-position($reverse = false) { $condition = hexo-config('sidebar.position') == 'right'; - if (($scheme == 'Muse') || ($scheme == 'Mist')) { + if (($scheme == 'Muse') or ($scheme == 'Mist')) { $condition = $condition == $reverse; } if ($condition) { diff --git a/source/css/_schemes/Muse/_sidebar.styl b/source/css/_schemes/Muse/_sidebar.styl index f306fd8..ba04453 100644 --- a/source/css/_schemes/Muse/_sidebar.styl +++ b/source/css/_schemes/Muse/_sidebar.styl @@ -31,7 +31,7 @@ if (hexo-config('sidebar.position') == 'right') { .sidebar { background: $black-deep; bottom: 0; - if (!hexo-config('back2top.sidebar')) { + if (not hexo-config('back2top.sidebar')) { box-shadow: inset 0 2px 6px black; } position: fixed; diff --git a/source/css/_schemes/Pisces/_menu.styl b/source/css/_schemes/Pisces/_menu.styl index 0269eed..90475aa 100644 --- a/source/css/_schemes/Pisces/_menu.styl +++ b/source/css/_schemes/Pisces/_menu.styl @@ -31,7 +31,7 @@ } } -if (!hexo-config('menu_settings.badges')) { +if (not hexo-config('menu_settings.badges')) { .main-menu .menu-item-active::after { background: $grey; border-radius: 50%; diff --git a/source/css/_schemes/Pisces/_sidebar.styl b/source/css/_schemes/Pisces/_sidebar.styl index 9c6ac15..10268fc 100644 --- a/source/css/_schemes/Pisces/_sidebar.styl +++ b/source/css/_schemes/Pisces/_sidebar.styl @@ -9,7 +9,7 @@ display: none; } - if (hexo-config('motion.enable') && hexo-config('motion.transition.sidebar')) { + if (hexo-config('motion.enable') and hexo-config('motion.transition.sidebar')) { visibility: hidden; } } @@ -58,7 +58,7 @@ .links-of-author-item { sidebar-inline-links-item(); - if (!hexo-config('social_icons.icons_only')) { + if (not hexo-config('social_icons.icons_only')) { width: 50%; }