Job Alerts DS

Email

The one layout every message we send uses: what palette it flattens to, whether it ships its own dark version, and which green is allowed to carry text.

Show audit of the app before this rule

Audit

What we have today

32 messages in the catalog, 30 with an HTML body, all through one layout — lib/modules/email/email.layout.tsx.

Already right

  • One layout, one call to action per message, a plain-text twin for every HTML body.
  • Table markup with `role="presentation"`, inline styles, no flexbox or grid, 600px card.
  • `lang="en"`, alt text on the logo, a preheader line, the button URL repeated as text.
  • Colours flattened to hex on purpose — Gmail strips CSS custom properties.

Findings

  • 1. The email palette is the pre-Mantine token system. `#22c55e` / `#0f172a` / `#e2e8f0` are the legacy `--color-*` triplets, which `colors-system.md` keeps only as the marketing alpha layer. Nothing in email traces to `--gg-*`.
  • 2. Link and button green was `#16a34a` — 3.3:1 on white, under the 4.5:1 floor for text at these sizes.
  • 3. Body copy was 15px and footer copy 12px, both under the 16px / 13px floors this page proposes.
  • 4. Email is not a section of this design system, so none of the above was ever a rule anyone could break. That is what this page fixes.

Axis 1 — who owns dark mode

A mail client that is not told a message has a dark version builds one itself, and each client does it differently.

Option A — we author the dark palette

CHOSEN

Declare color-scheme: light dark, ship a prefers-color-scheme block and a [data-ogsc] copy of it for Outlook.com.

Light inbox

Dark inbox

  • Apple Mail, iOS Mail, Outlook for Mac and iOS, and Gmail on iOS take the media query; Outlook.com takes the [data-ogsc] copy.
  • Windows Outlook strips the block and shows the light message, complete, because every value is also inline.
  • Costs a second palette to maintain and a second preview to check.

Option B — declare light only

One palette, color-scheme: light. The message stays light in a dark inbox.

Light inbox

Dark inbox

  • One palette to maintain, and the message looks the same everywhere it is not inverted anyway.
  • In a dark inbox a white 600px card glares out of dark chrome — the thing dark mode exists to stop.
  • Declaring light does not bind every client: several invert regardless, and then the design is theirs, not ours.

Axis 2 — where the colours come from

Both options ship a dark version; they differ in which palette gets frozen to hex.

Option A — flatten the Mantine canon

CHOSEN

gray-0/3/7/9 and dark-0/2/4/7/9 for neutrals, green-6 and green-4 for brand: the same colours the app renders, written as hex.

Light inbox

Dark inbox

  • The inbox and the app look like one product, and a token change in colors-system.md has one obvious place to land in email.
  • Needs one addition Mantine does not have: an ink green dark enough for body-sized text (Axis 3).
  • Costs a one-time sweep of the email palette file and its tests.

Option B — keep the bespoke email palette

The slate-and-Tailwind-green values the templates already carry.

Light inbox

Dark inbox

  • Nothing to change, and the values are already tested.
  • Keeps a second palette alive in a repo whose rule is that there is one, and its neutrals are bluer than the app's.
  • A future colors decision would have to be applied twice, by hand, or forgotten.

Axis 3 — which green carries text

Links and the button label are body-sized text, so they need 4.5:1. Mantine's ramp stops just short of it.

GreenOn whiteVerdict
Mantine green-6 `#40c057`2.36:1Fails. Reads as a pale wash on white.
Mantine green-9 `#2b8a3e`4.37:1Fails, narrowly — the end of Mantine's own ramp.
Email ink `#29833b`4.77:1Passes. Mantine green-9, darkened 5%.
Shipped ink `#15803d`5.02:1Passes. Tailwind green-700, off the Mantine hue.

Option A — email ink #29833b

CHOSEN

An email-only ink step in the Mantine hue. Option B kept the Tailwind green already shipped (#15803d) — it passes too, but it leaves email green subtly off the app's. Option C kept the canon ramp untouched and failed the contrast floor.

Shared rules

True whichever way the three axes land

These come out of the research, not out of the options.

  • One 600px card, one call to action, one heading, left-aligned.
  • Body copy 16px / 26px line height; nothing below 13px.
  • Tables for layout with `role="presentation"`; no flexbox, no grid.
  • Every colour inline as hex; the only `<style>` block is dark mode, and nothing in it is load-bearing.
  • Buttons are live text with a 48px tap target, and the URL is repeated as text.
  • Every HTML body has a plain-text twin; the text version is the one that always arrives.
  • Absolute URLs everywhere — an email has no origin of its own.
Show research sources

Decision — A / A / A

DECIDED

Axis 1 — we author dark mode

  • Not authoring it does not mean no dark mode; it means three of them, one per client, none drawn by us.
  • A light-only card glares out of dark chrome, which is the thing dark mode exists to stop.
  • The cost is bounded: the block is the only one in the message, and nothing in it is load-bearing — strip it and the light message is complete.

Axis 2 — email flattens the Mantine canon

  • The bespoke palette was not a decision, it was a leftover: the pre-Mantine `--color-*` triplets that colors-system.md already retired everywhere else.
  • Email cannot use `--gg-*` (Gmail strips custom properties), so the canon reaches it as frozen hex. Hex in email is the documented exception, not a licence for a second palette.
  • Applied at adoption: the light and dark values in `email.theme.ts` were replaced with the Mantine steps, and the contrast test now covers both palettes.

Axis 3 — email ink #29833b

  • Mantine green-9 measures 4.37:1 on white. Links and button labels are body-sized text, so 4.5:1 is the floor, and the ramp stops just under it.
  • Darkening green-9 by 5% clears it at 4.77:1 and keeps the hue, so the inbox green still reads as the app's green.
  • The dark half needs no such step: green-4 on the dark card measures 9.9:1.
  • This step is email-only. The app keeps green-6 / green-4 — larger type and different surfaces, different floor.

Design system for a freelance job-alert app. App copies are downstream.