Skip to content

Commit 1235db6

Browse files
authored
fix: adjust font size of code elements within headings to ensure consistent styling
Apply :has() selector to make code elements inherit font size from their heading parents. This ensures visual consistency in markdown headings containing code blocks.
1 parent 43a36c1 commit 1235db6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ 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+
}
69+
6670
pre > code {
6771
.hljs-deletion {
6872
background-color: var(--vscode-diffEditor-removedTextBackground);

0 commit comments

Comments
 (0)