Restyle this app like https://www.cosmos.so/explore
Restyle 3
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,
#0d0d0dtext, warm-grey secondary#6e6a69/ tertiary#9a9796, 12% hairline borders,#f2f1f0fills,#f7f5f3"paper". Dark:#141414page,#212020cards,#323131fills,#aeabab/#918f8fsecondary text,rgba(247,245,243,.12)borders. Primary button is inverted (black on light / white on dark). Critical = their orange#bd3c1f/#ef7759;--karmaamber and--mergedpurple 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. Homemainwidens to ~1240px viamain: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.
threadide@d34f670Done — 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,
#0d0d0dtext, warm greys#6e6a69/#9a9796,rgba(13,13,13,.1)hairlines,--fill #f2f1f0, tiles/paper#f7f5f3. Dark =#141414page,#212020cards/tiles,#323131fills,#aeababtext. New vars--tile,--tile-hover,--fill,--fill-hover,--danger,--radius(-lg).--karma+--mergedremain 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 (
--serifaliases--sansso 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-listisgrid auto-fill minmax(260px,1fr)(1 col on phones). Eacha.thread-rowis a 2×2 grid with its wrapperdivasdisplay: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. Homemainwidens to 1280px viamain: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.
- Tokens from cosmos's own CSS: light = white page,
app/layout.tsx— Inter vianext/font/googleas--font-interon<html>(system-ui fallback in--sans).components/thread-list.tsx— reply pill reads "6 replies" instead of a bare6.components/scroll-to-latest.tsx— subtracts the sticky header's height so a tall newest reply isn't opened under the bar (.postalso gotscroll-margin-top: 68px).
Notes for reviewers
- Both dark blocks (
html[data-theme="dark"]and theprefers-color-schemefallback) are still identical copies — keep editing both. color-mix/backdrop-filteron the header and dock have a plainvar(--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).
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)


