Restyle 3

ready…
osebo49d ago

Restyle this app like https://www.cosmos.so/explore

2 repliesoldestnewest
Osebotfable-5-149d ago

Plan: retheme after cosmos.so/explore (branch thread/2a82ae16, mostly app/globals.css)

I pulled cosmos.so's shipped CSS to use their real tokens rather than eyeballing:

  • Palette — light: white page, #0d0d0d text, warm-grey secondary #6e6a69 / tertiary #9a9796, 12% hairline borders, #f2f1f0 fills, #f7f5f3 "paper". Dark: #141414 page, #212020 cards, #323131 fills, #aeabab / #918f8f secondary text, rgba(247,245,243,.12) borders. Primary button is inverted (black on light / white on dark). Critical = their orange #bd3c1f / #ef7759; --karma amber and --merged purple stay as the only status colours.
  • Type — grotesk (Inter via next/font, system-ui fallback, replacing the LessWrong serif everywhere), 14px body, headings 500 weight with −0.02em tracking, sentence-case buttons (no more uppercase chrome).
  • Shape — pill buttons / inputs / selects / segmented controls (fill, no border), 8–12px radius on cards, no shadows.
  • Header — cosmos-style 56px sticky top bar on every width (wordmark/workspace left, nav as pill links, user right), with blur. This drops the ≥901px left sidebar; the ≤560px ☰ panel stays.
  • Home — the explore grid: thread list becomes a responsive card grid (auto-fill, minmax(260px,1fr)), single column on phones; title clamps to 3 lines, meta row at the card foot, reply count as a pill. Home main widens to ~1240px via main:has(.thread-filters); thread/workspace pages keep a readable ~760px.
  • Thread page — borderless/hairline post cards, agent posts on the "paper" tint, floating blurred compose dock.

All structural behaviour (☰ panel, CSS hamburger, line-clamps, overflow guards, theme-toggle selectors, generic-button specificity rules) is carried over. Both dark blocks stay identical. Screenshots (home grid + thread page, light & dark, phone + desktop) to follow via static mockups against the real stylesheet.

Osebotfable-5-149d agothreadide@d34f670

Done — cosmos.so/explore retheme is on thread/2a82ae16 (d34f670), pushed, tsc + next build clean. Screenshots attached (static mockups against the real app/globals.css, light + dark, 1280px + 390px) — the app can't run in the sandbox, so please eyeball the preview deploy once.

What changed (4 files)

  • app/globals.css — full rewrite of the theme layer; every selector/behaviour from before is kept.
    • Tokens from cosmos's own CSS: light = white page, #0d0d0d text, warm greys #6e6a69/#9a9796, rgba(13,13,13,.1) hairlines, --fill #f2f1f0, tiles/paper #f7f5f3. Dark = #141414 page, #212020 cards/tiles, #323131 fills, #aeabab text. New vars --tile, --tile-hover, --fill, --fill-hover, --danger, --radius(-lg). --karma + --merged remain the only status colours; red is now cosmos's orange --danger.
    • Type: Inter (see layout), 14px body, 500-weight headings at −0.02em. Serif and uppercase chrome are gone (--serif aliases --sans so nothing breaks).
    • Shape: every control is a 999px pill (buttons, search, selects, segments, theme toggle, badges, repo chips, PR links); cards 12px radius; no shadows.
    • Header: 56px sticky, blurred top bar on every width >560px — the ≥901px sidebar is removed. Nav links are pills; current page = filled. ≤560px ☰ panel unchanged.
    • Home = the explore grid: .card.thread-list is grid auto-fill minmax(260px,1fr) (1 col on phones). Each a.thread-row is a 2×2 grid with its wrapper div as display:contents: title (3-line clamp) on top; status · author · age on the bottom-left with "workspace · repos" on its own ellipsised line; "N replies" pill bottom-right. Home main widens to 1280px via main:has(.thread-filters); other pages stay at 760px.
    • Thread page: hairline post cards, agent posts on the paper tint (dark: page colour + hairline so they read as "other"), code/sha chips, floating blurred compose dock.
  • app/layout.tsx — Inter via next/font/google as --font-inter on <html> (system-ui fallback in --sans).
  • components/thread-list.tsx — reply pill reads "6 replies" instead of a bare 6.
  • components/scroll-to-latest.tsx — subtracts the sticky header's height so a tall newest reply isn't opened under the bar (.post also got scroll-margin-top: 68px).

Notes for reviewers

  • Both dark blocks (html[data-theme="dark"] and the prefers-color-scheme fallback) are still identical copies — keep editing both.
  • color-mix/backdrop-filter on the header and dock have a plain var(--bg) fallback first.
  • This supersedes the sidebar decisions (sidebar-nav-desktop, sidebar-current-link-marker) if merged; I've saved memory notes for the new palette, the tile grid and the top bar.
  • Not opened as a PR — say the word and I will (GitHub offered osebo/threadide/pull/new/thread/2a82ae16).
Home (light, 1280px): cosmos-style tile grid, pill controls, 56px blurred top bar
Home (light, 1280px): cosmos-style tile grid, pill controls, 56px blurred top bar
Home (dark, 1280px): #141414 page, #212020 tiles, #323131 fills
Home (dark, 1280px): #141414 page, #212020 tiles, #323131 fills
Thread page (light, 1000px): hairline post cards, agent post on paper tint, floating compose dock
Thread page (light, 1000px): hairline post cards, agent post on paper tint, floating compose dock
Home on a 390px phone: single-column tiles, ☰ + workspace pill in the bar
Home on a 390px phone: single-column tiles, ☰ + workspace pill in the bar
Diff · 4 files
diff --git a/threadide/app/layout.tsx b/threadide/app/layout.tsx
@@ -1,5 +1,6 @@
 import type { Metadata } from "next";
 import Link from "next/link";
+import { Inter } from "next/font/google";
 import "./globals.css";
@@ -9,6 +10,10 @@
 import { SITE_NAME, TAGLINE, siteUrl } from "@/lib/site";
 
+/** The grotesk the whole UI is set in (cosmos.so uses a custom one; Inter is the closest open face).
+ *  Exposed as --font-inter, which globals.css puts first in --sans with a system-ui fallback. */
+const inter = Inter({ subsets: ["latin"], variable: "--font-inter", display: "swap" });
+
@@ -30,7 +35,7 @@
-    <html lang="en" suppressHydrationWarning>
+    <html lang="en" className={inter.variable} suppressHydrationWarning>
diff --git a/threadide/components/scroll-to-latest.tsx b/threadide/components/scroll-to-latest.tsx
@@ -17,13 +17,16 @@
     const dock = document.querySelector<HTMLElement>(".compose-dock");
     const dockHeight = dock?.getBoundingClientRect().height ?? 0;
+    // The site header is sticky (globals.css header.top), so the usable viewport starts below it.
+    const header = document.querySelector<HTMLElement>("header.top");
+    const headerHeight = header && getComputedStyle(header).position === "sticky" ? header.getBoundingClientRect().height : 0;
     const rect = el.getBoundingClientRect();
-    const visible = window.innerHeight - dockHeight;
+    const visible = window.innerHeight - dockHeight - headerHeight;
     const gap = 12;
     const top =
       rect.height + gap * 2 <= visible
-        ? window.scrollY + rect.bottom - visible + gap // fits: bottom of the post just above the dock
-        : window.scrollY + rect.top - gap; // too tall: start reading at its top
+        ? window.scrollY + rect.bottom - (window.innerHeight - dockHeight) + gap // fits: bottom of the post just above the dock
+        : window.scrollY + rect.top - headerHeight - gap; // too tall: start reading at its top, just under the header
diff --git a/threadide/components/thread-list.tsx b/threadide/components/thread-list.tsx
@@ -49,8 +50,8 @@
-            <span className="comment-count" title={`${n} ${n === 1 ? "reply" : "replies"}`}>
-              {n}
+            <span className="comment-count">
+              {n} {n === 1 ? "reply" : "replies"}
             </span>
diff --git a/threadide/app/globals.css b/threadide/app/globals.css
(541-line theme rewrite — see commit d34f670; summary in the post body)