mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-18 20:15:20 +02:00
fix: keep light canvas for styled emails in dark mode
Styled HTML emails (newsletters, branded mail) declared color-scheme 'light dark' whenever the app theme was dark, so Chromium resolved the iframe to the dark scheme and painted an opaque dark canvas under emails that assume a white background, making their text unreadable. Only opt into the dark scheme when the email actually adapts to the app theme.
This commit is contained in:
parent
1632b16dfc
commit
610cb66d40
1 changed files with 4 additions and 1 deletions
|
|
@ -300,7 +300,10 @@ function buildEmailDocument(
|
|||
opts: { theme: 'light' | 'dark'; adaptToTheme: boolean },
|
||||
): string {
|
||||
const useDark = opts.theme === 'dark' && opts.adaptToTheme
|
||||
const colorScheme = opts.theme === 'dark' ? 'light dark' : 'light'
|
||||
// Only opt into the dark color scheme when the email actually adapts to the
|
||||
// theme — otherwise Chromium paints the canvas dark under emails that
|
||||
// assume a white background.
|
||||
const colorScheme = useDark ? 'light dark' : 'light'
|
||||
const bodyColor = useDark ? '#d4d4d8' : '#202124'
|
||||
const linkColor = useDark ? '#a78bfa' : '#1a73e8'
|
||||
const quoteBorder = useDark ? '#2e2e35' : '#dadce0'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue