Skip to content

Fix light mode in the PDF viewer + native title bar#67

Merged
zParik merged 2 commits into
mainfrom
fix/viewer-light-mode
Jun 12, 2026
Merged

Fix light mode in the PDF viewer + native title bar#67
zParik merged 2 commits into
mainfrom
fix/viewer-light-mode

Conversation

@zParik

@zParik zParik commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Problem

Light mode didn't reach the viewer. The top toolbar, left page rail, and right tool sidebar stayed dark in light mode, and the native window title bar followed only the OS theme.

Cause

  • --viewer-* chrome tokens in styles.css were hardcoded dark (/* Viewer chrome — always dark */) and never overridden in the light/system theme blocks. All viewer chrome consumes these tokens.
  • The window uses native decorations, so the OS title bar tracked the system theme, not the in-app theme choice.

Fix

  • Map --viewer-* onto the shared --bg/--line/--fg shell tokens. In dark mode these resolve to the exact same hex values as before (verified 1:1), so dark mode is unchanged; light mode now gets a matching light viewer.
  • Drive the native window theme from the app theme via Tauri setTheme (null for system), and grant core:window:allow-set-theme.

Notes

  • Viewer status badge text (--v-*-text) is still tuned for dark backgrounds — out of scope here, separate follow-up.
  • The capability change needs a Rust rebuild to take effect.

Verification

  • tsc --noEmit clean, eslint clean.

zParik added 2 commits June 12, 2026 09:58
The --viewer-* chrome tokens were hardcoded dark, so the viewer's top
toolbar, left page rail, and right tool sidebar stayed dark even when the
app was set to light mode. Map them onto the shared --bg/--line/--fg shell
tokens: dark mode resolves to the same hex values as before, while light
mode now gets a matching light viewer.
The window uses native decorations, so the OS title bar followed only the
system theme and clashed with an explicit in-app light/dark choice. Apply
the resolved theme to the native window via setTheme (null for system), and
grant the core:window:allow-set-theme capability it needs.
@zParik zParik merged commit 7550de3 into main Jun 12, 2026
6 checks passed
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