From 6e9b6e3e299e0722bb95cf750c368ee786c459b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Oct 2026 13:27:40 +0000 Subject: [PATCH] fix(ui): give dark-mode pages the header's gridded night band In dark mode the page ground (#111416, blue-grey) did not match the header's near-black band and its faint grid, so every page looked like a different surface from the navbar. - Dark --bg is now #0a0a0a, the header's --head-bg. - New --page-grid token (transparent in light, --head-grid in dark) drawn on body with the header's 3.5rem grid. - Body, header and dashboard hero grids are fixed to the window so the lines meet while the page scrolls. - Light mode is unchanged. - e2e: body and header share colour and grid in dark mode; differ in light. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BPCHu3hWdkxC3xHAxPegqx --- docs/HANDOFF.md | 35 ++++++++++++++++++++++++ src/app/(app)/layout.module.css | 3 +++ src/app/globals.css | 19 +++++++++++-- tests/e2e/app-nav.spec.ts | 47 +++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 2 deletions(-) diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 34b7a48..547bd96 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -4159,3 +4159,38 @@ rows", transactions 2 "show more" in steps of 20, plus a view-only list. there are digits on the lock screen, but never an amount. - The weekly recap and stale Nessie syncs are not on the tick yet. - Previews in the iOS lock screen were not tested with a real phone. + +## HO-116: Dark mode pages sit on the header's gridded night band + +- **Date:** 2026-10-11 (UTC) +- **Author:** Muhammad Tahub Khatri with Claude Code +- **Branch / PR:** `claude/confident-lamport-14r5fp` / PR linked from the branch + +### What changed +- In dark mode the page ground matched neither the header's colour nor + its grid: pages were blue-grey `#111416`, the header near-black + `#0a0a0a` with faint grid lines. +- `--bg` in dark mode is now `#0a0a0a`, the header's `--head-bg`. +- New `--page-grid` token: `transparent` in light mode, the header's + `--head-grid` in dark mode. `body` draws it with the header's 3.5rem + grid. +- The body, the sticky header (`src/app/(app)/layout.module.css`) and the + dashboard hero use `background-attachment: fixed`, so their grid lines + line up while the page scrolls. +- Light mode is unchanged: light grey pages under the dark header band. +- `tests/e2e/app-nav.spec.ts`: dark mode, body and header have the same + background colour, grid, size and attachment; light mode, they differ. + +### Verified +- `pnpm build` passes. Earlier in the session, `app-nav`, `bills`, + `budgets`, `recurring`, `calendar` and `accounts` e2e specs passed + locally. Muhammad will run the e2e suite himself from here. + +### What's next +- Decide whether light mode should also take the dark ground. +- The committed screenshots in `docs/screenshots/` still show the old dark + ground; they regenerate the next time their specs run. + +### Open problems +- iOS Safari ignores `background-attachment: fixed`, so there the grid + scrolls with the page and may not line up exactly with the header. diff --git a/src/app/(app)/layout.module.css b/src/app/(app)/layout.module.css index 2d90eeb..d9f5dbc 100644 --- a/src/app/(app)/layout.module.css +++ b/src/app/(app)/layout.module.css @@ -23,6 +23,9 @@ transparent 1px ); background-size: 3.5rem 3.5rem; + /* Fixed to the window, like the page's grid in globals.css, so the lines + meet where the header ends. */ + background-attachment: fixed; color: var(--head-ink, #f5f5f5); } diff --git a/src/app/globals.css b/src/app/globals.css index f2307ab..1f2eb44 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -31,6 +31,10 @@ --head-grid: rgb(255 255 255 / 0.035); --head-in: #6bd49a; + /* Lines on the page ground. None in light mode; in dark mode the ground + is the header's night band, grid and all, so the two read as one. */ + --page-grid: transparent; + /* Figures that should line up like a statement. */ --font-num: var(--font-mono), ui-monospace, Menlo, monospace; @@ -51,7 +55,8 @@ @media (prefers-color-scheme: dark) { :root { - --bg: #111416; + /* The header's night (--head-bg below), so pages and header match. */ + --bg: #0a0a0a; --surface: #181c1f; --surface-soft: #15181b; --ink: #ededed; @@ -64,6 +69,7 @@ --sub: #9da8f2; --head-bg: #0a0a0a; --head-tint: #22272b; + --page-grid: var(--head-grid); --sample-bg: #3a2b12; --sample-ink: #f1cf91; @@ -129,8 +135,16 @@ html { scroll-padding-top: 8rem; } +/* The grid is fixed to the window, like the sticky header's and the + dashboard hero's, so its lines run on unbroken from the header into the + page while it scrolls. */ body { - background: var(--bg); + background-color: var(--bg); + background-image: + linear-gradient(var(--page-grid) 1px, transparent 1px), + linear-gradient(90deg, var(--page-grid) 1px, transparent 1px); + background-size: 3.5rem 3.5rem; + background-attachment: fixed; color: var(--ink); font-family: var(--font-body), system-ui, sans-serif; line-height: 1.5; @@ -205,6 +219,7 @@ strong { linear-gradient(var(--head-grid) 1px, transparent 1px), linear-gradient(90deg, var(--head-grid) 1px, transparent 1px); background-size: 3.5rem 3.5rem; + background-attachment: fixed; color: var(--head-ink); } diff --git a/tests/e2e/app-nav.spec.ts b/tests/e2e/app-nav.spec.ts index 93c1fb2..97e869a 100644 --- a/tests/e2e/app-nav.spec.ts +++ b/tests/e2e/app-nav.spec.ts @@ -51,6 +51,53 @@ test.describe("signed in", () => { await expect(page.getByRole("heading", { level: 1 })).toBeVisible(); }); + test("in dark mode every page sits on the header's gridded night band", async ({ + page, + }) => { + await page.emulateMedia({ colorScheme: "dark" }); + await page.goto("/accounts"); + await expect(page.getByRole("heading", { level: 1 })).toHaveText( + "Accounts", + ); + + const grounds = await page.evaluate(() => { + const ground = (el: Element) => { + const style = getComputedStyle(el); + return { + color: style.backgroundColor, + grid: style.backgroundImage, + size: style.backgroundSize, + attachment: style.backgroundAttachment, + }; + }; + return { + header: ground(document.querySelector("header")!), + body: ground(document.body), + }; + }); + + expect(grounds.body).toEqual(grounds.header); + expect(grounds.body.grid).toContain("linear-gradient"); + }); + + test("in light mode pages keep their light ground under the dark header", async ({ + page, + }) => { + await page.emulateMedia({ colorScheme: "light" }); + await page.goto("/accounts"); + await expect(page.getByRole("heading", { level: 1 })).toHaveText( + "Accounts", + ); + + const [header, body] = await page.evaluate(() => + [document.querySelector("header")!, document.body].map( + (el) => getComputedStyle(el).backgroundColor, + ), + ); + + expect(body).not.toBe(header); + }); + test("every page shows who is signed in and offers sign out", async ({ page, }) => {