Fix Default Theme text contrast - #445
Open
pankaj512 wants to merge 2 commits into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Fix the Default Theme producing light backgrounds with foreground tokens that still resolve for Figma's dark mode, which makes labels and secondary text faint or invisible.
Root cause
Figma stores its resolved appearance on
body[data-preferred-theme]andbody.style.colorScheme. The Linux wrapper applied its own palette variables and backgrounds without synchronizing that resolved mode.With the light Default Theme selected while Figma resolved to dark mode:
Custom dark themes appeared correct because their palette happened to agree with Figma's dark resolved state.
What changed
bg-panel.data-preferred-themeand CSScolor-schemewhenever a palette is applied.nativeTheme.themeSourceduring startup and live theme switching so media queries and native UI use the same resolved scheme.setThemePreferencedesktop message.systempreference and fall back to it for invalid values.Verification
npm run checkpasses with 0 errors and 0 warnings.npm run buildpasses with the repository's existing Rollup/Svelte warnings.git diff --checkpasses.Testing help requested
I could not complete an end-to-end visual test in the packaged Electron application. The repository's bundled Electron 30 and legacy desktop API bridge stall on the current live Figma frontend after authentication; testing with Electron 44 reached the same frontend initialization limitation. The authenticated route itself loads normally in a standard browser, which allowed the exact DOM/theme mismatch and contrast result to be verified.
Please help test this branch in a currently working Figma Linux installation, particularly:
Screenshots
The first image shows the broken Default Theme. The second shows the same screen with a coherent dark theme for comparison.
Broken: Default Theme
Working comparison: Dark Theme