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.
This commit is contained in:
Takashi Fujita 2025-03-07 19:49:07 +09:00 committed by GitHub
parent 43a36c1a0a
commit 1235db6c49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);