diff --git a/_config.yml b/_config.yml index 0dc9c63d69..1610f84a57 100644 --- a/_config.yml +++ b/_config.yml @@ -319,6 +319,11 @@ cheers_enabled: true # Leave it empty for the default 75% (suggest not less than 1000px) #max_content_width: 1000px +# Manual define the sidebar width +# !!Only available for Gemini Scheme currently +# Leave it empty for the default 240 +sidebar_width: + # --------------------------------------------------------------- # Font Settings # - Find fonts on Google Fonts (https://www.google.com/fonts) diff --git a/source/css/_schemes/Pisces/_layout.styl b/source/css/_schemes/Pisces/_layout.styl index f7e5e0de9e..a3a2b5223d 100644 --- a/source/css/_schemes/Pisces/_layout.styl +++ b/source/css/_schemes/Pisces/_layout.styl @@ -16,13 +16,13 @@ top: 0; overflow: hidden; padding: 0; - width: 240px; + width: $sidebar-desktop; background: white; box-shadow: $box-shadow-inner; border-radius: $border-radius-inner; +desktop-large() { - .container & { width: 240px; } + .container & { width: $sidebar-desktop; } } +tablet() { position: relative; diff --git a/source/css/_schemes/Pisces/_sidebar.styl b/source/css/_schemes/Pisces/_sidebar.styl index 769cec6556..9ced486498 100644 --- a/source/css/_schemes/Pisces/_sidebar.styl +++ b/source/css/_schemes/Pisces/_sidebar.styl @@ -14,7 +14,7 @@ .sidebar-inner { //padding: 20px 10px 0; box-sizing: border-box; - width: 240px; + width: $sidebar-desktop; color: $text-color; background: white; box-shadow: $box-shadow; diff --git a/source/css/_variables/Gemini.styl b/source/css/_variables/Gemini.styl index 4d6e7e01a3..04e14ef756 100644 --- a/source/css/_variables/Gemini.styl +++ b/source/css/_variables/Gemini.styl @@ -7,8 +7,9 @@ // -------------------------------------------------- $body-bg-color = #eee $main-desktop = 75% -$sidebar-desktop = 240px -$content-desktop = calc(100% - 252px) +$sidebar-width = hexo-config('sidebar_width') is a 'unit' ? hexo-config('sidebar_width') : 240 +$sidebar-desktop = unit($sidebar-width, 'px') +$content-desktop = 'calc(100% - %s)' % unit($sidebar-width + 12, 'px') // Borders. // --------------------------------------------------