Skip to content

Commit 13d54ad

Browse files
authored
Merge pull request #1583 from cannuri/cannuri/fix-markdownblock-text-color
Fix MarkdownBlock text color for Dark High Contrast theme
2 parents b73bc39 + 49fca10 commit 13d54ad

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

webview-ui/src/components/common/MarkdownBlock.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ const StyledMarkdown = styled.div`
6363
white-space: pre-wrap;
6464
}
6565
66-
:where(h1, h2, h3, h4, h5, h6):has(code) code {
67-
font-size: inherit;
68-
}
66+
:where(h1, h2, h3, h4, h5, h6):has(code) code {
67+
font-size: inherit;
68+
}
6969
7070
pre > code {
7171
.hljs-deletion {
@@ -103,6 +103,14 @@ const StyledMarkdown = styled.div`
103103
overflow-wrap: anywhere;
104104
}
105105
106+
/* Target only Dark High Contrast theme using the data attribute VS Code adds to the body */
107+
body[data-vscode-theme-kind="vscode-high-contrast"] & code:not(pre > code) {
108+
color: var(
109+
--vscode-editorInlayHint-foreground,
110+
var(--vscode-symbolIcon-stringForeground, var(--vscode-charts-orange, #e9a700))
111+
);
112+
}
113+
106114
font-family:
107115
var(--vscode-font-family),
108116
system-ui,

0 commit comments

Comments
 (0)