From 8a2051eb49c07ec7a8d7adab8b496d2d49489500 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Mon, 31 Dec 2018 20:40:59 +0800 Subject: [PATCH] Fix #48 (#550) * Fix #48 --- source/css/_common/outline/outline.styl | 10 +++------ source/css/_schemes/Pisces/_layout.styl | 7 ------- source/css/_variables/base.styl | 27 ------------------------- source/js/src/motion.js | 3 +-- source/js/src/schemes/pisces.js | 7 ++++--- source/js/src/utils.js | 5 ----- 6 files changed, 8 insertions(+), 51 deletions(-) diff --git a/source/css/_common/outline/outline.styl b/source/css/_common/outline/outline.styl index 648c8933d4..77deedb76c 100644 --- a/source/css/_common/outline/outline.styl +++ b/source/css/_common/outline/outline.styl @@ -28,9 +28,9 @@ html, body { height: 100%; } } } + // Main Section // -------------------------------------------------- -.main { padding-bottom: $footer-height + $gap-between-main-and-footer; } .main-inner { margin: 0 auto; width: $content-desktop; @@ -47,15 +47,11 @@ html, body { height: 100%; } // Footer Section // -------------------------------------------------- .footer { - position: absolute; - left: 0; - bottom: 0; - width: 100%; - min-height: $footer-height; + padding: 20px 0; } .footer-inner { box-sizing: border-box; - margin: 20px auto; + margin: 0px auto; width: $content-desktop; +desktop-large() { diff --git a/source/css/_schemes/Pisces/_layout.styl b/source/css/_schemes/Pisces/_layout.styl index 021f77b82f..31c37e5ac4 100644 --- a/source/css/_schemes/Pisces/_layout.styl +++ b/source/css/_schemes/Pisces/_layout.styl @@ -44,12 +44,6 @@ .main { clearfix(); - +tablet() { - padding-bottom: 100px; - } - +mobile() { - padding-bottom: 100px; - } } .container .main-inner { @@ -128,4 +122,3 @@ padding-right: 260px; } } - diff --git a/source/css/_variables/base.styl b/source/css/_variables/base.styl index 6245c7f25e..9717235018 100644 --- a/source/css/_variables/base.styl +++ b/source/css/_variables/base.styl @@ -3,11 +3,9 @@ // ================================================= - // Colors // colors for use across theme. // -------------------------------------------------- - $whitesmoke = #f5f5f5 $gainsboro = #eee $gray-lighter = #ddd @@ -25,11 +23,9 @@ $blue-deep = #262a30 $orange = #fc6423 - // Scaffolding // Settings for some of the most global styles. // -------------------------------------------------- - // Global text color on
$text-color = $black-light @@ -50,12 +46,9 @@ $selection-bg = $blue-deep $selection-color = white - // Typography // Font, line-height, and elements colors. // -------------------------------------------------- - - get_font_family(config) { custom_family = hexo-config('font.' + config + '.family') return custom_family is a 'string' ? custom_family : null @@ -113,7 +106,6 @@ $line-height-base = 2 $line-height-code-block = 1.6 // Can't be less than 1.3 - // Z-index master list // -------------------------------------------------- $zindex-bottom = -1 @@ -124,7 +116,6 @@ $zindex-4 = 1040 $zindex-5 = 1050 - // Table // -------------------------------------------------- $table-width = 100% @@ -140,7 +131,6 @@ $table-row-odd-bg-color = #f9f9f9 $table-row-hover-bg-color = $whitesmoke - // Code & Code Blocks // -------------------------------------------------- $code-font-family = $font-family-monospace @@ -151,10 +141,8 @@ $code-foreground = $black-light $code-background = $gainsboro - // Buttons // -------------------------------------------------- - $btn-font-weight = normal $btn-default-radius = 0 @@ -168,10 +156,8 @@ $btn-default-hover-color = $black-deep $btn-default-hover-border-color = $black-deep - // Pagination // -------------------------------------------------- - $pagination-border = $gainsboro $pagination-link-bg = transparent @@ -187,11 +173,8 @@ $pagination-active-color = white $pagination-active-border = $grey-light - // Layout sizes // -------------------------------------------------- - - $content-desktop = 700px $content-desktop-large = 800px $content-desktop-largest = 900px @@ -200,11 +183,6 @@ $content-desktop-padding = 40px $content-tablet-padding = 10px $content-mobile-padding = 8px -$footer-height = 50px - -$gap-between-main-and-footer = 100px - - // Headband // -------------------------------------------------- @@ -212,11 +190,9 @@ $headband-height = 3px $headband-bg = $black-deep - // Section Header // Variables for header section elements. // -------------------------------------------------- - $head-bg = transparent // Site Meta @@ -237,7 +213,6 @@ $menu-link-border = transparent $menu-link-hover-border = $black-deep - // Posts Expand // -------------------------------------------------- $posts-expand-title-font-weight = $font-weight-normal @@ -302,7 +277,6 @@ $toc-link-active-current-border-color = $sidebar-highlight // Components // -------------------------------------------------- - // Back to top $b2t-opacity = 1 $b2t-position-bottom = -100px @@ -322,7 +296,6 @@ $post-eof-margin-bottom = 60px // or 120px for less white space // Iconography // Icons SVG Base64 // -------------------------------------------------- - // blockquote-center icon $center-quote-left = '../images/quote-l.svg' $center-quote-right = '../images/quote-r.svg' diff --git a/source/js/src/motion.js b/source/js/src/motion.js index ae41ef99e1..a0951fbdf4 100644 --- a/source/js/src/motion.js +++ b/source/js/src/motion.js @@ -158,8 +158,7 @@ $(document).ready(function() { self.sidebarEl.addClass('sidebar-active'); self.sidebarEl.trigger('sidebar.didShow'); } - } - ); + }); this.sidebarEl.trigger('sidebar.isShowing'); }, diff --git a/source/js/src/schemes/pisces.js b/source/js/src/schemes/pisces.js index e2a98448a4..8c6e896fd3 100644 --- a/source/js/src/schemes/pisces.js +++ b/source/js/src/schemes/pisces.js @@ -3,16 +3,17 @@ $(document).ready(function() { var sidebarInner = $('.sidebar-inner'); - var sidebarOffset = CONFIG.sidebar.offset ? CONFIG.sidebar.offset : 12; + var sidebarOffset = CONFIG.sidebar.offset || 12; function getHeaderOffset() { return $('.header-inner').height() + sidebarOffset; } function getFooterOffset() { + var footer = $('#footer'); var footerInner = $('.footer-inner'); - var footerMargin = footerInner.outerHeight(true) - footerInner.outerHeight(); - var footerOffset = footerInner.outerHeight(true) + footerMargin; + var footerMargin = footer.outerHeight() - footerInner.outerHeight(); + var footerOffset = footer.outerHeight() + footerMargin; return footerOffset; } diff --git a/source/js/src/utils.js b/source/js/src/utils.js index 4f7c474565..0f3704e2f7 100644 --- a/source/js/src/utils.js +++ b/source/js/src/utils.js @@ -79,7 +79,6 @@ NexT.utils = NexT.$u = { } } }); - }, registerESCKeyEvent: function() { @@ -260,7 +259,6 @@ NexT.utils = NexT.$u = { var $div = $('').addClass('scrollbar-measure').prependTo('body'); var div = $div[0]; var scrollbarWidth = div.offsetWidth - div.clientWidth; - $div.remove(); return scrollbarWidth; @@ -289,7 +287,6 @@ NexT.utils = NexT.$u = { : (sidebarPadding * 2) + (sidebarNavHeight / 2); return sidebarSchemePadding; } - }; $(document).ready(function() { @@ -329,7 +326,5 @@ $(document).ready(function() { // Initialize Sidebar & TOC Height. updateSidebarHeight(document.body.clientHeight - NexT.utils.getSidebarSchemePadding()); } - initSidebarDimension(); - });