fix(web): re-centre minimized hero pill#218
Conversation
The scroll-hint sentinel is a 1px element, but it was an in-flow child of the flex-row hero section, so it claimed half the row and pushed the hero content into the right half (the title floated up-right instead of centring). Pin it absolutely at the section top — it still drives the scroll-hint IntersectionObserver but no longer affects layout, so the hero content centres on the section again. Also tidy the minimized state into a compact, self-hugging chip: the expand toggle now flows inline beside the title (width: fit-content + flex gap) instead of pinning to the card corner with the title balanced to centre via margins, which had stranded the icon far from the text. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single CSS file ( ChangesHero CSS Layout Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
What
Fixes the misaligned hero on the home page (the minimized "Shaping Tomorrow's Technology" pill).
1. Re-centre the hero (primary fix)
The scroll-hint sentinel — a 1px element added for the scroll-to-explore IntersectionObserver — was an in-flow child of the
display:flexhero section. A flex row split the width between the sentinel and the hero content, so the content was shoved into the right half of the section (the title floated up-and-right instead of centred).Pinning the sentinel with
position:absolute; top:0takes it out of layout flow. It still enters/leaves the viewport at the top of the page so the scroll hint toggles exactly as before — but the hero content now centres on the section again.Measured (1600px viewport, sidebar 220px → section centre = 910px):
2. Compact minimized chip (secondary polish — separable)
The minimized pill stretched to a fixed 520px with the expand toggle pinned to the top-left corner and the title centred via balancing margins, which left a wide empty gap between the icon and the text. It's now a compact, self-hugging chip (
width: fit-content, flex row, toggle inline before the title). If you preferred the original corner-toggle style, this is an isolated hunk and trivial to drop — the centring fix above stands on its own.Verification
vite buildgreen; rooteslintclean..minimizedrules only apply with that class).CSS-only; one file (
hero.module.css).🤖 Generated with Claude Code
Summary by CodeRabbit