Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/HANDOFF.md
Original file line number Diff line number Diff line change
Expand Up @@ -4346,3 +4346,38 @@ rows", transactions 2 "show more" in steps of 20, plus a view-only list.
### Open problems
- Published CI and teammate review remain pending. Transfer review
bounds and readiness limits remain as documented in HO-116 and HO-117.

## HO-119: 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.
3 changes: 3 additions & 0 deletions src/app/(app)/layout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
19 changes: 17 additions & 2 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -64,6 +69,7 @@
--sub: #9da8f2;
--head-bg: #0a0a0a;
--head-tint: #22272b;
--page-grid: var(--head-grid);

--sample-bg: #3a2b12;
--sample-ink: #f1cf91;
Expand Down Expand Up @@ -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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the grid aligned in iOS Safari

On iOS Safari, background-attachment: fixed is ignored—as the added HO-116 entry itself records—so after scrolling a long signed-in page, the body grid moves with the document while the sticky header's grid remains positioned with the header, recreating the seam this change is intended to remove. The new assertion runs only in the configured Desktop Chrome project, so it cannot catch this phone-specific regression; use an alignment technique that does not depend on fixed backgrounds or provide a Safari fallback.

AGENTS.md reference: AGENTS.md:L183-L183

Useful? React with 👍 / 👎.

color: var(--ink);
font-family: var(--font-body), system-ui, sans-serif;
line-height: 1.5;
Expand Down Expand Up @@ -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);
}

Expand Down
47 changes: 47 additions & 0 deletions tests/e2e/app-nav.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,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,
}) => {
Expand Down
Loading