Repository navigation
fix(hero): fit the whole hero in the first screen on laptops - #11
Merged
Merged
Conversation
The hero's text column was ~840px tall, so on usual laptop viewports (1366x768 -> ~657px, 1536x864 -> ~750px, 1440x900 -> ~790px) the bio, metrics and part of the CTAs fell below the fold. - New `short` custom variant (max-height: 900px). - The bio keeps its full text but is clamped on short screens (3 lines on lg, 4 on phones) with a "Read more / Show less" toggle (aria-expanded + aria-controls); the full text stays in the DOM. - From lg the hero owns the first screen (min-h-svh, tighter padding on short screens); the name scales with the viewport height (clamp(2.75rem, 7svh, 4.5rem)) and fits one line on laptops; the portrait scales the same way (clamp(8rem, 21svh, 14rem)). - Tighter spacing and metric tiles on short lg screens; below xl the tiles drop their detail line, which wrapped onto two lines there. Measured with headless Edge: the hero now ends inside the viewport at 1024x650, 1024x768, 1180x820, 1280x630, 1366x657, 1536x750, 1440x790, 1920x950, 1366x1024 and 2560x1300 (ES and EN). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
After centring the hero (#10), its text column was still about 840px tall. Usual laptop viewports, after browser chrome, are 630–790px tall (1366×768 → ~657px, 1536×864 → ~750px, 1440×900 → ~790px). The bio, the metrics and part of the CTAs fell below the fold.
Fix
shortcustom variant:@media (max-height: 56.25rem), i.e. 900px or less.lg, 4 on phones). A Read more / Show less toggle (aria-expanded+aria-controls) expands it. The full text stays in the DOM, so screen readers and search engines still get all of it. Tall screens show it unclamped with no toggle.lg: the hero takes the first screen (min-h-svh), with tighter padding on short screens.clamp(2.75rem, 7svh, 4.5rem), and fits on one line on laptops.clamp(8rem, 21svh, 14rem).lgscreens: tighter spacing and compact metric tiles. Belowxlthe tiles drop their detail line, which wrapped onto two lines in the narrower column.Measurements (headless Edge, bottom of the hero content vs viewport height)
1024×768, 1180×820, 1366×1024 and 2560×1300 also fit.
Test plan
npm run checkpasses andnpm run buildpasses.aria-expandedupdating.🤖 Generated with Claude Code