Floating sidebar

merged…
osebo42d ago

On desktop, can we make the sidebar float with a subtle background color with no outline?

2 repliesoldestnewest
Osebotfable-5-142d ago

Plan: change only the @media (min-width: 901px) sidebar block in threadide/app/globals.css.

  • Inset the sidebar from the viewport (12px margin all round, height: calc(100vh - 24px), sticky top: 12px) so it floats as a panel instead of running edge to edge.
  • Give it a subtle fill (var(--paper), the ink at 5% in light / white at 4% in dark) with --radius-lg corners.
  • Drop the border-right hairline: no outline. Links and the user menu keep their existing inset.
  • Trim main's left padding slightly so the gutter between panel and content doesn't double up.

Top bar (561–900px) and phone ☰ modes are untouched. I'll verify with a static mockup linking the real globals.css at 1200px, light + dark, and attach screenshots.

Osebotfable-5-142d agothreadide@34189c0

Done, pushed to thread/b23d4af9 (commit 34189c0), one file: threadide/app/globals.css.

What changed (only the @media (min-width: 901px) sidebar block):

  • header.top is inset 12px from the viewport on every side via a local --sidebar-gap (sticky top: 12px, height: calc(100vh - 24px), margin on top/left/bottom).
  • Fill is var(--paper) (ink at 5% in light, white at 4% in dark), so no new tokens and dark mode just works.
  • border: 0 drops the old right-edge hairline; border-radius: var(--radius-lg) rounds the panel. No shadow.
  • The hairline above the user menu stays: it's an inner divider, not an outline. The top-bar (561–900px) and phone modes are untouched.

Not changed: main's padding. I'd floated trimming it in the plan but the content column sits fine as is, and leaving it means nothing else on the page moves.

Screenshots attached: after (light + dark) and before, from a static mockup that links the real globals.css, since the app can't run in the sandbox. scroll-to-latest.tsx still sees the sidebar as "beside main" so deep links scroll as before.

If you'd like the panel inset more (16px) or a slightly stronger fill (--fill-hover, 10%), that's a one-line tweak to --sidebar-gap / background in that rule.

Floating sidebar at 1200px, light: 12px inset, --paper fill, rounded corners, no hairline edge
Floating sidebar at 1200px, light: 12px inset, --paper fill, rounded corners, no hairline edge
Same at 1200px in dark mode (white at 4% fill)
Same at 1200px in dark mode (white at 4% fill)
Before (main): edge-to-edge sidebar with a right hairline and no fill
Before (main): edge-to-edge sidebar with a right hairline and no fill
Diff · 1 files
diff --git a/threadide/app/globals.css b/threadide/app/globals.css
--- a/threadide/app/globals.css
+++ b/threadide/app/globals.css
@@ -380,16 +380,19 @@
-/* ---- ≥901px: the header is a sticky, full-height left sidebar (owner's request; the top bar stays for narrower
-   widths). Same markup: workspace dropdown / wordmark at the top, links stacked with the 4px nav-dot marking the
-   current page, theme switcher under them, user pinned to the bottom above a hairline. A hairline on the right
-   edge separates it from the page — no fill, no shadow, like vals' edge boxes. ---- */
+/* ---- ≥901px: the header is a sticky left sidebar (owner's request; the top bar stays for narrower widths).
+   Same markup: workspace dropdown / wordmark at the top, links stacked with the 4px nav-dot marking the current
+   page, theme switcher under them, user pinned to the bottom above a hairline. The sidebar FLOATS as a panel
+   (thread/b23d4af9): inset from the viewport by --sidebar-gap on every side, a subtle --paper fill, --radius-lg
+   corners, and no outline at all (no hairline edge, no shadow). The fill alone separates it from the page. ---- */
 @media (min-width: 901px) {
   body { display: flex; align-items: flex-start; min-height: 100vh; }
   header.top {
-    position: sticky; top: 0; flex: 0 0 var(--sidebar-w, 220px); width: var(--sidebar-w, 220px); height: 100vh;
+    --sidebar-gap: 12px;
+    position: sticky; top: var(--sidebar-gap); flex: 0 0 var(--sidebar-w, 220px); width: var(--sidebar-w, 220px);
+    height: calc(100vh - 2 * var(--sidebar-gap)); margin: var(--sidebar-gap) 0 var(--sidebar-gap) var(--sidebar-gap);
     flex-direction: column; align-items: stretch; gap: 0; padding: 18px 14px 16px;
-    border-bottom: 0; border-right: 1px solid var(--border); overflow-y: auto;
+    background: var(--paper); border: 0; border-radius: var(--radius-lg); overflow-y: auto;
   }