From 1235db6c49eba8ba29c35afc29854e56f41b114b Mon Sep 17 00:00:00 2001 From: Takashi Fujita Date: Fri, 7 Mar 2025 19:49:07 +0900 Subject: [PATCH] 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. --- webview-ui/src/components/common/MarkdownBlock.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webview-ui/src/components/common/MarkdownBlock.tsx b/webview-ui/src/components/common/MarkdownBlock.tsx index 8252d480c6e..2af86e8dbc1 100644 --- a/webview-ui/src/components/common/MarkdownBlock.tsx +++ b/webview-ui/src/components/common/MarkdownBlock.tsx @@ -63,6 +63,10 @@ const StyledMarkdown = styled.div` white-space: pre-wrap; } + :where(h1, h2, h3, h4, h5, h6):has(code) code { + font-size: inherit; + } + pre > code { .hljs-deletion { background-color: var(--vscode-diffEditor-removedTextBackground);