Skip to content

Commit

Permalink
Merge pull request #434 from theme-next/dev
Browse files Browse the repository at this point in the history
Fixes for b2t & variables refactoring.
  • Loading branch information
ivan-nginx authored Oct 3, 2018
2 parents 885daa2 + a1e451c commit e10e9fc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
8 changes: 4 additions & 4 deletions source/css/_common/components/back-to-top-sidebar.styl
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
.back-to-top {
display: none;
margin: 20px -10px -20px;
visibility: hidden;
margin: (20px - $sidebar-offset) -10px -20px;
background: $body-bg-color;
font-size: $b2t-font-size;
opacity: $b2t-opacity;
cursor: pointer;
text-align: center;
-webkit-transform: translateZ(0);
the-transition();
&:hover { opacity: 0.8; }

+tablet() {
Expand All @@ -20,6 +19,7 @@
}

&.back-to-top-on {
display: block;
visibility: visible;
the-transition();
}
}
24 changes: 13 additions & 11 deletions source/css/_schemes/Gemini/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
// =================================================
// Sidebar padding used as main desktop content padding for sidebar padding and post blocks padding too.

// In main NexT config set `sidebar: offset: 12` option as main padding.
// In `source/css/_variables/Gemini.styl` there are variables for other resolutions:
// $content-tablet-paddin = 10px;
// In `source/css/_variables/Pisces.styl` there are variable for main offset:
// $sidebar-offset = 12px;
// This value alse can be changed in main NexT config as `sidebar: offset: 12` option.

// In `source/css/_variables/base.styl` there are variables for other resolutions:
// $content-tablet-padding = 10px;
// $content-mobile-padding = 8px;
// P.S. If u want to change this paddings u may set this variables into `source/css/_variables/custom.styl`.

// So, it will 12px in Desktop, 10px in Tablets and 8px in Mobiles for all possible paddings.
// =================================================
// Read values from NexT config and set they as local variables to use as string variables (in any CSS section).
hexo-config('sidebar.offset') is a 'unit' ? (sboffset = unit(hexo-config('sidebar.offset'), px)) : (sboffset = 0)
use_seo = hexo-config('seo');

// =================================================
Expand All @@ -45,7 +47,7 @@ use_seo = hexo-config('seo');
// When blocks are siblings (homepage).
#posts > article + article {
.post-block {
margin-top: sboffset;
margin-top: $sidebar-offset;
// Rewrite shadows & borders because all blocks have offsets.
box-shadow: $box-shadow;
border-radius: $border-radius;
Expand All @@ -56,7 +58,7 @@ use_seo = hexo-config('seo');
.comments {
padding: $content-desktop-padding;
margin: initial;
margin-top: sboffset;
margin-top: $sidebar-offset;
background: white;
box-shadow: $box-shadow;
border-radius: $border-radius;
Expand Down Expand Up @@ -87,7 +89,7 @@ use_seo = hexo-config('seo');
margin-bottom: initial;
top: initial;
}
margin: sboffset 0 0;
margin: $sidebar-offset 0 0;
border-top: initial;
background: white;
box-shadow: $box-shadow;
Expand All @@ -111,7 +113,7 @@ use_seo = hexo-config('seo');
&+ #content > #posts {
.post-block {
box-shadow: $box-shadow;
margin-top: sboffset;
margin-top: $sidebar-offset;
+tablet() {
margin-top: $content-tablet-padding;
}
Expand Down Expand Up @@ -227,7 +229,7 @@ use_seo = hexo-config('seo');

// Components inside Posts.
.post-button {
margin-top: sboffset;
margin-top: $sidebar-offset;
//padding-bottom : 15px;
}
img {
Expand All @@ -237,7 +239,7 @@ use_seo = hexo-config('seo');

.post-block {
// Inside posts blocks content padding (default 40px).
padding: sboffset;
padding: $sidebar-offset;
min-height: auto;
// Rewrite shadows & borders because all blocks have offsets.
box-shadow: $box-shadow;
Expand All @@ -253,7 +255,7 @@ use_seo = hexo-config('seo');

.comments {
margin-top: $content-mobile-padding;
padding: 0 sboffset;
padding: 0 $sidebar-offset;
}

.pagination {
Expand Down

0 comments on commit e10e9fc

Please sign in to comment.