fix(theme): keep the page card clear of the full-bleed hero - #189
Merged
Merged
Conversation
The hero pulls itself up by the doc's top padding to reach the nav. Below the outline breakpoint the card is mounted ahead of it in doc-before, and adjacent margins collapse the card's 20px bottom margin with that pull into -12px, so the photo cut the card's bottom edge off. Give the pair a real gap where the card is the hero's preceding sibling. Above 1280px the card moves to the aside and the pull stays as it was, so the rule is scoped to screen widths below that breakpoint.
Deploying documents with
|
| Latest commit: |
4b74f5f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e09a332e.documents-dq4.pages.dev |
| Branch Preview URL: | https://fix-hero-card-spacing-mobile.documents-dq4.pages.dev |
Member
The card had the doc's top inset above it and 20px below, which read as the photo crowding the card. Name the inset once and reuse it, so the two sides agree at both of the widths where .VPDoc changes its padding.
Contributor
Author
|
@wen-templari thanks — the two gaps were 32px above the card and 20px below it. Now the hero takes the same inset the card sits under, so both sides agree: 32/32 below 768px and 48/48 above it, where The value is named once as 4b74f5f is up; the preview will be rebuilt when it lands. |
wen-templari
approved these changes
Sep 28, 2026
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.

Closes #182
Summary
/repair/and the other hero pages had the page card (维护 / 最近 / 在本页编辑) cut off by the hero photo at narrow viewports.The hero escapes the doc's top padding with
margin-top: -32pxso it can bleed under the nav. Below the outline breakpoint the card is mounted indoc-before, directly ahead of it, and adjacent margins collapse the card's20pxbottom margin with that pull into-12px— the photo then overlaps the card by 12px. The rule gives the pair a real 20px gap where the card is the hero's preceding sibling, scoped toscreenand to widths under 1280px, since above that the card moves to the aside and the bleed is unchanged.Scope
Checklist
Verification
pnpm run ci:lint—ci:lint:eslintandci:lint:markdownboth cleanpnpm test -- --run— 156 passed; the 2 failures reproduce on a cleanmaincheckout and are Windows CRLF artifacts (maintainers:\r\nmisses the regex, andgit hash-objectdisagrees with the CRLF working tree)pnpm docs:buildLayout measured in the browser rather than by eye: at a 390px viewport the card-to-content gap was
-12pxbefore and is20pxafter on/repair/,/about/what-is-nbtca,/concepts/and/repair/guide; at 1360px the hero keepsmargin-top: -32px.Notes
Two things found while measuring, deliberately left out of this PR:
width: 100vwis wider than the content box whenever the viewport has a classic scrollbar, so those pages scroll sideways by ~8px (scrollWidth383 vsclientWidth375 at 390px). Invisible on mobile browsers with overlay scrollbars. Fixing it properly means dropping100vwfor negative margins pluswidth: auto, as thehas-sidebarrule already does.aside: falsepages (/repair/,/about/what-is-nbtca) render no card at all at ≥1280px: the inline card is hidden and the aside column itself is not mounted, so the maintainer card disappears on wide screens.