feat(ui): dark mode with system-follow and manual toggle - #94
Merged
Conversation
added 2 commits
August 14, 2026 05:42
- New Appearance setting (follow system / light / dark) under Settings → Session settings, switching instantly without a reload - Theme infrastructure: theme.ts as the single source for mode parsing/persistence/DOM application; AppThemeProvider wraps antd ConfigProvider with darkAlgorithm and subscribes to prefers-color-scheme so the system-follow mode flips live - Design tokens: semantic background layers (base/container/elevated/layout) and a full dark override block in variables.css; scrollbar colors tokenized - Migrated ~1300 hardcoded colors across stylesheets to tokens/color-mix so both themes derive from a single palette; translucent glass surfaces and scroll-edge fades adapt automatically - Anti-FOUC inline boot script in index.html applies the stored theme before first paint; share preview pages stay light so shared content renders as authored - Dark-specific overrides only where assets cannot flip via tokens: sidebar SVG icons brightened, hero artwork dimmed, docx preview keeps its white paper
The download-card filename used a stray hardcoded gray-900 rgba that never flipped with the theme; tokenized it together with the card's light-blue-gray borders, the file-badge gradient, and the download button's blue border so the whole card derives from the palette in both themes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds full dark mode support to the frontend.
prefers-color-schemesubscription.index.htmlapplies the stored theme before first paint, so dark-mode users no longer get a white flash on load.How
src/theme.tsis the single source of truth for mode parsing, persistence (localStorage), and DOM application (<html data-theme="dark">+color-scheme).AppThemeProviderwraps the antdConfigProvider, switching betweendefaultAlgorithm/darkAlgorithmwith matching token sets.variables.cssgains semantic background layers (base/container/elevated/layout) and a complete dark override block; scrollbar colors are tokenized.color-mix()derivations, so both themes resolve from a single palette. Translucent glass surfaces and scroll-edge fade masks adapt automatically.Testing
npm run buildpasses (type-check + i18n check + vite) on this tree.