Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom sidebar width & content width for all schemes. #339

Merged
merged 47 commits into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f5eb4f3
Merge branch 'ivan/check-houndy' into dev
ivan-nginx Jun 7, 2018
975b34d
Check Codacy.
ivan-nginx Jun 7, 2018
69fd2a6
Refactored `utils.js` styles.
ivan-nginx Jun 10, 2018
194a454
Merge branch 'ivan/refactored-utils.js' into dev
ivan-nginx Jun 10, 2018
08f7543
Refactored `scroll-cookie.js`.
ivan-nginx Jun 10, 2018
7ee19b2
Refactored `bootstrap.js`.
ivan-nginx Jun 10, 2018
0ce9ed9
Refactored `helpers.js`.
ivan-nginx Jun 10, 2018
99314e4
Refactored `exturl.js`.
ivan-nginx Jun 10, 2018
99bd129
Refactored `exturl.js`. [2]
ivan-nginx Jun 10, 2018
a515f4c
Refactored `exturl.js`. [3]
ivan-nginx Jun 10, 2018
74dc2e8
Refactored `tabs.js`.
ivan-nginx Jun 10, 2018
6d86dd5
Refactored `note.js`.
ivan-nginx Jun 10, 2018
8e46db0
Refacored `label.js`.
ivan-nginx Jun 10, 2018
5a791f1
Refactored `lazy-image.js`.
ivan-nginx Jun 10, 2018
4e22e48
Refactored `include-raw.js`.
ivan-nginx Jun 10, 2018
9ddd3c4
Refactored `include-raw.js`. [2]
ivan-nginx Jun 10, 2018
5459daa
Refactored `group-pictures.js`.
ivan-nginx Jun 10, 2018
154684e
Refactored `full-image.js`.
ivan-nginx Jun 10, 2018
d83eb77
Refactored `exturl.js`.
ivan-nginx Jun 10, 2018
bed5a74
Refactored `exturl.js`. [2]
ivan-nginx Jun 10, 2018
6470e26
Refactored `center-quote.js`.
ivan-nginx Jun 10, 2018
c7b1a6e
Refactored `tabs.js`. [2]
ivan-nginx Jun 10, 2018
863f6f3
Refactored `button.js`.
ivan-nginx Jun 10, 2018
692afd0
Refactored `motion.js`.
ivan-nginx Jun 10, 2018
a0e9fef
Refactored `pisces.js`.
ivan-nginx Jun 10, 2018
933052a
Refactored `pisces.js`. [2]
ivan-nginx Jun 10, 2018
a660cbc
Refactored `post-details.js`.
ivan-nginx Jun 10, 2018
85accc1
Refactored `algolia-search.js`.
ivan-nginx Jun 11, 2018
27fe5a8
Refactored `algolia-search.js`. [2]
ivan-nginx Jun 11, 2018
7d0eb80
Refactored `affix.js`.
ivan-nginx Jun 11, 2018
ecc79c3
Refactored `scrollspy.js`.
ivan-nginx Jun 11, 2018
345c72d
Refactored `full-image.js`. [2]
ivan-nginx Jun 11, 2018
ab6606e
Refactored `lazy-image.js`. [2]
ivan-nginx Jun 11, 2018
bc07d10
Refactored `full-image.js`. [3]
ivan-nginx Jun 11, 2018
e0f1d96
Removed `global hexo script` string from main description of all tags.
ivan-nginx Jun 12, 2018
22992c9
Refactored `tabs.js`. [3]
ivan-nginx Jun 12, 2018
06752e2
Refactored `motion.js`. [2]
ivan-nginx Jun 13, 2018
004e116
Refactored tags.
ivan-nginx Jun 13, 2018
2503044
Refactored `note.js`. [2]
ivan-nginx Jun 13, 2018
9804e90
Refactored `note.js`. [3]
ivan-nginx Jun 13, 2018
fcb4334
Refactored `footer.swig`.
ivan-nginx Jun 14, 2018
7b4c4a3
Refactored `scrollspy.js`. [2]
ivan-nginx Jun 15, 2018
cab7aa1
Merge branch 'master' into dev
ivan-nginx Jun 20, 2018
fe3298e
Updated Docs.
ivan-nginx Jun 20, 2018
02e20e2
Merge branch 'master' into dev
ivan-nginx Jun 20, 2018
4f84cd8
Custom sidebar width & content width for all schemes.
ivan-nginx Jul 4, 2018
aa2e617
Merge branch 'master' into dev
ivan-nginx Jul 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ sidebar:
position: left
#position: right

# Manual define the sidebar width.
# If commented, will be default for:
# Muse | Mist: 320
# Pisces | Gemini: 240
#width: 300

# Sidebar Display, available value (only for Muse | Mist):
# - post expand on posts automatically. Default.
# - always expand for all pages automatically
Expand Down Expand Up @@ -361,15 +367,6 @@ highlight_theme: normal
# Enable "cheers" for archive page.
cheers_enabled: true

