Skip to content

Commit 9dd2cc0

Browse files
authored
Merge pull request theme-next#434 from theme-next/dev
Fixes for b2t & variables refactoring.
2 parents c9389f3 + ed3a315 commit 9dd2cc0

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

source/css/_common/components/back-to-top-sidebar.styl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
.back-to-top {
2-
display: none;
3-
margin: 20px -10px -20px;
2+
visibility: hidden;
3+
margin: (20px - $sidebar-offset) -10px -20px;
44
background: $body-bg-color;
55
font-size: $b2t-font-size;
66
opacity: $b2t-opacity;
77
cursor: pointer;
88
text-align: center;
99
-webkit-transform: translateZ(0);
10-
the-transition();
1110
&:hover { opacity: 0.8; }
1211

1312
+tablet() {
@@ -20,6 +19,7 @@
2019
}
2120

2221
&.back-to-top-on {
23-
display: block;
22+
visibility: visible;
23+
the-transition();
2424
}
2525
}

source/css/_schemes/Gemini/index.styl

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@
1111
// =================================================
1212
// Sidebar padding used as main desktop content padding for sidebar padding and post blocks padding too.
1313

14-
// In main NexT config set `sidebar: offset: 12` option as main padding.
15-
// In `source/css/_variables/Gemini.styl` there are variables for other resolutions:
16-
// $content-tablet-paddin = 10px;
14+
// In `source/css/_variables/Pisces.styl` there are variable for main offset:
15+
// $sidebar-offset = 12px;
16+
// This value alse can be changed in main NexT config as `sidebar: offset: 12` option.
17+
18+
// In `source/css/_variables/base.styl` there are variables for other resolutions:
19+
// $content-tablet-padding = 10px;
1720
// $content-mobile-padding = 8px;
1821
// P.S. If u want to change this paddings u may set this variables into `source/css/_variables/custom.styl`.
1922

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

2628
// =================================================
@@ -45,7 +47,7 @@ use_seo = hexo-config('seo');
4547
// When blocks are siblings (homepage).
4648
#posts > article + article {
4749
.post-block {
48-
margin-top: sboffset;
50+
margin-top: $sidebar-offset;
4951
// Rewrite shadows & borders because all blocks have offsets.
5052
box-shadow: $box-shadow;
5153
border-radius: $border-radius;
@@ -56,7 +58,7 @@ use_seo = hexo-config('seo');
5658
.comments {
5759
padding: $content-desktop-padding;
5860
margin: initial;
59-
margin-top: sboffset;
61+
margin-top: $sidebar-offset;
6062
background: white;
6163
box-shadow: $box-shadow;
6264
border-radius: $border-radius;
@@ -87,7 +89,7 @@ use_seo = hexo-config('seo');
8789
margin-bottom: initial;
8890
top: initial;
8991
}
90-
margin: sboffset 0 0;
92+
margin: $sidebar-offset 0 0;
9193
border-top: initial;
9294
background: white;
9395
box-shadow: $box-shadow;
@@ -111,7 +113,7 @@ use_seo = hexo-config('seo');
111113
&+ #content > #posts {
112114
.post-block {
113115
box-shadow: $box-shadow;
114-
margin-top: sboffset;
116+
margin-top: $sidebar-offset;
115117
+tablet() {
116118
margin-top: $content-tablet-padding;
117119
}
@@ -227,7 +229,7 @@ use_seo = hexo-config('seo');
227229

228230
// Components inside Posts.
229231
.post-button {
230-
margin-top: sboffset;
232+
margin-top: $sidebar-offset;
231233
//padding-bottom : 15px;
232234
}
233235
img {
@@ -237,7 +239,7 @@ use_seo = hexo-config('seo');
237239

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

254256
.comments {
255257
margin-top: $content-mobile-padding;
256-
padding: 0 sboffset;
258+
padding: 0 $sidebar-offset;
257259
}
258260

259261
.pagination {

0 commit comments

Comments
 (0)