docs(site): fix three mobile overflow bugs (hero image, bench button, runs code blocks)#532
docs(site): fix three mobile overflow bugs (hero image, bench button, runs code blocks)#532aallan wants to merge 2 commits into
Conversation
- Hero image overflowed the viewport because .hero-image only set
max-width: 640px, which won the specificity contest against the
global img { max-width: 100% } rule. On a 375px viewport the image
kept its 640px target and ran off the right edge. Added width: 100%
alongside max-width so the image now scales to viewport width up to
640px.
- VeraBench GitHub button was being stretched to 280px on mobile by
a .btn { width: 100%; max-width: 280px } rule meant only for the
hero CTA stack (where buttons stack vertically and benefit from a
full-width target). Scoped that rule to .cta-bar .btn so isolated
buttons elsewhere on the page keep their natural inline-flex width.
- Shell-command code blocks (.runs and .install) ran off the right
edge because <pre> defaults to white-space: pre, which doesn't wrap
long lines like "vera run examples/factorial.vera --fn factorial -- 10".
overflow-x: auto produces a scroll affordance but iOS users have no
good gesture to use it inside a tight column. Added
white-space: pre-wrap; word-break: break-word for .code-block pre
on mobile only. Vera sample blocks (.sample .code) intentionally keep
pre so syntax indentation isn't disrupted at narrow widths.
Verified at 375px viewport: hero image 327px (fits), bench button
143px (inline-sized), runs code blocks scrollWidth === clientWidth
(no overflow). Hero CTA buttons remain stretched at 280px as designed.
Co-Authored-By: Claude <noreply@anthropic.invalid>
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #532 +/- ##
=======================================
Coverage 91.03% 91.03%
=======================================
Files 58 58
Lines 21964 21964
Branches 259 259
=======================================
Hits 19995 19995
Misses 1962 1962
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Closing — folded into the v0.0.120 release PR. The single commit ( Rationale for folding rather than separate-merge:
The v0.0.120 PR is now open as #533. No action needed here. |
Summary
Three mobile overflow bugs in
docs/index.htmlreported on iOS Safari at the iPhone width:vera-benchGitHub button was stretched to a full-width chunky pill instead of sitting inline next to its caption.--fn factorial -- 10.Each had a different root cause; each is fixed with a small CSS change.
Root causes and fixes
1. Hero image overflow
.hero-imagehadmax-width: 640pxbut nowidth: 100%. The globalimg { max-width: 100% }rule was overridden by the more-specific class selector, so on a 375px viewport the image kept a 640px target and overflowed.2. VeraBench button stretched
The mobile media query had
.btn { width: 100%; max-width: 280px }to stretch hero CTA buttons (which stack vertically and benefit from a full-width target). That rule was matching every.btnon the page, including the isolatedvera-benchGitHub button under the bench chart, which has no need to stretch.Scoped to the CTA bar only:
3. Shell code blocks overflow
<pre>defaults towhite-space: pre(no wrapping). Lines likevera run examples/factorial.vera --fn factorial -- 10are wider than a 327px content column.overflow-x: autoproduces a horizontal scrollbar inside the box, but iOS has no good gesture for scrolling inside a narrow card.Added a mobile-only rule that lets shell-command blocks wrap:
+.code-block pre{white-space:pre-wrap;word-break:break-word}Vera sample blocks (
.sample .code) intentionally keeppreso syntax indentation isn't disrupted at narrow widths — only.code-block(used by the runs/install/agents sections, which all hold shell commands) gets the wrap treatment.Verification
At 375x812 viewport:
.hero-imagewidth.bench-body .btnwidth.cta-bar .btnwidth.runs .code-blockoverflowscrollWidth === clientWidth)Test plan
🤖 Generated with Claude Code