Skip to content

docs: align the landing-page link with the menu bar's icons - #4

Merged
clhodapp merged 1 commit into
mainfrom
fix/menu-bar-link-alignment
Sep 1, 2026
Merged

clhodapp merged 1 commit into
mainfrom
fix/menu-bar-link-alignment

Conversation

@clhodapp

@clhodapp clhodapp commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The landing-page link added in #3 sat slightly above the print and repository icons beside it, and its right-hand gap was wider than the gap between those icons.

Cause

The link was an inline-flex box with an explicit height. An inline-level flex box aligns on its own baseline rather than filling the parent's line box, so it rode high next to buttons that mdBook centers with line-height: var(--menu-bar-height).

What changed

The box aligns to the top of the line box, where its full-bar height makes it fill the bar exactly, and the flex row centers the mark against the word inside it. The right padding drops from 8px to 2px: the next button contributes its own 8px on that side, so a symmetric 8px left a visibly wider gap there than between the icons themselves.

Only site/docs-brand.css changes; the template from #3 is untouched.

Verification

Checked against a local build of the book rather than by inspection: the position and spacing were confirmed in a browser at each step. mdbook build succeeds and the link renders on all 18 reader-facing pages.

The link sat above the icons beside it. An inline-flex box with an
explicit height aligns on its own baseline rather than filling the
line box, so it rode high against buttons that mdBook centers with a
line-height of the menu bar's height.

Align the box to the top of the line box, where its full-bar height
makes it fill the bar, and let the flex row center the mark against
the word inside it. Trim the right padding to 2px: the next button
brings its own 8px on that side, so a symmetric 8px left a visibly
wider gap there than between the icons.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@clhodapp clhodapp self-assigned this Sep 1, 2026
@clhodapp
clhodapp merged commit 7d79d08 into main Sep 1, 2026
2 checks passed
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