fix: light-mode override to body content only

This commit is contained in:
Linus Rath
2026-04-29 20:17:59 +02:00
parent b64721b43c
commit 3667c842c6
2 changed files with 30 additions and 2 deletions
+25
View File
@@ -204,6 +204,31 @@ body {
min-width: 100%;
}
/* Forces light-theme CSS variables inside the email content area, so when
"Always Show Emails in Light Mode" is enabled in dark theme the surrounding
sender info / attachments / plain-text body don't end up with light text
on a white background. */
.email-content-light {
--color-background: #ffffff;
--color-foreground: #0f172a;
--color-muted: #f1f5f9;
--color-muted-foreground: #64748b;
--color-border: #e2e8f0;
--color-card: #ffffff;
--color-card-foreground: #0f172a;
--color-popover: #ffffff;
--color-popover-foreground: #0f172a;
--color-secondary: #f8fafc;
--color-secondary-foreground: #0f172a;
--color-accent: #dbeafe;
--color-accent-foreground: #1e40af;
--color-input: #e2e8f0;
}
.email-content-light .email-content-text a {
color: #2563eb;
}
.email-content-text {
padding: 1rem 1.25rem;
}
+5 -2
View File
@@ -3814,7 +3814,7 @@ export function EmailViewer({
)}
{/* Email Content Area */}
<div className={cn("flex-1 overflow-auto", emailAlwaysLightMode ? "bg-white" : "bg-background", isMobile && "pb-16")}>
<div className={cn("flex-1 overflow-auto bg-muted/30", isMobile && "pb-16")}>
{/* === SENDER INFO (Desktop) === */}
<div className="hidden lg:block bg-background border-b border-border px-6" style={{ paddingBlock: 'var(--density-header-py)' }}>
@@ -4713,7 +4713,10 @@ export function EmailViewer({
<PluginSlot name="email-banner" extraProps={{ email }} />
{/* Email Body */}
<div className="email-content-wrapper overflow-x-auto">
<div className={cn(
"email-content-wrapper overflow-x-auto",
emailAlwaysLightMode ? "bg-white email-content-light" : "bg-background"
)}>
{isBodyLoading ? (
<div
className="space-y-3 px-6 py-4 animate-pulse"