docs: place Copy page control below the title on small screens - #491
Conversation
Teleport the control to right after the page H1 once mounted (and after each client-side page change), so it sits directly under the heading, left-aligned, on narrow screens while staying on the title row on wide screens. Falls back to the doc-before slot before hydration or when a page has no H1. Also keeps the menu links neutral now that they render inside .vp-doc.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 14 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The menu now renders inside .vp-doc, where the theme's `.vp-doc a:hover` would tint the links brand-blue; set the hover colour explicitly.
4f2b830 to
f0a327f
Compare
What
Follow-up to #490. On small screens the Copy page control now sits directly below the page heading, left-aligned (in flow, before the first paragraph) instead of above the title. Wide screens are unchanged (same row as the title, right edge of the text column).
How
CopyPageMenu.vue— the control is wrapped in a<Teleport>. After mount, and after every client-side page change (onContentUpdated), it inserts a small.copy-page-slothost right after the page<h1>and teleports itself there. Before hydration, or if a page has no H1, it renders in place in thedoc-beforeslot as before. Copy/menu behaviour is unchanged. On <768px the button is left-aligned and the menu anchors to the button's left edge.style.css— placement rules cover both positions: <768px → in-flow block under the H1 (pre-teleport position hidden to avoid a jump on load); ≥768px → identical absolute placement, with the H1 padding reserve viah1:has(+ .copy-page-slot > .copy-page). The.vp-doc a …colour rules exclude.copy-page__item, since the menu links now live inside.vp-doc.Verified
pnpm previewbuild: mobile shows H1 → Copy page → paragraph, menu opens left-anchored, links keep neutral colour; desktop geometry identical to before; SPA navigation moves the control under the new page's H1 and closes the menu; home (copyPage: false) has none; no Vue/Teleport/hydration warnings.pnpm buildclean; SSR HTML unchanged apart from the teleport marker;pnpm check:formatpasses.