Fix inline code font size in headings#2220
Open
standard-librarian wants to merge 4 commits intoelixir-lang:mainfrom
Open
Fix inline code font size in headings#2220standard-librarian wants to merge 4 commits intoelixir-lang:mainfrom
standard-librarian wants to merge 4 commits intoelixir-lang:mainfrom
Conversation
Inline code inside headings was rendered at the fixed body code size (--text-sm, 0.875rem) regardless of heading level, causing visual inconsistency where code appeared much smaller than the surrounding heading text. Set font-size to 1em inside headings so code inherits and scales with its parent heading's font size. Fixes elixir-lang#2218
Author
Co-authored-by: Eksperimental <eksperimental@autistici.org>
Contributor
|
While it's OK while this is a draft, |
…arian/ex_doc into fix/inline-code-in-headers Merge latest changes
Author
|
@eksperimental thank you for reminding me, i added it to show the new changes and should have removed it once we discussed it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Inline code inside headings was rendered at the fixed body code size (
--text-sm, 0.875rem / 14px) regardless of heading level. Becauseremis root-relative rather than parent-relative, a<code>inside an<h2>(28px on wider screens) rendered at roughly half the size of the surrounding heading text, creating jarring visual inconsistency.Fix: add a single CSS rule in
assets/css/content/code.cssso inline code inside headings usesfont-size: 1em, inheriting and scaling with the parent heading's font size. Both HTML and EPUB outputs share this file so both formats are fixed.Fixes #2218