rockcampbell.com/static/css/custom.css
Rock Campbell 59d0be321e Fix dropdown hover gap: add pseudo-element bridge
A 4px gap between the nav item and dropdown panel was breaking the hover
state as the mouse crossed it. Added an invisible ::after bridge element
to maintain continuous hover coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 18:17:55 +00:00

103 lines
2.2 KiB
CSS

/* ── Explore dropdown nav ── */
/* Wrapper li needs relative positioning for the dropdown panel */
.nav-has-dropdown {
position: relative;
}
/* Invisible bridge pseudo-element fills the gap between the nav link and the
dropdown panel so the hover state isn't broken when moving the mouse down */
.nav-has-dropdown::after {
content: '';
position: absolute;
top: 100%;
left: -8px;
right: -8px;
height: 12px;
}
/* Show the dropdown on hover (desktop) and when focus is inside (keyboard/touch) */
.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown:focus-within .nav-dropdown {
display: block;
}
/* Dropdown panel */
.nav-dropdown {
display: none;
position: absolute;
top: calc(100% + 8px);
right: 0;
min-width: 180px;
list-style: none;
margin: 0;
padding: 6px 0;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: 4px;
box-shadow: 0 4px 16px rgba(44, 36, 22, 0.10);
z-index: 200;
}
.nav-dropdown li {
display: block;
}
.nav-dropdown a {
display: block;
padding: 7px 16px;
font-size: 15px;
color: var(--color-secondary);
white-space: nowrap;
text-decoration: none;
transition: background 100ms ease, color 100ms ease;
}
.nav-dropdown a:hover {
background: var(--color-neutral);
color: var(--color-primary);
}
/* Subtle arrow nudge so it's clear it's a dropdown trigger */
.nav-arrow {
font-size: 11px;
opacity: 0.6;
vertical-align: middle;
}
/* ── Homepage post list improvements ── */
/* Slightly more breathing room between entries */
.post-list__entry {
padding-bottom: 1.4rem;
margin-bottom: 1.4rem;
}
/* Description/excerpt text under each post title */
.post-list__excerpt {
margin-top: 0.3rem;
font-size: 0.9rem;
color: var(--color-secondary);
line-height: 1.55;
}
/* Pagination controls at bottom of homepage */
.post-list-pagination {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 1.5rem;
border-top: 1px solid var(--color-border);
font-size: 0.875rem;
color: var(--color-tertiary);
}
.post-list-pagination a {
color: var(--color-accent);
text-decoration: none;
font-weight: 500;
}
.post-list-pagination a:hover {
text-decoration: underline;
}