Skip to content

Commit 8f98d6d

Browse files
voidstackloopclaude
andcommitted
Fix report.html and index.html rendering dark-on-dark with no light background pinned
Neither page ever set an explicit `background` on body — harmless as long as the viewer's browser defaults to a white canvas, but a viewer with a dark OS/browser theme gets the page's own dark text color (#1a1a1a, designed assuming a light background) rendered against a dark canvas the page never asked for. Confirmed by actually rendering a real --html report (with real screenshots and a Fail/Warn/Pass mix) in a browser with a dark theme: the title, check names, and detail text were all barely visible dark-gray-on-near-black, while only the colored PASS/WARN/FAIL badges (which set their own background) stayed legible. Fixed both pages the same way: an explicit `background: #fff` on body plus `color-scheme: light` on :root, since neither page has (or needs) a dark variant — pinning to light is simpler and more honest than half-supporting both. Verified by rebuilding, regenerating a real report against the same fixture, and confirming it now renders as a normal light page regardless of the viewer's theme. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 4050463 commit 8f98d6d

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>formwatch community dashboard</title>
77
<style>
8-
body { font-family: -apple-system, Segoe UI, Helvetica, Arial, sans-serif; max-width: 900px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
8+
/* Explicit light background + color-scheme: without both, a page with
9+
no background set at all inherits the viewer's OS/browser dark
10+
theme for its canvas while keeping this stylesheet's dark text
11+
color (#1a1a1a) meant for a *light* background — the two together
12+
render as near-unreadable dark-on-dark. This dashboard has no dark
13+
variant, so pin it to light rather than half-supporting both. */
14+
:root { color-scheme: light; }
15+
body { font-family: -apple-system, Segoe UI, Helvetica, Arial, sans-serif; max-width: 900px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; background: #fff; }
916
h1 { font-size: 1.4rem; }
1017
p.sub { color: #666; font-size: 0.9rem; }
1118
.meta { color: #666; font-size: 0.85rem; margin-bottom: 2rem; }

templates/report.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
<meta charset="utf-8">
55
<title>formwatch report</title>
66
<style>
7-
body { font-family: -apple-system, Segoe UI, Helvetica, Arial, sans-serif; max-width: 900px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
7+
/* Explicit light background + color-scheme: without both, a page with
8+
no background set at all inherits the viewer's OS/browser dark
9+
theme for its canvas while keeping this stylesheet's dark text
10+
color (#1a1a1a) meant for a *light* background — the two together
11+
render as near-unreadable dark-on-dark. This report has no dark
12+
variant, so pin it to light rather than half-supporting both. */
13+
:root { color-scheme: light; }
14+
body { font-family: -apple-system, Segoe UI, Helvetica, Arial, sans-serif; max-width: 900px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; background: #fff; }
815
h1 { font-size: 1.4rem; }
916
.meta { color: #666; font-size: 0.85rem; margin-bottom: 2rem; }
1017
.form-card { border: 1px solid #ddd; border-radius: 8px; margin-bottom: 1.5rem; overflow: hidden; }

0 commit comments

Comments
 (0)