Keep the pinned sidebar and ToC from scrolling away under the widget - #4008
Open
paoloredis wants to merge 1 commit into
Open
paoloredis wants to merge 1 commit into
paoloredis wants to merge 1 commit into
Conversation
The Qualified widget stamps its overflow trap on <main> with contain: layout !important. Layout containment makes <main> the containing block for every position: fixed descendant, so the pinned left sidebar (nav#sidebar, position: fixed) and the right table of contents scroll away with the page content on every browser where the widget runs. This is why the rails stay pinned in a Firefox profile with tracking protection (widget blocked) but vanish in Chrome. The widget adds the containment to keep float-based layouts from collapsing under its overflow: clip override. Our <main> has no floated children (verified: zero floats, main height identical with and without containment), so dropping it is safe. The rule is element-qualified (main[data-q-overflow-trap]) to out-rank the widget's attribute-only selector, and only matches while the widget has marked the element. Verified on the live staging page in both Chrome and Firefox: with the rule injected, the sidebar and ToC stay pinned at their offsets while the page scrolls; without it they leave the viewport. Page height and scroll range unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at a44fc6c |
|
|
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.
The Qualified widget stamps its overflow trap on
with contain: layout !important. Layout containment makes the containing block for every position: fixed descendant, so the pinned left sidebar (nav#sidebar, position: fixed) and the right table of contents scroll away with the page content on every browser where the widget runs. This is why the rails stay pinned in a Firefox profile with tracking protection (widget blocked) but vanish in Chrome.The widget adds the containment to keep float-based layouts from collapsing under its overflow: clip override. Our
has no floated children (verified: zero floats, main height identical with and without containment), so dropping it is safe. The rule is element-qualified (main[data-q-overflow-trap]) to out-rank the widget's attribute-only selector, and only matches while the widget has marked the element.Verified on the live staging page in both Chrome and Firefox: with the rule injected, the sidebar and ToC stay pinned at their offsets while the page scrolls; without it they leave the viewport. Page height and scroll range unchanged.
Note
Low Risk
Single scoped CSS override active only when the third-party widget marks
<main>; intended to restore fixed positioning without changing scroll height.Overview
Adds a Qualified widget override so pinned doc chrome stays fixed while scrolling.
When the widget marks
<main>withdata-q-overflow-trap, it appliescontain: layout, which turns<main>into the containing block forposition: fixedelements. That caused the left sidebar and right table of contents to scroll with the page instead of staying pinned (notably in Chrome when the widget loads).The new rule
main[data-q-overflow-trap] { contain: none !important; }drops that containment only while the widget has stamped<main>, using an element-qualified selector so it wins over the widget’s attribute-only rule. Comments note this is considered safe here because<main>has no floated children—the containment was only to protect float layouts under the widget’s overflow clip.Reviewed by Cursor Bugbot for commit a44fc6c. Bugbot is set up for automated code reviews on this repo. Configure here.