Repository navigation
Description
Summary
Transactional emails render poorly in the Gmail Android app with the app in dark mode. Seen on membership_request_new (New membership request), but the cause sits in server/internal/email/templates/base.html, so every template is affected.
What it looks like
Gmail app (Android), dark theme, phone width:
-
A full-brightness white card inside the dark Gmail UI. The light pin (
color-scheme: light only) keeps the card light, but everything around it is dark, so it glares. -
Washed-out links: light blue text on the white card, close to unreadable:
- the requester's email address in the body text;
- the fallback URL in the "Or paste this link into your browser" box.
Neither is an
<a>in the template. Gmail auto-links them itself (it ignores ourformat-detectionmeta) and paints them with its own dark-mode link color (Gmail's light blue, about#8ab4f8), which assumes a dark background. The card stayed white because of the pin, so we get the worst of both: a light card with dark-theme links. -
The card wastes width on a phone. The
.wrapperpadding (32px/12px), the 1px border, the radius and the shadow cost horizontal space. The monospace fallback URL then breaks mid-word over two lines inside a bordered box (word-break: break-all). -
A thin dark seam above the navy header. The card's rounded corners and overflow sit on the dark Gmail background.
Gmail-specific background: Gmail does not support @media (prefers-color-scheme) (see wiki/features/email-dark-mode.md), so the designed dark palette never reaches it. Gmail also drops box-shadow and background-image gradients, so most of the decorative CSS buys nothing there.
Proposed fix (simplify, and own every link color)
- Never let Gmail auto-link.
- Render every URL and email address we print as an explicit
<a>with an inlinecolor(#1e64ef). That covers the requester email (mailto:), the fallback URL and similar fields in other templates. - Alternatively, break auto-detection (for example a zero-width joiner in the
@and://) where the value should not be a link at all. - Gmail keeps the author's link color under the light pin. Its auto-link color is what goes wrong.
- Render every URL and email address we print as an explicit
- Simplify the fallback-link block.
- Drop the monospace bordered box. Use a plain small paragraph with a normal link, wrapped with
word-break: break-word(notbreak-all). - Or drop the block on mobile entirely: the button already carries the link.
- Drop the monospace bordered box. Use a plain small paragraph with a normal link, wrapped with
- Full-bleed card on small screens.
- Under
max-width: 480px, set.wrapperpadding to 0 and remove the card's border, radius and shadow, so the content uses the full width. - Keep
.contentside padding around 20px.
- Under
- Flatten the decorative CSS for Gmail.
- Drop shadows, inner gradients on light surfaces (
.quote,.details-table td.label,.metric,.footer,.btn-secondary) and the 14px card radius. Use solid colors that are the same in every client. - Keep the existing solid
background-colorfallbacks. This shrinksbase.htmland removes the Gmail/desktop rendering gap.
- Drop shadows, inner gradients on light surfaces (
- Dark mode decision. This report is a data point for the open, human-gated Gmail decision in
wiki/features/email-dark-mode.md. With the pin in place, Gmail Android dark gives a white card plus dark-theme link colors. Once 1–4 have landed, re-test with the pin flipped tolight darkon the four templates in the device matrix, and record the results there.
Acceptance
- In Gmail Android dark and light,
membership_request_new,invitation,incident-createdanduptime-reportshow no light-blue-on-white text and no auto-linked values. - The content uses the full phone width, and the fallback link wraps cleanly.
- Existing email template tests stay green (
TestPreview_PinsLightRendering,TestDarkPalette_*). A new test asserts that the fallback URL and requester email render as explicit<a>with an inline color. - The device-matrix rows for Gmail Android are filled in
wiki/features/email-dark-mode.md.
Activity
fclairamb commentedon Oct 8, 2026
Converted to a spec:
specs/todos/2026-10-08-01-email-gmail-android-dark-rendering.md(sonnet/medium), why: spans base.html, ~10 templates, tests and the wiki device matrix (>4 files), and the Gmail dark-mode pin is an open human-gated decision. Not implemented yet — closing because the spec is now the tracking artifact; run /implement-todos to implement it. Spec PR: #496.fix: implement batch of specs (emails, incidents, Pushover, port fiel…