Skip to content

docs: make article headings one step smaller - #1362

Merged
kimpenhaus merged 1 commit into
mainfrom
docs/smaller-headings
Dec 2, 2026
Merged

kimpenhaus merged 1 commit into
mainfrom
docs/smaller-headings

Conversation

@kimpenhaus

Copy link
Copy Markdown
Collaborator

Summary

Infima, the CSS framework that Docusaurus ships, enlarges headings inside docs articles to 3rem for the title, 2rem for h2 and 1.5rem for h3. Next to the body text they dominate the page, especially in the dark theme, and more so since the split migration pages (#1361) have many h2 sections.

Level Infima (≥ 577px) New
Page title (h1) 3rem 2.25rem
h2 2rem 1.6rem
h3 1.5rem 1.3rem
  • Phones (≤ 576px) keep Infima's mobile sizes (2rem / 1.5rem / 1.25rem).
  • The title rule (.plugin-docs header > h1:first-child) also covers the generated category pages. They copy the 3rem title into their own CSS module class (.title_*), so .markdown h1 does not reach them.
  • The rules only override Infima's --ifm-hN-font-size variables and use Infima's own selectors. They load after Infima and win by source order or specificity.

Checks

  • npm run build passes, and the rules are in the bundle after Infima's.
  • Checked in the dev server on a doc page and on a generated category page.
  • /code-review: one finding, fixed. h2 and h3 grew on phones, because the overrides applied at every width. All rules are now in one min-width: 577px block.
  • /simplify: moved to Infima's selectors and the plugin-docs class on <html> instead of layout classes (.main-wrapper main), and put everything under one breakpoint instead of the sidebar breakpoint 997px. Nothing to fix for reuse or efficiency.
  • /security-review: no findings. The change is static CSS without url(), @import, attribute selectors or content.

Infima sizes article headings at 3rem (title), 2rem (h2) and 1.5rem (h3), which dominates the
page, more so in the dark theme. From 577px up they are now 2.25rem, 1.6rem and 1.3rem; phones
keep the theme's smaller sizes. The title rule also covers generated category pages, which
duplicate the 3rem title in their own CSS module.
@kimpenhaus
kimpenhaus enabled auto-merge (squash) December 2, 2026 21:06
@kimpenhaus
kimpenhaus merged commit c0b7d20 into main Dec 2, 2026
7 checks passed
@kimpenhaus
kimpenhaus deleted the docs/smaller-headings branch December 2, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant