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 'related-posts';
@import 'math';
@import 'gitter';
.use-motion .animated {
// 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';
if (($scheme == 'Muse') or ($scheme == 'Mist')) {
$condition = $condition == $reverse;
}
if ($condition) {
left: $b2t-position-right;
+tablet-mobile() {
left: $b2t-position-right-mobile;
return $condition ? ('left' 'right') : ('right' 'left');
}
} else {
right: $b2t-position-right;
sidebar-toggle-position($reverse) {
$alignment = sidebar-toggle-alignment($reverse)[0];
{$alignment}: $b2t-position-right;
+tablet-mobile() {
right: $b2t-position-right-mobile;
}
{$alignment}: $b2t-position-right-mobile;
}
}
@ -144,7 +142,7 @@ sidebar-toggle() {
opacity: $b2t-opacity;
position: fixed;
z-index: $zindex-3;
sidebar-toggle-position();
sidebar-toggle-position(false);
&:hover {
opacity: $b2t-opacity-hover;