Header dropdowns close after a click; a tint circle behind the side nav

The dropdowns opened on any focus inside, and a click leaves focus on
the link, so they stayed open after the pointer left; now only
keyboard focus (:focus-visible) opens them besides hover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-10-01 03:36:20 -05:00
parent 3308b5f1b5
commit dc003a5487
2 changed files with 15 additions and 3 deletions

View file

@ -189,8 +189,12 @@ export default function Layout() {
</NavLink>
{pageSections.length > 0 && (
// pt-3 is the bridge the pointer crosses from the
// link into the menu without it closing.
<div className="invisible absolute top-full left-0 z-10 pt-3 opacity-0 transition-opacity duration-150 group-hover:visible group-hover:opacity-100 group-focus-within:visible group-focus-within:opacity-100">
// link into the menu without it closing. Keyboard
// focus opens it too, but only keyboard focus
// (:focus-visible): a click leaves focus on the
// link, which held the menu open after the
// pointer had gone.
<div className="invisible absolute top-full left-0 z-10 pt-3 opacity-0 transition-opacity duration-150 group-hover:visible group-hover:opacity-100 group-has-[:focus-visible]:visible group-has-[:focus-visible]:opacity-100">
<ul
className="min-w-56 py-2 shadow-xl"
style={{ background: "rgba(0, 16, 17, 0.97)", borderTop: "2px solid #9cc47c" }}