Close button

merged…
osebo50d ago

The close button in the top left is currently a gray square

IMG_8364.jpeg
IMG_8364.jpeg
2 repliesoldestnewest
Osebotfable-5-150d ago

Diagnosis (from the screenshot + app/globals.css):

  1. The ☰/× toggle turns into a grey square because the generic button:hover:not(:disabled) { background: var(--accent-dark); opacity: .8 } (specificity 0,2,1) beats .nav-toggle:hover { background: rgba(128,128,128,.18) } (0,2,0). In dark mode --accent-dark is #fff, so the hovered toggle paints a white square at 80% → grey, and the white × bars disappear on it. iOS Safari keeps :hover applied after a tap, which is why it shows exactly while the menu is open.
  2. The 1px white line under "Threads" in the panel is the desktop .nav-links a[aria-current="page"] { border-bottom: 2px solid } rule outranking the phone .nav-links a { border-bottom: 0 }.

Plan: scope the toggle's hover/focus rule with enough specificity to win (button.nav-toggle:hover:not(:disabled) etc.), reset opacity, only apply the hover tint under @media (hover: hover) so touch taps don't leave it stuck, and add border-bottom: 0 to the phone aria-current rule. CSS-only change; I'll verify with a static dark-mode mockup screenshot.

Osebotfable-5-150d agothreadide@e77aaf7

Fixed and pushed to thread/6cd8ec41 (threadide @ e77aaf7). CSS-only change in app/globals.css.

What was wrong

  • The grey square is the ☰/× menu toggle in its hover state. The generic button:hover:not(:disabled) { background: var(--accent-dark); opacity: .8 } rule has specificity (0,2,1) and outranked .nav-toggle:hover (0,2,0), so the toggle got --accent-dark — #fff in dark mode — at 80% → grey, and the white × bars were drawn on top of it, invisible. iOS Safari keeps :hover applied after a tap, so it showed exactly while the menu was open.
  • Bonus: the 1px white line under "Threads" in the panel was the desktop .nav-links a[aria-current="page"] { border-bottom: 2px } underline leaking into the phone panel for the same specificity reason.

Fix

  • Toggle rules are now button.nav-toggle… so they beat the generic button rules; opacity: 1 reset; :hover/:active keep background: none.
  • The hover tint (rgba(128,128,128,.18)) only applies under @media (hover: hover), so touch taps can't leave it stuck. :focus-visible still gets the tint for keyboard users.
  • Phone aria-current rule gets border-bottom: 0.

Verification: static dark-mode mockup of the header (390px, menu open) with :hover forced via CDP to emulate iOS's sticky hover — before reproduces the screenshot exactly, after shows a clean ×. Screenshot attached. The app itself can't run in the sandbox (needs Postgres + GitHub OAuth).

Open a PR from https://github.com/osebo/threadide/pull/new/thread/6cd8ec41 if you want it merged.

Phone header, dark mode, menu open with the toggle in the sticky-hover state iOS leaves after a tap: before (grey square) vs after (×)
Phone header, dark mode, menu open with the toggle in the sticky-hover state iOS leaves after a tap: before (grey square) vs after (×)
Diff · 1 files
--- a/threadide/app/globals.css
+++ b/threadide/app/globals.css
@@ -149,10 +149,13 @@
   /* Phone: ☰ button sits left of the title; the links become a panel pinned under the header. */
   .site-nav { display: block; }
-  .nav-toggle {
+  /* `button.nav-toggle` (not `.nav-toggle`) so these outrank the generic `button` / `button:hover:not(:disabled)`
+     rules below: otherwise hover paints var(--accent-dark) at opacity .8 — a grey square on which the white ×
+     is invisible — and iOS keeps :hover stuck after a tap, so it showed whenever the menu was open. */
+  button.nav-toggle {
     display: inline-flex; align-items: center; justify-content: center;
     width: 36px; height: 36px; padding: 0; margin-left: -6px;
-    background: none; color: var(--text); line-height: 0; border-radius: 3px;
+    background: none; color: var(--text); line-height: 0; border-radius: 3px; opacity: 1;
   }
@@ -164,7 +167,10 @@
   .nav-toggle[aria-expanded="true"] .nav-icon::after { bottom: 6px; transform: rotate(-45deg); }
-  .nav-toggle:hover, .nav-toggle:focus-visible { background: rgba(128,128,128,.18); }
+  button.nav-toggle:hover:not(:disabled), button.nav-toggle:active { background: none; opacity: 1; }
+  button.nav-toggle:focus-visible { background: rgba(128,128,128,.18); outline: none; }
+  /* Hover tint only where a real pointer exists; on touch screens :hover would stick after the tap. */
+  @media (hover: hover) { button.nav-toggle:hover:not(:disabled) { background: rgba(128,128,128,.18); } }
@@ -176 +182 @@
-  .nav-links a[aria-current="page"] { font-weight: 600; color: var(--accent-dark); }
+  .nav-links a[aria-current="page"] { font-weight: 600; color: var(--accent-dark); border-bottom: 0; } /* desktop underline must not leak into the panel */