Skip to content

Emails render badly in the Gmail Android app (dark mode): white card, unreadable auto-linked text, cramped layout #492

Closed

Description

@fclairamb

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 our format-detection meta) 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 .wrapper padding (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)

  1. Never let Gmail auto-link.
    • Render every URL and email address we print as an explicit <a> with an inline color (#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.
  2. 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 (not break-all).
    • Or drop the block on mobile entirely: the button already carries the link.
  3. Full-bleed card on small screens.
    • Under max-width: 480px, set .wrapper padding to 0 and remove the card's border, radius and shadow, so the content uses the full width.
    • Keep .content side padding around 20px.
  4. 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-color fallbacks. This shrinks base.html and removes the Gmail/desktop rendering gap.
  5. 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 to light dark on the four templates in the device matrix, and record the results there.

Acceptance

  • In Gmail Android dark and light, membership_request_new, invitation, incident-created and uptime-report show 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

  1. added
    bug
    converted-to-spec
    on Oct 8, 2026
  2. fclairamb commented on Oct 8, 2026

    @fclairamb
    OwnerAuthor

    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.

  3. added a commit that references this issue on Oct 9, 2026
    03be40c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconverted-to-spec

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions