commit
Fix dark mode
diff --git a/index.html b/index.html
index d4ed63a..1765f15 100644
--- a/index.html
+++ b/index.html
@@ -7,6 +7,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
+ <meta name="color-scheme" content="only dark" />
<meta name="theme-color" content="#0a0b10" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
diff --git a/src/web/app.css b/src/web/app.css
index 078a5d9..163bc92 100644
--- a/src/web/app.css
+++ b/src/web/app.css
@@ -106,7 +106,7 @@
--font: "IBM Plex Sans", system-ui, sans-serif;
--mono: "Comic Code", ui-monospace, "Cascadia Code", Menlo, monospace;
- color-scheme: dark;
+ color-scheme: only dark;
}
* {
diff --git a/src/web/components/EmailFrame.svelte b/src/web/components/EmailFrame.svelte
index 5a43012..1a16ae4 100644
--- a/src/web/components/EmailFrame.svelte
+++ b/src/web/components/EmailFrame.svelte
@@ -29,10 +29,37 @@
let height = $state(80);
let showRemote = $state(false);
- const BASE_STYLE =
- ":root{color-scheme:light}body{margin:0;padding:12px;background:#fff;color:#111;" +
- "font:15px/1.5 -apple-system,system-ui,sans-serif;overflow-wrap:anywhere}" +
- "img{max-width:100%;height:auto}pre{white-space:pre-wrap}table{max-width:100%}";
+ const BASE_STYLE = `
+ :root {
+ color-scheme: only dark;
+ background: #131116;
+ color: #ece9ef;
+ }
+
+ body {
+ margin: 0;
+ padding: 12px;
+ font: 15px/1.5 -apple-system, system-ui, sans-serif;
+ overflow-wrap: anywhere;
+ }
+
+ a {
+ color: #f49ac8;
+ }
+
+ img {
+ max-width: 100%;
+ height: auto;
+ }
+
+ pre {
+ white-space: pre-wrap;
+ }
+
+ table {
+ max-width: 100%;
+ }
+ `;
const body = $derived.by(() => {
const byCid = new Map(
@@ -54,6 +81,7 @@
return (
`<!doctype html><html><head><meta charset="utf-8">` +
`<meta http-equiv="Content-Security-Policy" content="${csp}">` +
+ `<meta name="color-scheme" content="only dark">` +
`<meta name="referrer" content="no-referrer"><style>${BASE_STYLE}</style></head>` +
`<body>${body}</body></html>`
);
@@ -90,13 +118,11 @@
></iframe>
<style>
- /* Emails are designed for a light page, so the frame stays white, edge to
- edge across the message card as in the app. */
iframe {
display: block;
width: 100%;
border: none;
- background: #fff;
+ background: var(--surface-low);
}
.remote {