Codex Desktop dark mode makes local HTML previews unreadable
What version of the Codex App are you using (From "About Codex" dialog)?
Codex Desktop 26.506.21252 (bundle version 2575)
What subscription do you have?
Unknown / not shown in local app diagnostics.
What platform is your computer?
macOS 15.7.3 (24G419), arm64
What issue are you seeing?
In Codex Desktop dark mode, local HTML files opened in the browser/side-panel preview can become unreadable. The preview appears to use a dark page background while the HTML document's default text remains black, resulting in black text on a very dark background.
This affects generated HTML artifacts such as resumes, cover letters, reports, and other local .html outputs.
Expected behavior
Local HTML previews should remain readable in Codex Desktop regardless of the app theme.
The fix should be in the Desktop preview/browser layer, not require every generated HTML artifact to include its own dark-mode reset.
Actual behavior
When Codex Desktop is in dark mode and a local file://...html artifact is opened, the page background is dark but default document text is black or near-black, producing extremely low contrast.
Repro steps
- Open Codex Desktop.
- Use dark mode.
- Generate or open a local HTML file that relies on browser default document colors.
- Open the HTML file in the Codex Desktop browser/side-panel preview.
- Observe that the page is unreadable due to low contrast.
Example
A plain HTML document like this is enough to show the issue:
<!doctype html>
<html>
<body>
<h1>Example Document</h1>
<p>This text should be readable.</p>
</body>
</html>
Proposed fix
The Desktop browser/preview layer should isolate local HTML documents from app dark-mode defaults or inject accessible fallback document colors for local HTML previews.
For example, when navigating to local file://*.html / file://*.htm documents, the Electron WebContents layer could inject fallback CSS:
const LOCAL_HTML_FALLBACK_CSS = `
:root {
color-scheme: light;
}
html,
body {
background: Canvas;
color: CanvasText;
}
`;
webContents.on("did-finish-load", async () => {
const url = webContents.getURL();
if (url.startsWith("file:") && /\.(html?|xhtml)([?#].*)?$/i.test(url)) {
await webContents.insertCSS(LOCAL_HTML_FALLBACK_CSS, {
cssOrigin: "user",
});
}
});
A more conservative version could only apply this fallback when the document does not explicitly declare its own color-scheme, background, or foreground color.
Why this matters
Codex frequently generates local HTML artifacts. Those artifacts should be readable when previewed inside Codex Desktop without requiring each artifact to work around the host app's theme.