From d2c941128324292e214c630412ae1d2837b9111d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Oct 2026 14:04:26 +0000 Subject: [PATCH] fix(ui): one page frame, one title, readable fields on every page A UI audit found pages that looked like different apps: - Dark greys were blue-grey next to the neutral header (left over from #45, which merged before that commit was pushed). - Pages used six widths, some centred, and Budgets had no side padding (text touched the screen edge on phones). - A bare h1 rule meant for the dashboard made Bills and Recurring titles 3rem while others were 2.5rem. - Input borders were about 1.3:1 against cards (WCAG 1.4.11 asks 3:1). - Focus rings came in three colours, buttons in five shapes, with no hover states; the selected Bills tab was 1.04:1. Tokens now carry the frame (--gutter, --page-top, --page-narrow/medium/ wide), field borders (--field-line) and corners (--radius-control, --radius-card). Pages are left-aligned under the header, share one title style, use the global focus ring, and every button has a hover state. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BPCHu3hWdkxC3xHAxPegqx --- docs/HANDOFF.md | 61 ++++++++++++++ src/app/(app)/layout.module.css | 4 +- .../w/[workspaceId]/settings/page.module.css | 14 +--- src/app/(auth)/layout.module.css | 2 +- src/app/globals.css | 76 +++++++++++++----- src/components/ui/app-nav.module.css | 6 ++ src/components/ui/page-loading.module.css | 2 +- src/components/ui/page-placeholder.module.css | 11 +-- src/features/accounts/ui/accounts.module.css | 33 ++++---- src/features/auth/ui/auth.module.css | 19 +++-- src/features/bills/ui/bills-page.tsx | 2 +- src/features/bills/ui/bills.module.css | 32 +++++--- src/features/budgets/ui/budgets.module.css | 30 +++---- .../ui/categorization.module.css | 25 ++++-- src/features/imports/ui/imports.module.css | 38 ++++----- src/features/insights/ui/insights.module.css | 24 ++---- .../ui/notifications-card.module.css | 9 +-- .../messaging/ui/phone-link-card.module.css | 13 ++- src/features/nessie/ui/nessie.module.css | 9 ++- src/features/recurring/ui/recurring-page.tsx | 2 +- .../recurring/ui/recurring.module.css | 19 +++-- .../transactions/ui/transactions.module.css | 39 ++++----- src/features/transfers/ui/review.module.css | 27 +++---- tests/e2e/app-nav.spec.ts | 80 +++++++++++++++++++ 24 files changed, 382 insertions(+), 195 deletions(-) diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 96e889e..0530026 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -4381,3 +4381,64 @@ rows", transactions 2 "show more" in steps of 20, plus a view-only list. ### 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. + +## HO-120: One page frame, one title, readable fields and the same controls on every page + +- **Date:** 2026-10-11 (UTC) +- **Author:** Muhammad Tahub Khatri with Claude Code +- **Branch / PR:** `fix/ui-page-frame` / PR linked from the branch + +### What changed +- A UI audit (four review agents plus the Web Interface Guidelines) found + pages that looked like different apps. This PR fixes the CSS-only part. +- **Dark greys** (left over from HO-119; PR #45 merged before this commit + was pushed): `--surface`, `--surface-soft`, `--line`, `--tint` and + `--ink-soft` are neutral, not blue-grey, and the dark `--head-tint` + override is gone. +- **Page frame:** new tokens `--gutter`, `--page-top`, `--page-narrow` + (48rem: Accounts, Transactions), `--page-medium` (60rem: Import, + Insights) and `--page-wide` (72rem: Bills, Recurring, Budgets, + Categorization, Transfers). Every page is left-aligned under the header + with the header's gutter. Budgets had no side padding at all (text + touched the screen edge on phones); Bills and Recurring were centred at + 86rem with a 1rem top. +- **Titles:** the bare `h1` rule (dashboard headline, 3rem) applied to + every page. It is now `.hero h1`; `main h1` is the shared page title + (2.5rem, 650). Seven copies of that rule in modules are gone. Budgets' + 1.4rem section heading uses the global h2. +- **Fields:** new `--field-line` (`#767676` light, `#707070` dark) for + every input and select border: 3:1 or better on every ground (WCAG + 1.4.11). `--line` was about 1.3:1. +- **Focus:** per-page focus rings (green on Bills, purple on Budgets and + Insights, a 3px offset on Transfers) are gone; the global ink ring + applies. The header's tab ring is drawn inside the tab, because the + sideways-scrolling row clipped it. +- **Controls:** `--radius-control` (8px) and `--radius-card` (12px) + replace 8px, 10px, 12px, 14px, 0.65rem, 0.4rem, 0.35rem and 0.3rem. + Buttons in Bills, Recurring, Budgets and Transfers use 0.5rem 1rem + padding like the rest. Every primary button lightens on hover and + outlined ones take the tint. The selected Bills tab is filled with ink + (it was 1.04:1 against the page). The settings switch lost a blue + literal shadow. +- `tests/e2e/app-nav.spec.ts`: every page has the header's gutter, the + same title size, no sideways scroll at 360 and 1440px; a field border is + 3:1 against its card in both themes; the dark greys are neutral. + +### Verified +- `pnpm lint`, `typecheck`, `format:check`, `docs:check` and `build` + pass. +- `pnpm test:unit`: 2702 pass; 8 fail only because this container has no + Neon `storage-tests` credentials (TEST-05), and `scripts/db/verify.test.ts` + timed out once in the full run and passes on its own. +- Playwright was not run (Muhammad runs it); the screenshots in + `docs/screenshots/` regenerate when their specs run. + +### What's next +- The same audit has two more PRs: accessibility fixes + (`fix/ui-a11y`) and confirmations and broken links + (`fix/ui-confirmations`). +- Buttons are still defined per feature; one shared button class needs TSX + changes in every feature and was left for later. + +### Open problems +- Not checked visually in a browser in this session. diff --git a/src/app/(app)/layout.module.css b/src/app/(app)/layout.module.css index d9f5dbc..6b9ca99 100644 --- a/src/app/(app)/layout.module.css +++ b/src/app/(app)/layout.module.css @@ -10,7 +10,7 @@ position: sticky; top: 0; z-index: 10; - padding: 0 clamp(1rem, 3vw, 3.5rem); + padding: 0 var(--gutter, clamp(1rem, 3vw, 3.5rem)); background-color: var(--head-bg, #161616); background-image: linear-gradient( @@ -99,7 +99,7 @@ } .loading { - padding: 2rem clamp(1rem, 3vw, 3.5rem); + padding: 2rem var(--gutter); color: var(--ink-soft); } diff --git a/src/app/(app)/w/[workspaceId]/settings/page.module.css b/src/app/(app)/w/[workspaceId]/settings/page.module.css index 7f77bbe..0860b5f 100644 --- a/src/app/(app)/w/[workspaceId]/settings/page.module.css +++ b/src/app/(app)/w/[workspaceId]/settings/page.module.css @@ -1,20 +1,12 @@ /* Uses the tokens in src/app/globals.css (ADR-046). */ -/* A flex column, not a grid: globals.css gives every h1 a grid area for the - dashboard hero, which would pull this heading out of order in a grid. */ +/* The title comes from `main h1` in src/app/globals.css. */ .page { display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; - padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 3.5rem) 3rem; -} - -.page h1 { - font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); - font-weight: 650; - letter-spacing: -0.03em; - line-height: 1.1; + padding: var(--page-top) var(--gutter) 3rem; } /* Sections fill the column up to their own maximum width. */ @@ -25,7 +17,7 @@ .note { padding: 0.75rem 1rem; border: 1px dashed var(--line); - border-radius: 8px; + border-radius: var(--radius-control); color: var(--ink-soft); font-size: 0.875rem; } diff --git a/src/app/(auth)/layout.module.css b/src/app/(auth)/layout.module.css index c3e06b1..77298f4 100644 --- a/src/app/(auth)/layout.module.css +++ b/src/app/(auth)/layout.module.css @@ -2,7 +2,7 @@ display: flex; flex-direction: column; min-height: 100vh; - padding: 1rem clamp(1rem, 3vw, 3.5rem) 3rem; + padding: 1rem var(--gutter) 3rem; } .top { diff --git a/src/app/globals.css b/src/app/globals.css index 1f2eb44..955e699 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -15,6 +15,9 @@ --ink: #171717; --ink-soft: #474747; --line: #cfcfcf; + /* Input and select borders: 3:1 or more on every ground (WCAG 1.4.11). + --line stays for dividers and card edges. */ + --field-line: #767676; --tint: #e8e8e8; --bar: #7d858b; --in: #17734c; @@ -38,6 +41,19 @@ /* Figures that should line up like a statement. */ --font-num: var(--font-mono), ui-monospace, Menlo, monospace; + /* One page frame for every signed-in page: the side gutter matches the + header's, the top padding is shared, and pages are left-aligned under + the wordmark. Lists and forms read best narrow; card grids go wide. */ + --gutter: clamp(1rem, 3vw, 3.5rem); + --page-top: clamp(1.5rem, 3vw, 2.5rem); + --page-narrow: 48rem; + --page-medium: 60rem; + --page-wide: 72rem; + + /* Corners: controls, then cards and panels. */ + --radius-control: 8px; + --radius-card: 12px; + /* "Sample" label (ADR-024) and Insights' slight comparison tints (ADR-056). Tints sit behind ink text: the words carry the meaning. */ --sample-bg: #fbefd9; @@ -57,18 +73,19 @@ :root { /* The header's night (--head-bg below), so pages and header match. */ --bg: #0a0a0a; - --surface: #181c1f; - --surface-soft: #15181b; + /* Neutral greys, like the header and the light theme: no blue cast. */ + --surface: #171717; + --surface-soft: #131313; --ink: #ededed; - --ink-soft: #a3a9ae; - --line: #2a2f33; - --tint: #22272b; + --ink-soft: #a3a3a3; + --line: #2e2e2e; + --field-line: #707070; + --tint: #242424; --bar: #7d858b; --in: #6bd49a; --bill: #e0a84a; --sub: #9da8f2; --head-bg: #0a0a0a; - --head-tint: #22272b; --page-grid: var(--head-grid); --sample-bg: #3a2b12; @@ -164,7 +181,7 @@ select { } .page { - padding: 1rem clamp(1rem, 3vw, 3.5rem) 3rem; + padding: 1rem var(--gutter) 3rem; } h2 { @@ -212,8 +229,8 @@ strong { gap: 0.5rem 3rem; /* Style B: the headline continues the header's night band, edge to edge (the negative margins undo .page's padding). */ - margin: -1rem calc(-1 * clamp(1rem, 3vw, 3.5rem)) 1.5rem; - padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 3.5rem); + margin: -1rem calc(-1 * var(--gutter)) 1.5rem; + padding: var(--page-top) var(--gutter); background-color: var(--head-bg); background-image: linear-gradient(var(--head-grid) 1px, transparent 1px), @@ -236,7 +253,17 @@ strong { outline-color: var(--head-ink); } -h1 { +/* Every page's title. The dashboard's headline is bigger (.hero h1). */ +main h1 { + font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); + font-weight: 650; + line-height: 1.1; + letter-spacing: -0.03em; + text-wrap: balance; + overflow-wrap: anywhere; +} + +.hero h1 { grid-area: headline; max-width: 22ch; font-size: clamp(1.75rem, 1.1rem + 2.2vw, 3rem); @@ -500,8 +527,8 @@ h1 { .go-day input { min-height: 2.125rem; padding: 0 0.5rem; - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); background: var(--surface); color: var(--ink); } @@ -541,7 +568,7 @@ h1 { gap: 1px; overflow: hidden; border: 1px solid var(--line); - border-radius: 10px; + border-radius: var(--radius-card); background: var(--line); } @@ -744,7 +771,7 @@ button.cell:hover, top: 1rem; padding: 1.25rem; border: 1px solid var(--line); - border-radius: 10px; + border-radius: var(--radius-card); background: var(--surface); } @@ -899,7 +926,7 @@ a.item-remove:hover { grid-template-columns: 1fr 1fr; margin: 0.75rem 0; padding: 0.1875rem; - border-radius: 8px; + border-radius: var(--radius-control); background: var(--tint); } @@ -920,7 +947,7 @@ a.item-remove:hover { .switch input:checked + span { background: var(--surface); font-weight: 600; - box-shadow: 0 1px 2px rgb(20 32 43 / 0.12); + box-shadow: 0 0 0 1px var(--line); } .switch input:focus-visible + span { @@ -944,8 +971,8 @@ a.item-remove:hover { .field select { width: 100%; padding: 0.5rem 0.625rem; - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); background: var(--surface); } @@ -988,7 +1015,7 @@ a.item-remove:hover { margin-top: 1rem; padding: 0.625rem; border: 0; - border-radius: 8px; + border-radius: var(--radius-control); background: var(--ink); color: var(--bg); font-weight: 600; @@ -1005,7 +1032,7 @@ a.item-remove:hover { padding: 0; overflow: hidden; border: 1px solid var(--line); - border-radius: 10px; + border-radius: var(--radius-card); list-style: none; background: var(--surface); } @@ -1075,7 +1102,7 @@ a.item-remove:hover { .agenda-empty { padding: 2rem 1rem; border: 1px dashed var(--line); - border-radius: 10px; + border-radius: var(--radius-card); color: var(--ink-soft); } @@ -1148,7 +1175,7 @@ a.item-remove:hover { .plan { padding: 0.375rem 0.75rem; border: 1px solid var(--ink-soft); - border-radius: 8px; + border-radius: var(--radius-control); background: none; cursor: pointer; font-size: 0.875rem; @@ -1257,3 +1284,8 @@ footer { transition: none !important; } } + +/* Hover: ink buttons lighten a little, outlined ones pick up the tint. */ +.primary:hover:not(:disabled) { + opacity: 0.88; +} diff --git a/src/components/ui/app-nav.module.css b/src/components/ui/app-nav.module.css index f1d9afb..c15dd42 100644 --- a/src/components/ui/app-nav.module.css +++ b/src/components/ui/app-nav.module.css @@ -26,6 +26,12 @@ color: var(--head-ink); } +/* The row scrolls sideways, which clips anything outside it: draw the + focus ring inside the tab so it is never cut off. */ +.link:focus-visible { + outline-offset: -2px; +} + .link[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--head-ink); color: var(--head-ink); diff --git a/src/components/ui/page-loading.module.css b/src/components/ui/page-loading.module.css index e036bab..6a305bb 100644 --- a/src/components/ui/page-loading.module.css +++ b/src/components/ui/page-loading.module.css @@ -1,6 +1,6 @@ /* Uses the tokens in src/app/globals.css (ADR-046). */ .loading { - padding: 2rem clamp(1rem, 3vw, 3.5rem); + padding: 2rem var(--gutter); color: var(--ink-soft); } diff --git a/src/components/ui/page-placeholder.module.css b/src/components/ui/page-placeholder.module.css index dd160cb..2f46147 100644 --- a/src/components/ui/page-placeholder.module.css +++ b/src/components/ui/page-placeholder.module.css @@ -1,14 +1,7 @@ /* Uses the tokens in src/app/globals.css (ADR-046). */ .page { - padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 3.5rem) 3rem; -} - -.page h1 { - font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); - font-weight: 650; - letter-spacing: -0.03em; - line-height: 1.1; + padding: var(--page-top) var(--gutter) 3rem; } .purpose { @@ -22,7 +15,7 @@ margin-top: 1.5rem; padding: 0.75rem 1rem; border: 1px dashed var(--line); - border-radius: 8px; + border-radius: var(--radius-control); color: var(--ink-soft); font-size: 0.875rem; } diff --git a/src/features/accounts/ui/accounts.module.css b/src/features/accounts/ui/accounts.module.css index 097ee34..8658f0f 100644 --- a/src/features/accounts/ui/accounts.module.css +++ b/src/features/accounts/ui/accounts.module.css @@ -2,8 +2,8 @@ (ADR-046), so it follows the light and dark themes. */ .page { - max-width: 48rem; - padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 3.5rem) 3rem; + max-width: var(--page-narrow); + padding: var(--page-top) var(--gutter) 3rem; } .heading { @@ -14,13 +14,6 @@ gap: 1rem; } -.page h1 { - font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); - font-weight: 650; - letter-spacing: -0.03em; - line-height: 1.1; -} - .lede { max-width: 52ch; margin-top: 0.5rem; @@ -32,7 +25,7 @@ margin-top: 1.5rem; padding: 1rem; border: 1px dashed var(--line); - border-radius: 8px; + border-radius: var(--radius-control); color: var(--ink-soft); } @@ -53,7 +46,7 @@ padding: 0; list-style: none; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } @@ -134,8 +127,8 @@ .field select { width: 100%; padding: 0.5rem 0.625rem; - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); background: var(--surface); color: var(--ink); } @@ -172,7 +165,7 @@ .danger { display: inline-block; padding: 0.5rem 1rem; - border-radius: 8px; + border-radius: var(--radius-control); font-weight: 600; text-decoration: none; cursor: pointer; @@ -212,6 +205,16 @@ .confirm { padding: 1rem; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } + +/* Hover: ink buttons lighten a little, outlined ones pick up the tint. */ +.primary:hover:not(:disabled) { + opacity: 0.88; +} + +.secondary:hover:not(:disabled), +.danger:hover:not(:disabled) { + background: var(--tint); +} diff --git a/src/features/auth/ui/auth.module.css b/src/features/auth/ui/auth.module.css index eb2184d..433221f 100644 --- a/src/features/auth/ui/auth.module.css +++ b/src/features/auth/ui/auth.module.css @@ -6,7 +6,7 @@ max-width: 26rem; padding: 1.75rem; border: 1px solid var(--line); - border-radius: 14px; + border-radius: var(--radius-card); background: var(--surface); } @@ -37,8 +37,8 @@ .field input { width: 100%; padding: 0.5rem 0.625rem; - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); background: var(--surface); } @@ -72,7 +72,7 @@ margin-top: 1.25rem; padding: 0.625rem; border: 0; - border-radius: 8px; + border-radius: var(--radius-control); background: var(--ink); color: var(--bg); font-weight: 600; @@ -135,7 +135,7 @@ margin-top: 1.25rem; padding: 0.625rem; border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-control); background: var(--surface); font-weight: 600; cursor: pointer; @@ -157,3 +157,12 @@ a.submit { text-align: center; text-decoration: none; } + +/* Hover: ink buttons lighten a little, outlined ones pick up the tint. */ +.submit:hover:not(:disabled) { + opacity: 0.88; +} + +.secondary:hover:not(:disabled) { + background: var(--tint); +} diff --git a/src/features/bills/ui/bills-page.tsx b/src/features/bills/ui/bills-page.tsx index 7b04237..0b78e60 100644 --- a/src/features/bills/ui/bills-page.tsx +++ b/src/features/bills/ui/bills-page.tsx @@ -439,7 +439,7 @@ export function BillsPage({ data }: { data: BillsView }) { c.dueOn <= shiftDays(data.today, 7), ).length; return ( -
+

Bills

diff --git a/src/features/bills/ui/bills.module.css b/src/features/bills/ui/bills.module.css index 72fd513..40ca526 100644 --- a/src/features/bills/ui/bills.module.css +++ b/src/features/bills/ui/bills.module.css @@ -1,6 +1,6 @@ .page { - max-width: 86rem; - margin-inline: auto; + max-width: var(--page-wide); + padding: var(--page-top) var(--gutter) 3rem; } .heading, .cardHead, @@ -30,7 +30,7 @@ .panel, .add { border: 1px solid var(--line); - border-radius: 0.65rem; + border-radius: var(--radius-card); padding: 1rem; background: var(--surface); min-width: 0; @@ -67,8 +67,15 @@ text-decoration: none; color: var(--ink); } -.tabs a[aria-current="page"] { +.tabs a:hover { background: var(--tint); +} +/* The selected tab is filled with ink, like the calendar's filter chips; + aria-current also says it in words. */ +.tabs a[aria-current="page"] { + border-color: var(--ink); + background: var(--ink); + color: var(--bg); font-weight: 650; } .filters, @@ -94,8 +101,8 @@ box-sizing: border-box; background: var(--surface-soft); color: var(--ink); - border: 1px solid var(--line); - border-radius: 0.4rem; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); padding: 0.6rem; font: inherit; width: 100%; @@ -112,15 +119,20 @@ .form button, .operation button, .filters button { - padding: 0.6rem 0.85rem; + padding: 0.5rem 1rem; border: 1px solid var(--line); - border-radius: 0.4rem; + border-radius: var(--radius-control); background: var(--tint); color: var(--ink); cursor: pointer; font: inherit; width: fit-content; } +.form button:hover:not(:disabled), +.operation button:hover:not(:disabled), +.filters button:hover:not(:disabled) { + border-color: var(--ink-soft); +} .form button:disabled, .operation button:disabled { opacity: 0.6; @@ -204,10 +216,6 @@ font-size: 1rem; margin-block: 1.5rem 0.75rem; } -.page :focus-visible { - outline: 2px solid var(--in); - outline-offset: 3px; -} .page p[role="alert"] { font-weight: 500; } diff --git a/src/features/budgets/ui/budgets.module.css b/src/features/budgets/ui/budgets.module.css index ec4c40c..70dcdcf 100644 --- a/src/features/budgets/ui/budgets.module.css +++ b/src/features/budgets/ui/budgets.module.css @@ -1,7 +1,6 @@ .page { - max-width: 1160px; - margin: 0 auto; - padding: 2rem 0 4rem; + max-width: var(--page-wide); + padding: var(--page-top) var(--gutter) 3rem; } .header { display: flex; @@ -12,11 +11,9 @@ } .page h1 { margin: 0 0 0.5rem; - font-size: clamp(2rem, 4vw, 3rem); } .page h2 { margin: 1.5rem 0 0.5rem; - font-size: 1.4rem; } .page h3 { margin: 0 0 1rem; @@ -45,30 +42,29 @@ .form input { background: var(--surface); color: var(--ink); - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); font: inherit; - padding: 0.7rem; + padding: 0.5rem 0.625rem; min-width: 0; } .page button { - padding: 0.7rem 1rem; + padding: 0.5rem 1rem; border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-control); background: var(--tint); color: var(--ink); cursor: pointer; font: inherit; min-height: 44px; } +.page button:hover:not(:disabled) { + border-color: var(--ink-soft); +} .page button:disabled { cursor: wait; opacity: 0.65; } -.page :is(a, button, input):focus-visible { - outline: 2px solid var(--sub); - outline-offset: 3px; -} .note { color: var(--ink-soft); font-size: 0.93rem; @@ -83,7 +79,7 @@ padding: 1rem; background: var(--surface); border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); display: grid; gap: 0.5rem; } @@ -101,7 +97,7 @@ .explanation { padding: 1rem 1.25rem; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); margin: 1rem 0; background: var(--surface-soft); } @@ -117,7 +113,7 @@ .card { padding: 1.25rem; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); min-width: 0; overflow-wrap: anywhere; diff --git a/src/features/categorization/ui/categorization.module.css b/src/features/categorization/ui/categorization.module.css index f551bcb..c56301a 100644 --- a/src/features/categorization/ui/categorization.module.css +++ b/src/features/categorization/ui/categorization.module.css @@ -1,6 +1,6 @@ .page { - max-width: 72rem; - padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 3.5rem) 3rem; + max-width: var(--page-wide); + padding: var(--page-top) var(--gutter) 3rem; } .lede { @@ -20,7 +20,7 @@ margin-top: 0.75rem; padding: 1rem; border: 1px dashed var(--line); - border-radius: 8px; + border-radius: var(--radius-control); color: var(--ink-soft); } .list { @@ -28,7 +28,7 @@ margin-top: 0.75rem; list-style: none; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } .transaction, @@ -82,8 +82,8 @@ width: 100%; min-width: 0; padding: 0.5rem; - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); background: var(--surface); color: var(--ink); } @@ -104,7 +104,7 @@ } .ruleFields { border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-control); min-width: 0; padding: 0.75rem; display: grid; @@ -117,7 +117,7 @@ .button, .secondary { padding: 0.5rem 1rem; - border-radius: 8px; + border-radius: var(--radius-control); cursor: pointer; font-weight: 600; width: fit-content; @@ -166,3 +166,12 @@ grid-column: 1 / -1; } } + +/* Hover: ink buttons lighten a little, outlined ones pick up the tint. */ +.button:hover:not(:disabled) { + opacity: 0.88; +} + +.secondary:hover:not(:disabled) { + background: var(--tint); +} diff --git a/src/features/imports/ui/imports.module.css b/src/features/imports/ui/imports.module.css index 79c618e..82b6411 100644 --- a/src/features/imports/ui/imports.module.css +++ b/src/features/imports/ui/imports.module.css @@ -2,15 +2,8 @@ (ADR-046), so it follows the light and dark themes. */ .page { - max-width: 56rem; - padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 3.5rem) 3rem; -} - -.page h1 { - font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); - font-weight: 650; - letter-spacing: -0.03em; - line-height: 1.1; + max-width: var(--page-medium); + padding: var(--page-top) var(--gutter) 3rem; } .page h2 { @@ -30,7 +23,7 @@ margin-top: 1.5rem; padding: 1rem; border: 1px dashed var(--line); - border-radius: 8px; + border-radius: var(--radius-control); color: var(--ink-soft); } @@ -40,7 +33,7 @@ padding: 0.875rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--bill); - border-radius: 8px; + border-radius: var(--radius-control); background: var(--surface); } @@ -61,8 +54,8 @@ .field input[type="file"] { width: 100%; padding: 0.5rem 0.625rem; - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); background: var(--surface); color: var(--ink); } @@ -86,7 +79,7 @@ .secondary { display: inline-block; padding: 0.5rem 1rem; - border-radius: 8px; + border-radius: var(--radius-control); font-weight: 600; text-decoration: none; cursor: pointer; @@ -122,7 +115,7 @@ .summary div { padding: 0.75rem 1rem; border: 1px solid var(--line); - border-radius: 10px; + border-radius: var(--radius-card); background: var(--surface); } @@ -154,7 +147,7 @@ padding: 0.75rem 1rem; border: 1px solid var(--line); border-left-width: 4px; - border-radius: 8px; + border-radius: var(--radius-control); background: var(--surface); } @@ -201,7 +194,7 @@ margin-top: 0.75rem; overflow-x: auto; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } @@ -253,7 +246,7 @@ padding: 0; list-style: none; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } @@ -269,3 +262,12 @@ .waiting li + li { border-top: 1px solid var(--line); } + +/* Hover: ink buttons lighten a little, outlined ones pick up the tint. */ +.primary:hover:not(:disabled) { + opacity: 0.88; +} + +.secondary:hover:not(:disabled) { + background: var(--tint); +} diff --git a/src/features/insights/ui/insights.module.css b/src/features/insights/ui/insights.module.css index e4b57c5..ad9d7ee 100644 --- a/src/features/insights/ui/insights.module.css +++ b/src/features/insights/ui/insights.module.css @@ -3,8 +3,8 @@ context first, then spending by category, then where you stand. */ .page { - max-width: 60rem; - padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 3.5rem) 3rem; + max-width: var(--page-medium); + padding: var(--page-top) var(--gutter) 3rem; display: grid; gap: 1.25rem; font-variant-numeric: tabular-nums; @@ -22,13 +22,6 @@ gap: 0.625rem; } -.page h1 { - font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); - font-weight: 650; - letter-spacing: -0.03em; - line-height: 1.1; -} - .page h2 { font-size: 1.125rem; font-weight: 600; @@ -111,13 +104,6 @@ text-decoration: none; } -.segmented a:focus-visible, -.quiet a:focus-visible, -.callout a:focus-visible { - outline: 2px solid var(--sub); - outline-offset: 2px; -} - /* Your take-home and the group's range, side by side. */ .context { display: grid; @@ -125,7 +111,7 @@ gap: 1rem 1.5rem; padding: 1rem; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } @@ -195,7 +181,7 @@ .callout { padding: 0.5rem 0.75rem; - border-radius: 8px; + border-radius: var(--radius-control); background: var(--tint); font-size: 0.875rem; } @@ -215,7 +201,7 @@ gap: 0.875rem; padding: 1.25rem 1rem; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } diff --git a/src/features/messaging/ui/notifications-card.module.css b/src/features/messaging/ui/notifications-card.module.css index 22184e9..44fddbd 100644 --- a/src/features/messaging/ui/notifications-card.module.css +++ b/src/features/messaging/ui/notifications-card.module.css @@ -21,19 +21,14 @@ .field input { min-height: 2.5rem; padding: 0.4rem 0.6rem; - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; } -.field input:focus-visible { - outline: 2px solid var(--ink); - outline-offset: 2px; -} - .types { margin: 1rem 0 1.25rem; padding: 0; diff --git a/src/features/messaging/ui/phone-link-card.module.css b/src/features/messaging/ui/phone-link-card.module.css index 482ed40..bfd826d 100644 --- a/src/features/messaging/ui/phone-link-card.module.css +++ b/src/features/messaging/ui/phone-link-card.module.css @@ -5,7 +5,7 @@ max-width: 34rem; padding: 1.5rem; border: 1px solid var(--line); - border-radius: 14px; + border-radius: var(--radius-card); background: var(--surface); } @@ -54,7 +54,7 @@ .secondary { display: inline-block; padding: 0.5rem 1rem; - border-radius: 8px; + border-radius: var(--radius-control); font-weight: 600; text-decoration: none; cursor: pointer; @@ -103,3 +103,12 @@ .notice:empty { margin-top: 0; } + +/* Hover: ink buttons lighten a little, outlined ones pick up the tint. */ +.primary:hover:not(:disabled) { + opacity: 0.88; +} + +.secondary:hover:not(:disabled) { + background: var(--tint); +} diff --git a/src/features/nessie/ui/nessie.module.css b/src/features/nessie/ui/nessie.module.css index df2f0d8..44b6950 100644 --- a/src/features/nessie/ui/nessie.module.css +++ b/src/features/nessie/ui/nessie.module.css @@ -10,7 +10,7 @@ margin-top: 1.5rem; padding: 1rem; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } @@ -39,7 +39,7 @@ min-height: 2.75rem; padding: 0.5rem 1rem; border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-control); background: var(--surface); color: var(--ink); font-weight: 600; @@ -142,3 +142,8 @@ white-space: nowrap; } } + +/* Hover: ink buttons lighten a little, outlined ones pick up the tint. */ +.button:hover:not(:disabled) { + background: var(--tint); +} diff --git a/src/features/recurring/ui/recurring-page.tsx b/src/features/recurring/ui/recurring-page.tsx index b82590b..64e1d96 100644 --- a/src/features/recurring/ui/recurring-page.tsx +++ b/src/features/recurring/ui/recurring-page.tsx @@ -238,7 +238,7 @@ export function RecurringPage({ const pageHref = (page: number) => `?${new URLSearchParams({ kind: query.kind, state: query.state, intent: query.intent, ...(query.account ? { account: query.account } : {}), page: String(page) })}`; return ( -
+
{/* The header's count on Recurring payments follows this page. */}
diff --git a/src/features/recurring/ui/recurring.module.css b/src/features/recurring/ui/recurring.module.css index e8a4b67..14f9f14 100644 --- a/src/features/recurring/ui/recurring.module.css +++ b/src/features/recurring/ui/recurring.module.css @@ -1,6 +1,6 @@ .page { - max-width: 86rem; - margin-inline: auto; + max-width: var(--page-wide); + padding: var(--page-top) var(--gutter) 3rem; } .heading, .cardHead { @@ -23,7 +23,7 @@ .add { border: 1px solid var(--line); background: var(--surface); - border-radius: 0.65rem; + border-radius: var(--radius-card); padding: 1rem; } .summary h2 { @@ -68,8 +68,8 @@ .field select, .field input { background: var(--surface); - border: 1px solid var(--line); - border-radius: 0.3rem; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); padding: 0.5rem; width: 100%; min-width: 0; @@ -77,10 +77,13 @@ .page button { background: var(--tint); border: 1px solid var(--line); - border-radius: 0.35rem; - padding: 0.45rem 0.7rem; + border-radius: var(--radius-control); + padding: 0.5rem 1rem; cursor: pointer; } +.page button:hover:not(:disabled) { + border-color: var(--ink-soft); +} .page button:disabled { cursor: wait; opacity: 0.7; @@ -101,7 +104,7 @@ .badge { background: var(--tint); padding: 0.15rem 0.45rem; - border-radius: 0.35rem; + border-radius: var(--radius-control); font-size: 0.75rem; } .metrics { diff --git a/src/features/transactions/ui/transactions.module.css b/src/features/transactions/ui/transactions.module.css index 51c9dce..36e8afd 100644 --- a/src/features/transactions/ui/transactions.module.css +++ b/src/features/transactions/ui/transactions.module.css @@ -3,8 +3,8 @@ form rules match the accounts feature's. */ .page { - max-width: 48rem; - padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 3.5rem) 3rem; + max-width: var(--page-narrow); + padding: var(--page-top) var(--gutter) 3rem; } .heading { @@ -15,13 +15,6 @@ gap: 1rem; } -.page h1 { - font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); - font-weight: 650; - letter-spacing: -0.03em; - line-height: 1.1; -} - .lede { max-width: 52ch; margin-top: 0.5rem; @@ -33,7 +26,7 @@ margin-top: 1.5rem; padding: 1rem; border: 1px dashed var(--line); - border-radius: 8px; + border-radius: var(--radius-control); color: var(--ink-soft); } @@ -54,7 +47,7 @@ padding: 0; list-style: none; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } @@ -107,8 +100,8 @@ .filter select { padding: 0.375rem 0.5rem; - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); background: var(--surface); color: var(--ink); } @@ -152,7 +145,7 @@ margin-top: 1rem; padding: 0.75rem 1rem; border: 1px dashed var(--line); - border-radius: 12px; + border-radius: var(--radius-card); color: var(--ink-soft); font-size: 0.875rem; } @@ -191,8 +184,8 @@ .field select { width: 100%; padding: 0.5rem 0.625rem; - border: 1px solid var(--line); - border-radius: 8px; + border: 1px solid var(--field-line); + border-radius: var(--radius-control); background: var(--surface); color: var(--ink); } @@ -229,7 +222,7 @@ .danger { display: inline-block; padding: 0.5rem 1rem; - border-radius: 8px; + border-radius: var(--radius-control); font-weight: 600; text-decoration: none; cursor: pointer; @@ -269,7 +262,7 @@ .confirm { padding: 1rem; border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); } @@ -304,3 +297,13 @@ margin-top: 0.5rem; color: var(--ink-soft); } + +/* Hover: ink buttons lighten a little, outlined ones pick up the tint. */ +.primary:hover:not(:disabled) { + opacity: 0.88; +} + +.secondary:hover:not(:disabled), +.danger:hover:not(:disabled) { + background: var(--tint); +} diff --git a/src/features/transfers/ui/review.module.css b/src/features/transfers/ui/review.module.css index 1a94edd..34111e6 100644 --- a/src/features/transfers/ui/review.module.css +++ b/src/features/transfers/ui/review.module.css @@ -1,6 +1,6 @@ .page { - max-width: 70rem; - padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 3rem) 3rem; + max-width: var(--page-wide); + padding: var(--page-top) var(--gutter) 3rem; } .heading, .actions { @@ -12,10 +12,6 @@ .heading { justify-content: space-between; } -.page h1 { - font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); - line-height: 1.15; -} .page h2 { font-size: 1.15rem; } @@ -48,7 +44,7 @@ .page input[type="date"], .page select { padding: 0.5rem; - border: 1px solid var(--line); + border: 1px solid var(--field-line); border-radius: 6px; background: var(--surface); color: var(--ink); @@ -56,14 +52,17 @@ max-width: 100%; } .page button { - padding: 0.6rem 0.85rem; + padding: 0.5rem 1rem; border: 1px solid var(--ink); - border-radius: 8px; - color: var(--surface); + border-radius: var(--radius-control); + color: var(--bg); background: var(--ink); cursor: pointer; min-height: 44px; } +.page button:hover:not(:disabled) { + opacity: 0.88; +} .page button:disabled { opacity: 0.65; cursor: wait; @@ -73,10 +72,6 @@ text-decoration: underline; text-underline-offset: 0.2em; } -.page :focus-visible { - outline: 2px solid var(--ink); - outline-offset: 3px; -} .cards { display: grid; gap: 1.25rem; @@ -84,7 +79,7 @@ } .card { border: 1px solid var(--line); - border-radius: 12px; + border-radius: var(--radius-card); background: var(--surface); padding: 1rem; overflow-wrap: anywhere; @@ -141,7 +136,7 @@ margin: 1rem 0; padding: 0.85rem; border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-control); } @media (max-width: 480px) { .filters { diff --git a/tests/e2e/app-nav.spec.ts b/tests/e2e/app-nav.spec.ts index d5f567c..7490783 100644 --- a/tests/e2e/app-nav.spec.ts +++ b/tests/e2e/app-nav.spec.ts @@ -79,6 +79,19 @@ test.describe("signed in", () => { expect(grounds.body).toEqual(grounds.header); expect(grounds.body.grid).toContain("linear-gradient"); + + // Cards, lines and soft text are neutral greys like the header: no + // blue cast (red, green and blue channels equal). + const greys = await page.evaluate(() => { + const root = getComputedStyle(document.documentElement); + return ["--surface", "--surface-soft", "--line", "--tint", "--ink-soft"] + .map((name) => [name, root.getPropertyValue(name).trim()] as const) + .filter(([, hex]) => { + const [r, g, b] = [1, 3, 5].map((i) => hex.slice(i, i + 2)); + return r !== g || g !== b; + }); + }); + expect(greys).toEqual([]); }); test("in light mode pages keep their light ground under the dark header", async ({ @@ -99,6 +112,73 @@ test.describe("signed in", () => { expect(body).not.toBe(header); }); + test("every page shares one frame: the header's gutter, one title size, left-aligned", async ({ + page, + }) => { + for (const width of [360, 1440]) { + await page.setViewportSize({ width, height: 900 }); + const frames = []; + for (const [label, url] of PAGES) { + await page.goto(url); + await expect(page.getByRole("heading", { level: 1 })).toHaveText( + label, + { timeout: 20_000 }, + ); + frames.push( + await page.evaluate(() => { + const header = getComputedStyle(document.querySelector("header")!); + const main = document.querySelector("main")!; + const title = getComputedStyle(main.querySelector("h1")!); + return { + gutter: getComputedStyle(main).paddingLeft === header.paddingLeft, + left: main.getBoundingClientRect().left, + title: [title.fontSize, title.fontWeight], + overflow: document.documentElement.scrollWidth > innerWidth, + }; + }), + ); + } + const [first] = frames; + for (const frame of frames) + expect(frame).toEqual({ ...first, gutter: true, overflow: false }); + expect(first.left).toBe(0); + } + }); + + test("form fields have borders that stand out from their card (3:1)", async ({ + page, + }) => { + for (const colorScheme of ["light", "dark"] as const) { + await page.emulateMedia({ colorScheme }); + await page.goto("/accounts"); + await page.getByRole("link", { name: "Add an account" }).click(); + const field = page.getByRole("textbox").first(); + await expect(field).toBeVisible({ timeout: 20_000 }); + const [border, ground] = await field.evaluate((el) => { + const root = getComputedStyle(document.documentElement); + return [ + getComputedStyle(el).borderTopColor, + root.getPropertyValue("--surface").trim(), + ]; + }); + const luminance = (rgb: number[]) => { + const [r, g, b] = rgb.map((v) => { + const c = v / 255; + return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4; + }); + return 0.2126 * r + 0.7152 * g + 0.0722 * b; + }; + const fromCss = (rgb: string) => + rgb.match(/\d+/g)!.slice(0, 3).map(Number); + const fromHex = (hex: string) => + [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16)); + const [a, b] = [luminance(fromCss(border)), luminance(fromHex(ground))]; + expect((Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05)).toBeGreaterThan( + 3, + ); + } + }); + test("every page shows who is signed in and offers sign out", async ({ page, }) => {