Skip to content

Commit

Permalink
Merge pull request theme-next#111 from tsanie/support-configurable-si…
Browse files Browse the repository at this point in the history
…debar-width

Support to manual configure the sidebar width of the Gemini Scheme.
  • Loading branch information
ivan-nginx authored Feb 8, 2018
2 parents c8e1dba + 5ca8c94 commit cf73233
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions source/css/_schemes/Pisces/_layout.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion source/css/_schemes/Pisces/_sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions source/css/_variables/Gemini.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
// --------------------------------------------------
Expand Down

0 comments on commit cf73233

Please sign in to comment.