diff --git a/source/css/_schemes/Muse/_sidebar.styl b/source/css/_schemes/Muse/_sidebar.styl index 7e786ef..ae10734 100644 --- a/source/css/_schemes/Muse/_sidebar.styl +++ b/source/css/_schemes/Muse/_sidebar.styl @@ -1,6 +1,8 @@ if (hexo-config('sidebar.position') == 'right') { .sidebar-active { - +desktop() { + // Note: $sidebar-desktop + $content-desktop-large should be greater than desktop-large threshold + // Otherwise a horizontal scrollbar will appear + +desktop-large() { padding-right: $sidebar-desktop; } } @@ -14,7 +16,7 @@ if (hexo-config('sidebar.position') == 'right') { } } else { .sidebar-active { - +desktop() { + +desktop-large() { padding-left: $sidebar-desktop; } } @@ -94,26 +96,25 @@ if (hexo-config('sidebar.position') == 'right') { } .sidebar-dimmer { - display: none; -} + background: black; + height: 100%; + left: 0; + opacity: 0; + position: fixed; + top: 0; + transition: visibility .4s, opacity .4s; + visibility: hidden; + width: 100%; + z-index: $zindex-1; -+tablet-mobile() { - .sidebar-dimmer { - background: black; - display: block; - height: 100%; - left: 0; - opacity: 0; - position: fixed; - top: 0; - transition: visibility .4s, opacity .4s; - visibility: hidden; - width: 100%; - z-index: $zindex-1; - - .sidebar-active & { - opacity: .7; - visibility: visible; - } + .sidebar-active & { + opacity: .7; + visibility: visible; + } +} + ++desktop-large() { + .sidebar-dimmer { + display: none; } } diff --git a/source/css/noscript.styl b/source/css/noscript.styl index a1f18bf..1a1eea5 100644 --- a/source/css/noscript.styl +++ b/source/css/noscript.styl @@ -1,3 +1,5 @@ +@import '_variables/base'; + body { margin-top: 2rem; } .use-motion .menu-item, @@ -30,7 +32,7 @@ body { margin-top: 2rem; } .sidebar-panel { display: block; } .noscript-warning { - background-color: #f55; + background-color: lighten($red, 20%); color: white; font-family: sans-serif; font-size: 1rem; @@ -40,5 +42,5 @@ body { margin-top: 2rem; } text-align: center; top: 0; width: 100%; - z-index: 50; + z-index: $zindex-5; } diff --git a/source/js/utils.js b/source/js/utils.js index 9920825..0f2dad3 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -286,7 +286,7 @@ NexT.utils = { }, updateSidebarPosition: function() { - if (window.innerWidth < 992 || CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') return; + if (window.innerWidth < 1200 || CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') return; // Expand sidebar on post detail page by default, when post has a toc. const hasTOC = document.querySelector('.post-toc'); let display = CONFIG.page.sidebar;