Skip to content

fix(nav): align sidebar order numbers to the first line of wrapped titles#5

Merged
andybons merged 1 commit into
mainfrom
fix-nav-number-align
Jul 15, 2026
Merged

fix(nav): align sidebar order numbers to the first line of wrapped titles#5
andybons merged 1 commit into
mainfrom
fix-nav-number-align

Conversation

@andybons

Copy link
Copy Markdown
Contributor

Problem

In the docs sidebar, each nav item's order number (01–18) was vertically centered against its title. On titles that wrap to 2–3 lines (guides 11, 12, 13, 14, 17), the number floated to the middle of the block instead of sitting on the first line.

Fix

src/components/NavLink.astro: the number+title flex row used items-center; changed to items-baseline so the number aligns to the title's first line. Added shrink-0 tabular-nums to the number span so its w-6 column can't compress and the digits stay uniform-width.

No other visual change — font, size, color, spacing, hover/active states, and single-line rows are untouched, verified in both themes.

Verification

Built and screenshotted the sidebar with Playwright (light + dark), before and after — numbers 11–18 now sit on the first line of their titles and form a clean straight column; the active-item highlight and single-line rows are unchanged. bunx astro check, bun run lint, bun run build (99 pages) all clean.

…tles

The number/title flex row used items-center, so on titles that wrap to
2-3 lines the number floated to the vertical middle of the block instead
of sitting on the first line. Switch to items-baseline and pin the
number column to a fixed, non-shrinking width with tabular-nums so all
titles start at the same x-position regardless of wrapping.
@andybons
andybons merged commit 40b1faa into main Jul 15, 2026
2 checks passed
@andybons
andybons deleted the fix-nav-number-align branch July 15, 2026 16:10
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