Skip to content

Commit 5f39933

Browse files
authored
docs: fix navbar search position (#9599)
The search and theme widgets are not correctly aligned in smaller screens.
1 parent 8050824 commit 5f39933

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

src/components/Header/Header.astro

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ import ThemeToggleButton from './ThemeToggleButton';
9393
</HeaderLink>
9494
<HeaderLink href="https://status.mergify.com" icon={SiStatuspage}>Status</HeaderLink>
9595
</div>
96-
<Search />
97-
<ThemeToggleButton
98-
client:visible
99-
labels={{ useLight: 'Use light theme', useDark: 'Use dark theme' }}
100-
isInsideHeader={true}
101-
/>
96+
<div class="nav-actions">
97+
<Search />
98+
<ThemeToggleButton
99+
client:visible
100+
labels={{ useLight: 'Use light theme', useDark: 'Use dark theme' }}
101+
isInsideHeader={true}
102+
/>
103+
</div>
102104
</nav>
103105
</header>
104106

@@ -130,12 +132,39 @@ import ThemeToggleButton from './ThemeToggleButton';
130132
gap: 0.75rem;
131133
width: 100%;
132134
padding-inline: var(--min-spacing-inline);
135+
flex-wrap: wrap;
133136
}
134137

135138
.nav-buttons {
136139
display: flex;
137-
margin: 0 auto;
138140
gap: 0.5em;
141+
flex: 1 1 auto;
142+
justify-content: center;
143+
margin: 0;
144+
}
145+
146+
.nav-actions {
147+
margin-left: auto;
148+
display: flex;
149+
align-items: center;
150+
justify-content: flex-end;
151+
gap: 0.5rem;
152+
min-width: 0;
153+
flex: 0 0 auto;
154+
flex-wrap: nowrap;
155+
}
156+
157+
.nav-actions :global(.search-input) {
158+
margin-left: 0;
159+
flex-shrink: 0;
160+
}
161+
162+
@media (max-width: 35em) {
163+
.nav-actions {
164+
flex-basis: 100%;
165+
margin-left: 0;
166+
padding-top: 0.5rem;
167+
}
139168
}
140169

141170
/* If the device is likely to show a scrollbar gutter, reserve space for it */

src/components/Search/Search.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import SearchBar from './SearchBar';
3838
display: flex;
3939
place-items: center;
4040
gap: 0.25em;
41-
margin-left: auto;
4241
white-space: nowrap;
4342
border: 1px solid var(--theme-text-lighter);
4443
width: 5rem;

0 commit comments

Comments
 (0)