Fix homepage hero not filling viewport#861
Open
RisingOrange wants to merge 1 commit into
Open
Conversation
👷 Deploy request for pauseai pending review.Visit the deploys page to approve it
|
After PauseAI#850 the homepage hero stopped stretching to the bottom of the viewport on screens taller than the hero content. The PR switched `.page-top.hero-page` from `height: 100dvh` to `min-height: 100dvh` and the rewritten `.hero` no longer set `height: 100%`, so on tall viewports `.hero-section` (`flex: 1`) grew but `.hero` inside it stayed content-sized, revealing the section below through the gap. Make `.hero-section` a flex column container and give `.hero` `flex: 1`, so it fills whatever vertical space the flex algorithm gives it while still allowing the hero to grow past 100dvh when content is taller (the reason min-height was used in PauseAI#850). Small cleanups in the same file: - Drop the dead `--hero-img-ar` CSS var (carried over from the previous hero implementation, not referenced after PauseAI#850). - Merge two adjacent `.hero { ... }` rule blocks into one. - Gate the active-campaign badge dot pulse on `@media (prefers-reduced-motion: reduce)` — PauseAI#850's own test plan flagged this as a TODO.
29a8d99 to
0abd519
Compare
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.
Restores the homepage hero stretching to the bottom of the viewport on screens taller than the hero's content, which regressed in #850.
Cause
#850 switched
.page-top.hero-pagefromheight: 100dvhtomin-height: 100dvh(so the new taller hero can grow when its content needs more room), and the rewritten.heroelement no longer setheight: 100%. On viewports taller than the hero's intrinsic content,.hero-section(which isflex: 1) grew to fill the page-top but the.heroblock inside it stayed content-sized, so the section below leaked through the gap at the bottom of the fold.Fix
Make
.hero-sectiona flex column container and give.heroflex: 1, so it stretches to fill whatever space the flex algorithm gives it, while still allowing the hero to grow past 100dvh when content is taller (the reason #850 switched tomin-height).Small cleanups in the same file
--hero-img-arCSS var (carried over from the previous hero implementation, not referenced by any rule after Split hero into generic slogan + current-campaign section #850)..hero { ... }blocks into one.@media (prefers-reduced-motion: reduce)— Split hero into generic slogan + current-campaign section #850's own test plan flagged this as a TODO.Before / after
Desktop (1440×1100)
Tall viewport (half-4K, 1920×2160)
The bug is most pronounced on tall viewports — e.g. a browser taking half the width of a 4K monitor. Before the fix the hero ends about a third of the way down the viewport; after the fix it fills it. Caveat: the protester image gets noticeably more zoomed at this size, since the hero photo is
height: 100%and the hero is now much taller — this is a pre-existing #850 image-treatment artifact that a further design pass is planned to address (light-grey campaign section, smaller heading, replaced photo).Mobile (390×844)
Unaffected — the hero's content already exceeds the viewport at this size, so the layout was already content-sized before this fix and the change is a no-op.
Known issues from #850 not addressed here
Surfaced while testing, scoped out so this PR stays minimal. A further design pass is already planned to address these (light-grey campaign section to differentiate it from the top, smaller campaign heading, replaced photo):
.hero-top-innerhaspadding: 14rem 1.5rem 2remand.hero-top { min-height: 420px }, which combined with the campaign section pushes the campaign CTAs well below the fold on most phones.Test plan