Skip to content

Commit 3fc6186

Browse files
committed
fix: 英文/日文等语言下导航栏不自适应、出现错位
1 parent 1cbf17d commit 3fc6186

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ onUnmounted(() => {
225225
<img src="/RushDB.png" alt="RushDB Logo" class="nav-logo-img" />
226226
<span>&ensp;RushDB</span>
227227
</a>
228-
<div style="display: flex; align-items: center; gap: 2rem">
228+
<div class="nav-actions">
229229
<button class="nav-toggle" type="button" :aria-label="t('nav.openMenu')" @click="toggleNavMenu">
230230
<span class="nav-toggle-bars" aria-hidden="true"></span>
231231
</button>

src/styles/site.css

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@
9999
align-items: center;
100100
}
101101

102+
.nav-actions {
103+
display: flex;
104+
align-items: center;
105+
gap: 2rem;
106+
min-width: 0;
107+
}
108+
102109
.nav-logo {
103110
display: flex;
104111
align-items: center;
@@ -129,9 +136,18 @@
129136
display: flex;
130137
gap: 2rem;
131138
list-style: none;
139+
align-items: center;
140+
min-width: 0;
141+
}
142+
143+
.nav-links li {
144+
display: flex;
132145
}
133146

134147
.nav-links a {
148+
display: inline-flex;
149+
align-items: center;
150+
white-space: nowrap;
135151
text-decoration: none;
136152
color: var(--text-secondary);
137153
font-weight: 500;
@@ -158,6 +174,16 @@
158174
width: 100%;
159175
}
160176

177+
@media (max-width: 1024px) {
178+
.nav-actions {
179+
gap: 1rem;
180+
}
181+
182+
.nav-links {
183+
gap: 1.25rem;
184+
}
185+
}
186+
161187
.container {
162188
max-width: 1200px;
163189
margin: 0 auto;
@@ -1688,8 +1714,11 @@
16881714
.language-trigger {
16891715
display: inline-flex;
16901716
align-items: center;
1717+
justify-content: space-between;
16911718
gap: 8px;
16921719
padding: 8px 12px;
1720+
min-width: 118px;
1721+
white-space: nowrap;
16931722
background: rgba(255, 255, 255, 0.05);
16941723
border: 1px solid rgba(255, 255, 255, 0.1);
16951724
border-radius: 8px;
@@ -2031,7 +2060,7 @@
20312060
transform: translateY(0) rotate(-45deg);
20322061
}
20332062

2034-
@media (max-width: 768px) {
2063+
@media (max-width: 980px) {
20352064
.nav-toggle {
20362065
display: inline-flex;
20372066
}

0 commit comments

Comments
 (0)