fix: resolve language toggle button hover floating issue

This commit is contained in:
P小二
2025-07-09 16:52:03 +08:00
parent 7a3c40fd56
commit 48fcaec97d
2 changed files with 10 additions and 30 deletions

View File

@@ -1,33 +1,6 @@
<!-- Custom CSS --> <!-- Custom CSS -->
<link rel="stylesheet" href="{{ '/assets/css/custom.css' | relative_url }}"> <link rel="stylesheet" href="{{ '/assets/css/custom.css' | relative_url }}">
<style> <style>
/* Language Toggle Styles */
.language-toggle {
margin: 1rem 0;
}
.btn-lang {
display: inline-block;
margin: 0 0.25rem;
padding: 0.5rem 1rem;
background-color: rgba(255, 255, 255, 0.2);
color: white;
text-decoration: none;
border-radius: 0.3rem;
border: 1px solid rgba(255, 255, 255, 0.3);
transition: all 0.2s ease;
}
.btn-lang:hover {
background-color: rgba(255, 255, 255, 0.3);
border-color: rgba(255, 255, 255, 0.5);
}
.btn-lang.active {
background-color: rgba(255, 255, 255, 0.9);
color: #333;
border-color: rgba(255, 255, 255, 0.9);
}
/* Table of Contents Styles */ /* Table of Contents Styles */
.toc { .toc {

View File

@@ -22,6 +22,9 @@ body {
border-radius: 0.3rem; border-radius: 0.3rem;
border: 1px solid rgba(255, 255, 255, 0.3); border: 1px solid rgba(255, 255, 255, 0.3);
transition: all 0.2s ease; transition: all 0.2s ease;
/* 确保按钮不受通用 .btn 样式影响 */
transform: none !important;
box-shadow: none;
} }
.btn-lang:hover { .btn-lang:hover {
@@ -29,12 +32,16 @@ body {
border-color: rgba(255, 255, 255, 0.5); border-color: rgba(255, 255, 255, 0.5);
text-decoration: none; text-decoration: none;
color: white; color: white;
/* 禁用悬浮时的变形效果 */
transform: none !important;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
} }
.btn-lang.active { .btn-lang.active {
background-color: rgba(255, 255, 255, 0.9); background-color: rgba(255, 255, 255, 0.9);
color: #333; color: #333;
border-color: rgba(255, 255, 255, 0.9); border-color: rgba(255, 255, 255, 0.9);
transform: none !important;
} }
/* Enhanced Header */ /* Enhanced Header */
@@ -54,12 +61,12 @@ body {
opacity: 0.9; opacity: 0.9;
} }
/* Enhanced Buttons */ /* Enhanced Buttons - 只影响GitHub按钮不影响语言切换按钮 */
.btn { .btn:not(.btn-lang) {
transition: all 0.3s ease; transition: all 0.3s ease;
} }
.btn:hover { .btn:not(.btn-lang):hover {
transform: translateY(-2px); transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0,0,0,0.2); box-shadow: 0 4px 8px rgba(0,0,0,0.2);
} }