Fix gitter button position

This commit is contained in:
Mimi 2021-12-31 17:03:46 +08:00
parent f3c1395fff
commit f70b4bffd6
3 changed files with 18 additions and 12 deletions

View File

@ -0,0 +1,7 @@
if (hexo-config('gitter.enable')) {
.gitter-open-chat-button {
$alignment = sidebar-toggle-alignment(false);
{$alignment[0]}: auto !important;
{$alignment[1]}: 10px !important;
}
}

View File

@ -4,6 +4,7 @@
@import 'search'; @import 'search';
@import 'related-posts'; @import 'related-posts';
@import 'math'; @import 'math';
@import 'gitter';
.use-motion .animated { .use-motion .animated {
// Fix issue #48 #55 // Fix issue #48 #55

View File

@ -120,21 +120,19 @@ main-container() {
} }
} }
sidebar-toggle-position($reverse = false) { sidebar-toggle-alignment($reverse) {
$condition = hexo-config('sidebar.position') == 'right'; $condition = hexo-config('sidebar.position') == 'right';
if (($scheme == 'Muse') or ($scheme == 'Mist')) { if (($scheme == 'Muse') or ($scheme == 'Mist')) {
$condition = $condition == $reverse; $condition = $condition == $reverse;
} }
if ($condition) { return $condition ? ('left' 'right') : ('right' 'left');
left: $b2t-position-right; }
+tablet-mobile() {
left: $b2t-position-right-mobile; sidebar-toggle-position($reverse) {
} $alignment = sidebar-toggle-alignment($reverse)[0];
} else { {$alignment}: $b2t-position-right;
right: $b2t-position-right; +tablet-mobile() {
+tablet-mobile() { {$alignment}: $b2t-position-right-mobile;
right: $b2t-position-right-mobile;
}
} }
} }
@ -144,7 +142,7 @@ sidebar-toggle() {
opacity: $b2t-opacity; opacity: $b2t-opacity;
position: fixed; position: fixed;
z-index: $zindex-3; z-index: $zindex-3;
sidebar-toggle-position(); sidebar-toggle-position(false);
&:hover { &:hover {
opacity: $b2t-opacity-hover; opacity: $b2t-opacity-hover;