From 1354fda3c2c301eaa70458070914fbdbcdc4e7ec Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Thu, 17 Oct 2019 18:51:35 +0800 Subject: [PATCH 1/6] Refactor sub-menu --- layout/_layout.swig | 3 --- layout/_partials/header/index.swig | 4 ---- layout/_partials/header/sub-menu.swig | 5 +++-- layout/page.swig | 2 ++ 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/layout/_layout.swig b/layout/_layout.swig index 35e7b02175..56c7cb6249 100644 --- a/layout/_layout.swig +++ b/layout/_layout.swig @@ -36,9 +36,6 @@
- {%- if theme.scheme === 'Pisces' or theme.scheme === 'Gemini' %} - {% include '_partials/header/sub-menu.swig' %} - {%- endif %}
{% block content %}{% endblock %}
diff --git a/layout/_partials/header/index.swig b/layout/_partials/header/index.swig index 9d656905c7..38e966915e 100644 --- a/layout/_partials/header/index.swig +++ b/layout/_partials/header/index.swig @@ -4,10 +4,6 @@ {%- if hasSearch %} diff --git a/layout/_partials/header/sub-menu.swig b/layout/_partials/header/sub-menu.swig index 11b621e8ac..8e340189ac 100644 --- a/layout/_partials/header/sub-menu.swig +++ b/layout/_partials/header/sub-menu.swig @@ -1,5 +1,6 @@ -{%- if theme.menu and not is_home() and not is_post() %} - {% import 'menu-item.swig' as menu_item %} +{% import 'menu-item.swig' as menu_item %} + +{%- if theme.menu %} {# Submenu & Submenu-2 #} {%- for name, value in theme.menu %} diff --git a/layout/page.swig b/layout/page.swig index 03af5600c9..52f74ee1d7 100644 --- a/layout/page.swig +++ b/layout/page.swig @@ -17,6 +17,8 @@ {% block content %} + {% include '_partials/header/sub-menu.swig' %} +
{##################} {### PAGE BLOCK ###} From 8b44c1d6d984ab7a6551e93bce37efd2058b006a Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Thu, 17 Oct 2019 19:33:01 +0800 Subject: [PATCH 2/6] Update --- source/css/_common/outline/header/header.styl | 2 +- source/css/_schemes/Gemini/index.styl | 22 +++++++++---------- source/css/_schemes/Mist/_posts-expand.styl | 2 +- source/css/_schemes/Mist/index.styl | 2 +- source/css/_schemes/Muse/_layout.styl | 4 ++++ source/css/_schemes/Muse/_sub-menu.styl | 5 +++++ source/css/_schemes/Muse/index.styl | 1 + source/css/_schemes/Pisces/_sub-menu.styl | 12 +++++----- 8 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 source/css/_schemes/Muse/_sub-menu.styl diff --git a/source/css/_common/outline/header/header.styl b/source/css/_common/outline/header/header.styl index 3baa551d21..43c220a968 100644 --- a/source/css/_common/outline/header/header.styl +++ b/source/css/_common/outline/header/header.styl @@ -6,7 +6,7 @@ .header-inner { margin: 0 auto; - padding: 100px 0 70px; + padding: 100px 0 0; position: relative; width: $content-desktop; diff --git a/source/css/_schemes/Gemini/index.styl b/source/css/_schemes/Gemini/index.styl index a03e47d640..09f07375e3 100644 --- a/source/css/_schemes/Gemini/index.styl +++ b/source/css/_schemes/Gemini/index.styl @@ -112,18 +112,16 @@ $use-seo = hexo-config('seo'); box-shadow: $box-shadow-inner; // Adapt submenu(s) with post-blocks. - + .content { - .post-block { - box-shadow: $box-shadow; - margin-top: $sidebar-offset; - - +tablet() { - margin-top: $content-tablet-padding; - } - - +mobile() { - margin-top: $content-mobile-padding; - } + + .posts-expand .post-block { + box-shadow: $box-shadow; + margin-top: $sidebar-offset; + + +tablet() { + margin-top: $content-tablet-padding; + } + + +mobile() { + margin-top: $content-mobile-padding; } } } diff --git a/source/css/_schemes/Mist/_posts-expand.styl b/source/css/_schemes/Mist/_posts-expand.styl index 391aae638b..fbf83d3789 100644 --- a/source/css/_schemes/Mist/_posts-expand.styl +++ b/source/css/_schemes/Mist/_posts-expand.styl @@ -15,7 +15,7 @@ } .posts-expand { - padding-top: 0; + padding-top: 80px; .post-eof { display: none; diff --git a/source/css/_schemes/Mist/index.styl b/source/css/_schemes/Mist/index.styl index 64effc0b41..68aab8e782 100644 --- a/source/css/_schemes/Mist/index.styl +++ b/source/css/_schemes/Mist/index.styl @@ -6,6 +6,7 @@ @import '_menu'; @import '_posts-expand'; @import '../Muse/_sidebar'; +@import '../Muse/_sub-menu'; // Components // -------------------------------------------------- @@ -23,7 +24,6 @@ // -------------------------------------------------- .main-inner { padding-bottom: 80px; - padding-top: 80px; +mobile() { width: auto; diff --git a/source/css/_schemes/Muse/_layout.styl b/source/css/_schemes/Muse/_layout.styl index 90776fc8e6..7d4854493a 100644 --- a/source/css/_schemes/Muse/_layout.styl +++ b/source/css/_schemes/Muse/_layout.styl @@ -14,6 +14,10 @@ padding-bottom: 60px; } +.posts-expand { + padding-top: 70px; +} + embed { display: block; margin: 0 auto 25px auto; diff --git a/source/css/_schemes/Muse/_sub-menu.styl b/source/css/_schemes/Muse/_sub-menu.styl new file mode 100644 index 0000000000..18dc7e0ad4 --- /dev/null +++ b/source/css/_schemes/Muse/_sub-menu.styl @@ -0,0 +1,5 @@ +.sub-menu { + .menu-item { + display: inline-block; + } +} diff --git a/source/css/_schemes/Muse/index.styl b/source/css/_schemes/Muse/index.styl index be5917d3d5..440b086d9c 100644 --- a/source/css/_schemes/Muse/index.styl +++ b/source/css/_schemes/Muse/index.styl @@ -2,3 +2,4 @@ @import '_header'; @import '_menu'; @import '_sidebar'; +@import '_sub-menu'; diff --git a/source/css/_schemes/Pisces/_sub-menu.styl b/source/css/_schemes/Pisces/_sub-menu.styl index 1fd996dae3..480187fc52 100644 --- a/source/css/_schemes/Pisces/_sub-menu.styl +++ b/source/css/_schemes/Pisces/_sub-menu.styl @@ -15,6 +15,12 @@ background: initial; color: $sidebar-highlight; } + + if (!hexo-config('menu_settings.badges')) { + &::after { + content: initial !important; + } + } } } @@ -27,11 +33,5 @@ background: white; border-bottom-color: $sidebar-highlight; } - - if (!hexo-config('menu_settings.badges')) { - &::after { - content: initial; - } - } } } From 0960c7775ceadac1174a3c67bf917b236976b829 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Thu, 17 Oct 2019 17:57:44 +0800 Subject: [PATCH 3/6] Update --- _config.yml | 2 +- source/css/_common/outline/header/github-banner.styl | 1 + source/css/_variables/base.styl | 11 ++++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/_config.yml b/_config.yml index f5f83a7536..02fde2986a 100644 --- a/_config.yml +++ b/_config.yml @@ -402,7 +402,7 @@ reading_progress: # Available values: top | bottom position: top color: "#37c6c0" - height: 2px + height: 3px # Bookmark Support bookmark: diff --git a/source/css/_common/outline/header/github-banner.styl b/source/css/_common/outline/header/github-banner.styl index 7d78dc13ea..42a433a9cf 100644 --- a/source/css/_common/outline/header/github-banner.styl +++ b/source/css/_common/outline/header/github-banner.styl @@ -27,6 +27,7 @@ position: absolute; right: 0; top: 0; + z-index: $zindex-0; } +tablet-mobile() { diff --git a/source/css/_variables/base.styl b/source/css/_variables/base.styl index 82c8081b65..9a2ecb965a 100644 --- a/source/css/_variables/base.styl +++ b/source/css/_variables/base.styl @@ -106,11 +106,12 @@ $line-height-code-block = 1.6; // Can't be less than 1.3; // Z-index master list // -------------------------------------------------- -$zindex-1 = 100; -$zindex-2 = 200; -$zindex-3 = 300; -$zindex-4 = 400; -$zindex-5 = 500; +$zindex-0 = 1000 +$zindex-1 = 1100; +$zindex-2 = 1200; +$zindex-3 = 1300; +$zindex-4 = 1400; +$zindex-5 = 1500; // Table From a48115cd3679c48f1ba42318c93f54efa198babf Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Thu, 17 Oct 2019 19:55:31 +0800 Subject: [PATCH 4/6] back --- layout/_layout.swig | 1 + layout/_partials/header/sub-menu.swig | 2 +- layout/page.swig | 2 -- source/css/_schemes/Gemini/index.styl | 2 +- source/css/_schemes/Mist/_base.styl | 4 ++++ source/css/_schemes/Mist/_posts-expand.styl | 2 +- source/css/_schemes/Muse/_layout.styl | 8 ++++++-- source/css/_schemes/Muse/_sub-menu.styl | 2 ++ 8 files changed, 16 insertions(+), 7 deletions(-) diff --git a/layout/_layout.swig b/layout/_layout.swig index 56c7cb6249..ffe830c6ec 100644 --- a/layout/_layout.swig +++ b/layout/_layout.swig @@ -36,6 +36,7 @@
+ {% include '_partials/header/sub-menu.swig' %}
{% block content %}{% endblock %}
diff --git a/layout/_partials/header/sub-menu.swig b/layout/_partials/header/sub-menu.swig index 8e340189ac..4b3ba16b96 100644 --- a/layout/_partials/header/sub-menu.swig +++ b/layout/_partials/header/sub-menu.swig @@ -1,6 +1,6 @@ {% import 'menu-item.swig' as menu_item %} -{%- if theme.menu %} +{%- if theme.menu and is_page() %} {# Submenu & Submenu-2 #} {%- for name, value in theme.menu %} diff --git a/layout/page.swig b/layout/page.swig index 52f74ee1d7..03af5600c9 100644 --- a/layout/page.swig +++ b/layout/page.swig @@ -17,8 +17,6 @@ {% block content %} - {% include '_partials/header/sub-menu.swig' %} -
{##################} {### PAGE BLOCK ###} diff --git a/source/css/_schemes/Gemini/index.styl b/source/css/_schemes/Gemini/index.styl index 09f07375e3..4859ebb5a8 100644 --- a/source/css/_schemes/Gemini/index.styl +++ b/source/css/_schemes/Gemini/index.styl @@ -112,7 +112,7 @@ $use-seo = hexo-config('seo'); box-shadow: $box-shadow-inner; // Adapt submenu(s) with post-blocks. - + .posts-expand .post-block { + + .content .post-block { box-shadow: $box-shadow; margin-top: $sidebar-offset; diff --git a/source/css/_schemes/Mist/_base.styl b/source/css/_schemes/Mist/_base.styl index f36b49b8a8..c00bf523f6 100644 --- a/source/css/_schemes/Mist/_base.styl +++ b/source/css/_schemes/Mist/_base.styl @@ -8,3 +8,7 @@ hr { height: 2px; margin: 20px 0; } + +.content { + padding-top: 80px; +} diff --git a/source/css/_schemes/Mist/_posts-expand.styl b/source/css/_schemes/Mist/_posts-expand.styl index fbf83d3789..391aae638b 100644 --- a/source/css/_schemes/Mist/_posts-expand.styl +++ b/source/css/_schemes/Mist/_posts-expand.styl @@ -15,7 +15,7 @@ } .posts-expand { - padding-top: 80px; + padding-top: 0; .post-eof { display: none; diff --git a/source/css/_schemes/Muse/_layout.styl b/source/css/_schemes/Muse/_layout.styl index 7d4854493a..caf5e915d4 100644 --- a/source/css/_schemes/Muse/_layout.styl +++ b/source/css/_schemes/Muse/_layout.styl @@ -6,7 +6,7 @@ .header-inner { +mobile() { - padding: 50px 0 35px; + padding: 50px 0 0; } } @@ -14,8 +14,12 @@ padding-bottom: 60px; } -.posts-expand { +.content { padding-top: 70px; + + +mobile() { + padding-top: 35px; + } } embed { diff --git a/source/css/_schemes/Muse/_sub-menu.styl b/source/css/_schemes/Muse/_sub-menu.styl index 18dc7e0ad4..59bf193432 100644 --- a/source/css/_schemes/Muse/_sub-menu.styl +++ b/source/css/_schemes/Muse/_sub-menu.styl @@ -1,4 +1,6 @@ .sub-menu { + margin: 10px 0; + .menu-item { display: inline-block; } From 177c4a1f16d9046d66ef1818b6b2088b94902225 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Thu, 17 Oct 2019 21:05:38 +0800 Subject: [PATCH 5/6] Rename --- source/css/_schemes/Mist/_base.styl | 14 ------ source/css/_schemes/Mist/_layout.styl | 65 +++++++++++++++++++++++++++ source/css/_schemes/Mist/index.styl | 53 +--------------------- source/css/_schemes/Muse/index.styl | 2 +- 4 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 source/css/_schemes/Mist/_base.styl create mode 100644 source/css/_schemes/Mist/_layout.styl diff --git a/source/css/_schemes/Mist/_base.styl b/source/css/_schemes/Mist/_base.styl deleted file mode 100644 index c00bf523f6..0000000000 --- a/source/css/_schemes/Mist/_base.styl +++ /dev/null @@ -1,14 +0,0 @@ -// Tags -// -------------------------------------------------- -a { - border-bottom-color: $grey-light; -} - -hr { - height: 2px; - margin: 20px 0; -} - -.content { - padding-top: 80px; -} diff --git a/source/css/_schemes/Mist/_layout.styl b/source/css/_schemes/Mist/_layout.styl new file mode 100644 index 0000000000..8551ed5083 --- /dev/null +++ b/source/css/_schemes/Mist/_layout.styl @@ -0,0 +1,65 @@ +// Tags +// -------------------------------------------------- +a { + border-bottom-color: $grey-light; +} + +hr { + height: 2px; + margin: 20px 0; +} + +// Components +// -------------------------------------------------- +.btn { + border-radius: 0; + border-width: 2px; + padding: 0 10px; +} + +.headband { + display: none; +} + +// Page - Container +// -------------------------------------------------- +.main-inner { + padding-bottom: 80px; + + +mobile() { + width: auto; + } +} + +.content { + padding-top: 80px; +} + +// Pagination +// -------------------------------------------------- +.pagination { + margin: 120px 0 0; + text-align: left; + + +mobile() { + margin: 80px 10px 0; + text-align: center; + } +} + +// Footer +// -------------------------------------------------- +.footer { + background: $whitesmoke; + color: $grey-dim; + padding: 10px 0; +} + +.footer-inner { + text-align: left; + + +mobile() { + text-align: center; + width: auto; + } +} diff --git a/source/css/_schemes/Mist/index.styl b/source/css/_schemes/Mist/index.styl index 68aab8e782..2f7053ca8e 100644 --- a/source/css/_schemes/Mist/index.styl +++ b/source/css/_schemes/Mist/index.styl @@ -1,60 +1,9 @@ // // Mist scheme // ================================================== -@import '_base'; +@import '_layout'; @import '_header'; @import '_menu'; @import '_posts-expand'; @import '../Muse/_sidebar'; @import '../Muse/_sub-menu'; - -// Components -// -------------------------------------------------- -.btn { - border-radius: 0; - border-width: 2px; - padding: 0 10px; -} - -.headband { - display: none; -} - -// Page - Container -// -------------------------------------------------- -.main-inner { - padding-bottom: 80px; - - +mobile() { - width: auto; - } -} - -// Pagination -// -------------------------------------------------- -.pagination { - margin: 120px 0 0; - text-align: left; - - +mobile() { - margin: 80px 10px 0; - text-align: center; - } -} - -// Footer -// -------------------------------------------------- -.footer { - background: $whitesmoke; - color: $grey-dim; - padding: 10px 0; -} - -.footer-inner { - text-align: left; - - +mobile() { - text-align: center; - width: auto; - } -} diff --git a/source/css/_schemes/Muse/index.styl b/source/css/_schemes/Muse/index.styl index 440b086d9c..959b7ae7d4 100644 --- a/source/css/_schemes/Muse/index.styl +++ b/source/css/_schemes/Muse/index.styl @@ -1,5 +1,5 @@ @import '_layout'; @import '_header'; @import '_menu'; -@import '_sidebar'; @import '_sub-menu'; +@import '_sidebar'; From ef8f5aa0041e54dcef3b2c651113f3526d27fef9 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Thu, 17 Oct 2019 21:43:29 +0800 Subject: [PATCH 6/6] Update --- source/css/_common/outline/header/header.styl | 1 - source/css/_schemes/Muse/_layout.styl | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/css/_common/outline/header/header.styl b/source/css/_common/outline/header/header.styl index 43c220a968..087d3cb113 100644 --- a/source/css/_common/outline/header/header.styl +++ b/source/css/_common/outline/header/header.styl @@ -6,7 +6,6 @@ .header-inner { margin: 0 auto; - padding: 100px 0 0; position: relative; width: $content-desktop; diff --git a/source/css/_schemes/Muse/_layout.styl b/source/css/_schemes/Muse/_layout.styl index caf5e915d4..4cea849c29 100644 --- a/source/css/_schemes/Muse/_layout.styl +++ b/source/css/_schemes/Muse/_layout.styl @@ -5,8 +5,10 @@ } .header-inner { + padding-top: 100px; + +mobile() { - padding: 50px 0 0; + padding-top: 50px; } }