Skip to content

fix(website): /features/* sidebar overlapping article in compact view#187

Merged
montfort merged 1 commit into
mainfrom
fix/website-features-sidebar-mobile-overlap
May 21, 2026
Merged

fix(website): /features/* sidebar overlapping article in compact view#187
montfort merged 1 commit into
mainfrom
fix/website-features-sidebar-mobile-overlap

Conversation

@montfort
Copy link
Copy Markdown
Contributor

Summary

Three related fixes in website/src/components/FeaturesLayout/styles.module.css that resolve the overlapping sidebar / article visible at compact-to-mobile widths.

Root cause: CSS source-order bug

The base .sidebar rule sets position: sticky. The @media (max-width: 996px) block resets it to position: static. But in the source, the media query came before the base rule — so the cascade (later rule wins at same specificity) put position: sticky back on top. Result: the sidebar stayed sticky at every viewport width, and once the article scrolled past it, the article bled through the transparent sticky element.

Fix: move both media queries to the bottom of the file so the mobile overrides actually apply.

Defensive: opaque background on the sticky sidebar

Added background: var(--ifm-background-color); z-index: 1; to the desktop .sidebar. Even on wide viewports, if something else ever scrolls beneath, it won't bleed through. Belt-and-suspenders against the kind of bug we just hit.

True mobile: hide the sidebar entirely (<640px)

At narrow widths, the 9-entry list was pushing the article half a screen down before the user could read any content. Cleaner to send phone-sized visitors straight to the article. Tablet range (640–996px) keeps the stacked-above behavior the user already saw working in their first screenshot.

What each breakpoint looks like now

Viewport Layout
>996px (desktop) Two columns. Sidebar 240px, sticky, opaque background.
640–996px (tablet) Single column. Sidebar block stacks above the article.
<640px (mobile) Single column. Sidebar hidden; article tightened a touch (h1 to 1.75rem, padding tightened).

Test plan

  • npm run build succeeds for all three locales (verified locally).
  • DevTools width 1200px → two columns, sidebar sticky at the top while scrolling. Scrolling the article does not bleed through.
  • DevTools width 800px → single column, "What's in the box" block stacks above the article. No overlap on scroll.
  • DevTools width 400px → sidebar gone; article takes the full width; h1 smaller; padding tighter.

🤖 Generated with Claude Code

Three related fixes in FeaturesLayout/styles.module.css:

- **Source-order bug.** The @media (max-width: 996px) block came BEFORE
  the base .sidebar rule, so the base `position: sticky` was overriding
  the mobile `position: static` due to cascade order. Moved both media
  queries to the bottom of the file so the overrides actually apply.
- **Defensive opaque background.** Added background-color + z-index to
  the sticky sidebar at desktop sizes — if anything else ever scrolls
  beneath, it won't bleed through.
- **Hide the sidebar entirely below 640px.** At true mobile widths the
  9-entry list pushes the article half a screen down before the user
  sees any content; cleaner to send them straight to the article. They
  can use the home grid to switch features.

Tablet range (640–996px) keeps the stacked-above behavior; desktop
(>996px) keeps two columns with a sticky sidebar.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@montfort montfort merged commit 00c0fbd into main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant