fix(website): /features/* sidebar overlapping article in compact view#187
Merged
Merged
Conversation
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>
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.
Summary
Three related fixes in
website/src/components/FeaturesLayout/styles.module.cssthat resolve the overlapping sidebar / article visible at compact-to-mobile widths.Root cause: CSS source-order bug
The base
.sidebarrule setsposition: sticky. The@media (max-width: 996px)block resets it toposition: static. But in the source, the media query came before the base rule — so the cascade (later rule wins at same specificity) putposition: stickyback 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
>996px(desktop)640–996px(tablet)<640px(mobile)h1to 1.75rem, padding tightened).Test plan
npm run buildsucceeds for all three locales (verified locally).h1smaller; padding tighter.🤖 Generated with Claude Code