Skip to content

fix: match PDF export background to active theme - #8

Merged
kooksee merged 1 commit into
masterfrom
fix/pdf-export-dark-background
Sep 19, 2026
Merged

kooksee merged 1 commit into
masterfrom
fix/pdf-export-dark-background

Conversation

@kooksee

@kooksee kooksee commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • PDF capture hardcoded backgroundColor: #ffffff, so dark-mode light text rendered on a white page.
  • Resolve capture/PDF page fill from --color-gh-bg / data-theme, and set print-fallback body background too.

Test plan

  • Switch to dark theme, export a doc with headings + Mermaid + code pills
  • Confirm body text is readable (dark page, light text)
  • Switch to light theme and re-export — still white page / dark text
  • cd frontend && npm test -- --run src/utils/pdfExport.test.ts

Made with Cursor

html-to-image always used a white canvas while dark-mode text stayed
light, so body copy vanished. Capture and fill the PDF page with the
theme background instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kooksee
kooksee merged commit d9849c0 into master Sep 19, 2026
2 of 4 checks passed
@kooksee
kooksee deleted the fix/pdf-export-dark-background branch September 19, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant