🎨 Improved muted text contrast in transactional emails - #30201
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (28)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (10)Review new or changed service boundaries for explicit dependency ownership,⚙️ CodeRabbit configuration file Files:
Review whether tests prove changed behaviour, meaningful error/edge paths, and⚙️ CodeRabbit configuration file Files:
New source files must be TypeScript: flag new JS files as a required change⚙️ CodeRabbit configuration file Files:
Review lens: "where does this data become trusted?"⚙️ CodeRabbit configuration file Files:
Prioritise concrete correctness, security, data-integrity, compatibility,⚙️ CodeRabbit configuration file Files:
Boot owns service initialization; do not📄 CodeRabbit inference engine (AGENTS.md) Files:
Type-safe boundaries: Fail only if the PR:📄 CodeRabbit inference engine (Custom checks) Files:
New standalone services use TypeScript; keep CommonJS only📄 CodeRabbit inference engine (AGENTS.md) Files:
New files are TypeScript: Fail if the PR adds a new .js/.jsx/.cjs/.mjs source file, unless it is: a DB📄 CodeRabbit inference engine (Custom checks) Files:
Always use `pnpm`, never npm or Yarn.📄 CodeRabbit inference engine (AGENTS.md) Files:
🔇 Additional comments (28)
WalkthroughEmail footers, notices, links, and one verification URL now use Possibly related PRs
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This PR only darkens muted transactional-email text to improve accessibility contrast, without changing markup, layout, sizing, or copy. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
Full details: Linked Issues checkExplanation The changes address issue Full details: Type-Safe BoundariesExplanation PASS — The pull request changes only the color literal in 38 production-server occurrences, plus matching test and snapshot expectations. Diff comparison shows every added/removed source line is identical after replacing ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ref TryGhost#29666 Muted text in transactional emails (magic links, invites, password resets, comment/gift notifications, verify emails) was hardcoded to that WCAG 1.4.3 requires for small text. Replaced it with #5B6B73, which keeps the same slate hue while reaching 5.5:1 on white and 5.0:1 on the #EEF5F8 boxes some templates use. Newsletter and welcome email footers are intentionally untouched: since the unified email wrapper (TryGhost#26898) they render rgba(0,0,0,0.6) over white (#666666, 5.74:1), which already meets AA.
57015b5 to
ecb5271
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Rebased onto latest No source email template retains Green locally: the four email unit suites, |
closes #29666
Problem
Transactional emails (member magic links, staff invites, password resets, comment/gift notifications, verify-email flows) hardcode
#738A94for muted/footer text. On the white email background that is a 3.63:1 contrast ratio — below the 4.5:1 that WCAG 1.4.3 (AA) requires for regular text. These footers are 11px and often carry the link that matters ("Manage your email preferences", sender info).Investigation notes — why the issue's screenshot doesn't match current newsletters
The screenshot in #29666 shows a welcome-email footer ("Site © 2026 — Manage your preferences") rendered in
#738A94(sampled pixels ≈#778993, and the copy matches the old welcome template exactly). That specific footer was already fixed: since the unified email wrapper (#26898), newsletter and welcome email footers renderrgba(0,0,0,0.6)over white →#666666→ 5.74:1, which passes AA.What still fails today is the transactional email suite, which never went through that unification: 38 hardcoded
#738A94occurrences across 24 files. This PR sweeps those, which removes the last shipping source of the failing grey.Change
#738A94→#5B6B73— same slate hue, one step darker, so the muted-text hierarchy against#3A464C/#15212Abody text is preserved:#EEF5F8boxesStrictly a color-value swap: no markup, sizing, layout, or copy changes. Newsletter/welcome templates (
email-rendering/,email-service/email-templates/) are intentionally untouched — they already pass.Screenshots
Member sign-in email, rendered at both values:
Footer close-up:
Verified end-to-end on a fresh local site through Mailpit:
Testing
grep -ri "738a94" ghost/core/core/server→ 0 matchesnewsletters,members,send-magic-link, legacyauthentication,email-previewspnpm checkrun locally: no failures introduced by this change — the only failing tasks reproduce identically on an untouchedmaincheckout (two timezone-sensitive unit tests on a UTC+7 machine, plus anadmin-x-frameworktypecheck failure)