Repository navigation
fix(theme): align inline code to the text baseline - #13065
ziyodovanvar wants to merge 1 commit into
Conversation
Infima vertically centers the inline code box. The box is taller than the surrounding text, so the glyphs sit below the baseline. Align inline code to the baseline instead. Fixes meta#10652
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Pre-flight checklist
Motivation
Fixes #10652.
Infima sets
vertical-align: middleon everycodeelement. Inline code also has vertical padding, so the box is taller than the surrounding text and the glyphs sit below the text baseline. This is most obvious in headings.CodeInlinenow aligns that box to the baseline. Code blocks are unchanged, because they do not use this component.Test Plan
pnpm exec vitest run packages/docusaurus-theme-classic/src/theme/CodeInline/__tests__/index.test.tsxvertical-align: middledrops the code below the line, andvertical-align: baselinekeeps the glyphs on the text baseline.Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs
Summary by CodeRabbit