You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feature] Derive markdown code block colors from custom theme #3172
Fenced code blocks in the rendered markdown view use hardcoded oneLight / oneDark themes from react-syntax-highlighter (prism). These themes have their own fixed background and token colors that are completely independent of the user's custom theme.
This means custom themes have no control over how syntax-highlighted code blocks look in markdown. For light themes with a tinted background (e.g. Iceberg Light with #e8e9ec), the oneLight theme's pastel token colors appear washed out because they were designed for a pure white (#fafafa) background. The only workaround is setting ui.muted to near-white, which constrains the overall theme design.
Current behavior
In CodeBlock.tsx, the syntax highlighter theme is selected purely by light/dark mode:
The custom theme's terminal ANSI colors and UI colors have no effect on fenced code block rendering, even though they already drive:
The CodeMirror file editor (via getEditorTheme())
The diff viewer's syntax highlighting (via Shiki + terminal colors)
Inline code styling (via bg-muted)
Suggested approach
Derive fenced code block colors from the custom theme, consistent with how the diff viewer and editor already work. A few options:
Build a prism-compatible style object from the theme's terminal colors — map terminal ANSI slots to prism token categories using the same mapping that getEditorTheme() uses (e.g. terminal.green → strings, terminal.blue → functions, etc.), with ui.muted as the background.
Use Shiki instead of react-syntax-highlighter — the diff viewer already uses Shiki with theme-derived colors via getEditorTheme(). Switching the markdown code blocks to the same Shiki pipeline would give consistent styling across all code views.
Allow an editor.codeBlock theme override — similar to how editor.syntax.comment exists, allow themes to specify code block background/foreground overrides.
Closing as a duplicate of #5608, the consolidated tracker for stale themes-appearance issues from the July 2026 stale-issue sweep (no activity since 2026-06-01). If this still applies on a current build, comment on #5608 and we'll reopen.
Activity
fix: derive markdown code block colors from custom theme (#3172)
Kitenite commentedon Jul 11, 2026
Closing as a duplicate of #5608, the consolidated tracker for stale
themes-appearanceissues from the July 2026 stale-issue sweep (no activity since 2026-06-01). If this still applies on a current build, comment on #5608 and we'll reopen.