Skip to content

Commit 8823c06

Browse files
committed
fix(gui): keep inline code readable in high-contrast themes
StyledMarkdownPreview only overrode the background of inline code, so VS Code's textPreformat foreground ended up on a background it wasn't meant for (white on white in Light High Contrast). Use the textPreformat foreground/background pair, fall back to the current colors, and leave symbol links unchanged. Fixes #13424
1 parent 5522c6f commit 8823c06

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • gui/src/components/StyledMarkdownPreview

‎gui/src/components/StyledMarkdownPreview/index.tsx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ const StyledMarkdown = styled.div<{
108108
font-family: var(--vscode-editor-font-family);
109109
}
110110
111+
/* Symbol links keep their link color */
112+
code:not(pre > code):not(.text-link) {
113+
color: var(--vscode-textPreformat-foreground, ${vscForeground});
114+
background-color: var(
115+
--vscode-textPreformat-background,
116+
${vscEditorBackground}
117+
);
118+
}
119+
111120
background-color: ${(props) => props.bgColor};
112121
font-family:
113122
var(--vscode-font-family),

0 commit comments

Comments
 (0)