Skip to content

Commit 1c13009

Browse files
mstrathmanclaude
andcommitted
site: size inline code in headings to match the heading face
The mono face's larger x-height made code spans in section headings read oversized next to the heading text. Scale to 0.8em with slimmer padding so they sit optically level. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f9865a6 commit 1c13009

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎website/src/styles/theme.css‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,13 @@ div.hero {
4848
--sl-color-gray-7: hsl(38, 52%, 94%);
4949
--sl-color-black: hsl(40, 60%, 96%); /* cream page background */
5050
}
51+
52+
/* Inline code inside headings: the mono face has a larger x-height than the
53+
* heading face, so at the inherited size it reads oversized (and its padded
54+
* background exaggerates it). Scale it down to sit optically level with the
55+
* surrounding heading text. `.sl-markdown-content` matches Starlight's own
56+
* scoping so this wins without !important. */
57+
.sl-markdown-content :is(h1, h2, h3, h4, h5) code {
58+
font-size: 0.8em;
59+
padding-block: 0.05em;
60+
}

0 commit comments

Comments
 (0)