Repository navigation
fix(markdown): preserve code backgrounds across theme changes - #1060
Open
xuzijian2019 wants to merge 1 commit into
Open
xuzijian2019 wants to merge 1 commit into
xuzijian2019 wants to merge 1 commit into
Conversation
This was referenced Oct 4, 2026
This branch has not been deployed
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 code-fence and Mermaid-source backgrounds being reset after a theme change.
Prism's
vspre style usesbackgroundColor, whilevscDarkPlususesbackground. Combining either with the component's constantcustomStyle.backgroundmakes React's style diff remove/update a competing property. On main (6fcd7d4), light → dark clears the intended background to transparent; switching back applies Prism's white background rather than the app color mix. React reports the shorthand/longhand conflict.backgroundColorfor highlighted and streaming code.Refs xuzijian2019/pi-agent-desktop#8
Verification
npm test: 2,284 passed, 0 failed.tsc --noEmit: passed.npm run lint: passed.npm run test:e2e(dev mode): passed, including new light/dark round trips at 1280px and 390px.No product CSS/theme redesign, SDK policy changes or fork UI dependencies. No inference requests used in verification. Browser verification used Chromium on macOS, not real mobile hardware.