Skip to content

Commit 1209cd4

Browse files
markdumayclaude
andcommitted
fix(components): restrict first nav item padding to expanded navbar state
Only apply the double padding between brand logo/search bar and the first nav item when the navbar is fully expanded. This prevents unwanted padding when the navbar is in a collapsed state on small devices, even when toggled open via hamburger menu. Uses :not(.show, .collapsing) selector to target the expanded state while explicitly removing padding when navbar is toggled to show state. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <[email protected]>
1 parent 66f5fdd commit 1209cd4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

assets/scss/components/_navbar.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,17 @@
193193
white-space: nowrap;
194194
}
195195

196-
.navbar .nav-item:first-of-type {
196+
.navbar-collapse:not(.show, .collapsing) .nav-item:first-of-type {
197197
// double padding between brand logo / search bar and first nav item
198+
// only apply when navbar is fully expanded (not toggled to show)
198199
padding-left: var(--bs-navbar-nav-link-padding-x);
199200
}
200201

202+
// Remove padding when navbar is toggled open on small devices
203+
.navbar-collapse.show .nav-item:first-of-type {
204+
padding-left: 0;
205+
}
206+
201207
.navbar-collapse .dropdown {
202208
display: inline;
203209
align-items: normal;

0 commit comments

Comments
 (0)