Skip to content

Commit 48fcaec

Browse files
committed
fix: resolve language toggle button hover floating issue
1 parent 7a3c40f commit 48fcaec

File tree

2 files changed

+10
-30
lines changed

2 files changed

+10
-30
lines changed

_includes/head-custom.html

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,6 @@
11
<!-- Custom CSS -->
22
<link rel="stylesheet" href="{{ '/assets/css/custom.css' | relative_url }}">
33
<style>
4-
/* Language Toggle Styles */
5-
.language-toggle {
6-
margin: 1rem 0;
7-
}
8-
9-
.btn-lang {
10-
display: inline-block;
11-
margin: 0 0.25rem;
12-
padding: 0.5rem 1rem;
13-
background-color: rgba(255, 255, 255, 0.2);
14-
color: white;
15-
text-decoration: none;
16-
border-radius: 0.3rem;
17-
border: 1px solid rgba(255, 255, 255, 0.3);
18-
transition: all 0.2s ease;
19-
}
20-
21-
.btn-lang:hover {
22-
background-color: rgba(255, 255, 255, 0.3);
23-
border-color: rgba(255, 255, 255, 0.5);
24-
}
25-
26-
.btn-lang.active {
27-
background-color: rgba(255, 255, 255, 0.9);
28-
color: #333;
29-
border-color: rgba(255, 255, 255, 0.9);
30-
}
314

325
/* Table of Contents Styles */
336
.toc {

assets/css/custom.css

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,26 @@ body {
2222
border-radius: 0.3rem;
2323
border: 1px solid rgba(255, 255, 255, 0.3);
2424
transition: all 0.2s ease;
25+
/* 确保按钮不受通用 .btn 样式影响 */
26+
transform: none !important;
27+
box-shadow: none;
2528
}
2629

2730
.btn-lang:hover {
2831
background-color: rgba(255, 255, 255, 0.3);
2932
border-color: rgba(255, 255, 255, 0.5);
3033
text-decoration: none;
3134
color: white;
35+
/* 禁用悬浮时的变形效果 */
36+
transform: none !important;
37+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
3238
}
3339

3440
.btn-lang.active {
3541
background-color: rgba(255, 255, 255, 0.9);
3642
color: #333;
3743
border-color: rgba(255, 255, 255, 0.9);
44+
transform: none !important;
3845
}
3946

4047
/* Enhanced Header */
@@ -54,12 +61,12 @@ body {
5461
opacity: 0.9;
5562
}
5663

57-
/* Enhanced Buttons */
58-
.btn {
64+
/* Enhanced Buttons - 只影响GitHub按钮,不影响语言切换按钮 */
65+
.btn:not(.btn-lang) {
5966
transition: all 0.3s ease;
6067
}
6168

62-
.btn:hover {
69+
.btn:not(.btn-lang):hover {
6370
transform: translateY(-2px);
6471
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
6572
}

0 commit comments

Comments
 (0)