# Manual define the max content width
# !!Only available for Gemini Scheme currently
# 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
Expand Down
9 changes: 9 additions & 0 deletions source/css/_common/outline/outline.styl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ html, body { height: 100%; }
+desktop-large() {
.container & { width: $content-desktop-large; }
}
+desktop-largest() {
.container & { width: $content-desktop-largest; }
}
}

// Main Section
Expand All @@ -35,6 +38,9 @@ html, body { height: 100%; }
+desktop-large() {
.container & { width: $content-desktop-large; }
}
+desktop-largest() {
.container & { width: $content-desktop-largest; }
}
}


Expand All @@ -55,4 +61,7 @@ html, body { height: 100%; }
+desktop-large() {
.container & { width: $content-desktop-large; }
}
+desktop-largest() {
.container & { width: $content-desktop-largest; }
}
}
6 changes: 6 additions & 0 deletions source/css/_mixins/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ desktop() {
}

desktop-large() {
@media (min-width: 1200px) {
{block}
}
}

desktop-largest() {
@media (min-width: 1600px) {
{block}
}
Expand Down
11 changes: 0 additions & 11 deletions source/css/_schemes/Gemini/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@
hexo-config('sidebar.offset') is a 'unit' ? (sboffset = unit(hexo-config('sidebar.offset'), px)) : (sboffset = 0)
use_seo = hexo-config('seo');

// Maximum content width.
// =================================================
$max-content-width = hexo-config('max_content_width')
if $max-content-width {
.header,
.container .main-inner,
.footer-inner {
max-width: unquote($max-content-width);
}
}

// =================================================
// Desktop layout styles.
// =================================================
Expand Down
15 changes: 8 additions & 7 deletions source/css/_schemes/Pisces/_layout.styl
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
.header {
position: relative;
margin: 0 auto;
width: $main-desktop;
width: $content-desktop;

+desktop-large() {
width: $content-desktop-large;
}
+desktop-largest() {
width: $content-desktop-largest;
}
+tablet() {
width: auto;
}
Expand Down Expand Up @@ -47,7 +53,6 @@
}

.container .main-inner {
width: $main-desktop;

+tablet() {
width: auto;
Expand All @@ -61,7 +66,7 @@
float: right;
box-sizing: border-box;
padding: $content-desktop-padding;
width: $content-desktop;
width: $content-wrap;
background: white;
min-height: 700px;
box-shadow: $box-shadow-inner;
Expand Down Expand Up @@ -98,9 +103,7 @@

.sidebar-toggle { display: none; }


.footer-inner {
width: $main-desktop;
padding-left: 260px;

+tablet() {
Expand All @@ -115,8 +118,6 @@
}
}



.sidebar-position-right {
.header-inner { right: 0; }
.content-wrap { float: left; }
Expand Down
4 changes: 0 additions & 4 deletions source/css/_variables/Gemini.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
// Settings for some of the most global styles.
// --------------------------------------------------
$body-bg-color = #eee
$main-desktop = 75%
$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
11 changes: 9 additions & 2 deletions source/css/_variables/Pisces.styl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
// --------------------------------------------------
$body-bg-color = #f5f7f9

$sidebar-offset = unit(hexo-config('sidebar.offset'), px) if hexo-config('sidebar.offset') is a 'unit'
$sidebar-width = hexo-config('sidebar.width') is a 'unit' ? hexo-config('sidebar.width') : 240
$sidebar-desktop = unit($sidebar-width, 'px')
$content-wrap = 'calc(100% - %s)' % unit($sidebar-width + $sidebar-offset, 'px')

$content-desktop = 'calc(100% - %s)' % unit($content-desktop-padding / 2, 'px')
$content-desktop-large = 1160px
$content-desktop-largest = 73%


// Borders
// --------------------------------------------------
Expand All @@ -21,8 +30,6 @@ $subtitle-color = $gray-lighter

// Sidebar
// --------------------------------------------------
$sidebar-offset = unit(hexo-config('sidebar.offset'), px) if hexo-config('sidebar.offset') is a 'unit'

$sidebar-nav-hover-color = $orange
$sidebar-highlight = $orange

Expand Down
7 changes: 2 additions & 5 deletions source/css/_variables/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,15 @@ $pagination-active-border = $grey-light
// Layout sizes
// --------------------------------------------------

$main-desktop = 960px
$main-desktop-large = 1200px

$content-desktop = 700px
$content-desktop-large = 900px
$content-desktop-large = 800px
$content-desktop-largest = 900px

$content-desktop-padding = 40px
$content-tablet-padding = 10px
$content-mobile-padding = 8px

$sidebar-desktop = 240px

$footer-height = 50px

$gap-between-main-and-footer = 100px
Expand Down
2 changes: 1 addition & 1 deletion source/js/src/motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ $(document).ready(function() {
sidebarToggleLines.push(sidebarToggleLine2nd);
sidebarToggleLines.push(sidebarToggleLine3rd);

var SIDEBAR_WIDTH = '320px';
var SIDEBAR_WIDTH = CONFIG.sidebar.width ? CONFIG.sidebar.width : '320px';
var SIDEBAR_DISPLAY_DURATION = 200;
var xPos, yPos;

Expand Down