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

Option onmoble for sidebar wasn't worked #808

Merged
merged 9 commits into from
Apr 4, 2019
4 changes: 2 additions & 2 deletions source/css/_common/components/back-to-top-sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
opacity: $b2t-opacity;
cursor: pointer;
text-align: center;
&:hover { opacity: 0.8; }
&:hover { opacity: $b2t-opacity-hover; }

+tablet-mobile() {
hexo-config('sidebar.onmobile') ? fixbutton() : hide();
hide() if not hexo-config('sidebar.onmobile');
}

&.back-to-top-on {
Expand Down
5 changes: 3 additions & 2 deletions source/css/_common/components/back-to-top.styl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
&.back-to-top-on {
bottom: $b2t-position-bottom-on;
}
&:hover {
color: $sidebar-highlight;
+tablet-mobile() {
opacity: $b2t-opacity-hover;
right: $b2t-position-right-mobile;
}
}
7 changes: 3 additions & 4 deletions source/css/_common/components/sidebar/sidebar-toggle.styl
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.sidebar-toggle {
&:hover .sidebar-toggle-line {
background: $sidebar-highlight;
}
position: fixed;
right: $b2t-position-right;
bottom: 45px;
Expand All @@ -14,7 +11,9 @@
cursor: pointer;

+tablet-mobile() {
hexo-config('sidebar.onmobile') ? fixbutton() : hide();
opacity: $b2t-opacity-hover;
right: $b2t-position-right-mobile;
hide() if not hexo-config('sidebar.onmobile');
}
}

Expand Down
5 changes: 0 additions & 5 deletions source/css/_mixins/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ show() {
display: block;
}

fixbutton() {
right: 20px;
opacity: 0.8;
}

random-color($min, $max) {
return floor(math(0, 'random') * ($max - $min + 1) + $min);
}
Expand Down
2 changes: 2 additions & 0 deletions source/css/_variables/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ $toc-link-active-current-border-color = $sidebar-highlight
// --------------------------------------------------
// Back to top
$b2t-opacity = 1
$b2t-opacity-hover = 0.8
$b2t-position-bottom = -100px
$b2t-position-bottom-on = 19px
$b2t-position-right = 30px
$b2t-position-right-mobile = 20px
$b2t-font-size = 12px
$b2t-color = white
$b2t-bg-color = $black-deep
Expand Down