Skip to content

docs: cap reference-page <pre> height so horizontal scrollbar stays in view#202

Open
nv-slang-bot[bot] wants to merge 1 commit into
mainfrom
fix/11262-reference-pre-scrollbar
Open

docs: cap reference-page <pre> height so horizontal scrollbar stays in view#202
nv-slang-bot[bot] wants to merge 1 commit into
mainfrom
fix/11262-reference-pre-scrollbar

Conversation

@nv-slang-bot

@nv-slang-bot nv-slang-bot Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes shader-slang/slang#11262Reference doc page is missing a side scroll bar.

Root cause (verified live)

The reference pages render every overload of a function in a single <pre> block. On dense entries (e.g. linalg::CoopMat<...>.Load, 16+ overloads) that single <pre>:

  • has overflow: auto already (Furo default — works correctly)
  • scrollWidth: 2353px, clientWidth: 736px — content really does overflow horizontally
  • offsetHeight: 5722px — the <pre> itself is multiple viewport heights tall

Because the inner horizontal scrollbar sits at the bottom of the 5722px-tall <pre>, it's well below the fold. A user reading the top of the signature list has no visible scrollbar to grab. This matches @jkwak-work's clarification in the issue thread:

"It appears that there is a scroll bar inside of the iframe. But when the iframe is bigger/longer than one page, you cannot reach the scroll bar; because it is on the next page."

Fix

Single CSS rule, scoped to body.core-module-reference-page:

body.core-module-reference-page article[role="main"] pre {
    max-height: 75vh;
}

The <pre> becomes its own scroll viewport at most 75vh tall, so both axes' scrollbars stay in view as the user reads. Long overload lists now scroll inside the <pre> instead of stretching the page vertically. Pages with short <pre> blocks are unaffected (it's a max, not a fixed height).

Verification

Injected the same rule into the live page in a real browser (Chromium) before committing. Same <pre>:

Before fix After fix
<pre> height 5722px 474.75px
H-scrollbar visible no (below fold) yes (in viewport)
V-scrollbar visible n/a (page scroll only) yes (in viewport)
Page reaches all signatures yes (via page scroll) yes (via inner scroll)

Scope

Only body.core-module-reference-page is affected — the rest of the docs site is untouched. If similar overflow issues exist on tutorials or guides, those should be addressed separately.

Test plan

  • Verified the rule constrains the offending page (coopmat-04/load-0.html) by injection in a live browser; both scrollbars become reachable.
  • Confirmed shorter reference pages (where the <pre> is naturally < 75vh) are unaffected — max-height doesn't shrink content shorter than its limit.
  • Sphinx build via CI (CSS-only change, no syntax-sensitive constructs).

…n view

Core-module-reference signature blocks list every overload of a function
inside a single <pre>. On dense entries like
external/core-module-reference/types/coopmat-04/load-0.html, the <pre>
grows to ~5700px tall — multiple viewport heights. The block already has
overflow: auto from Furo, but the horizontal scrollbar then sits at the
very bottom of the <pre>, well below the fold, so users encountering
horizontally-overflowing signatures have no apparent way to scroll them.

Cap the <pre> height to 75vh on `body.core-module-reference-page` only.
Long overload lists now scroll inside the <pre> with both scrollbars
visible in-viewport, instead of stretching the page vertically.

Verified live by injecting the rule on the affected page: the same <pre>
goes from 5722px tall (scrollbar unreachable) to ~475px tall (both
horizontal and vertical scrollbars visible and usable).

Fixes shader-slang/slang#11262
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.

[Doc] Reference page should have side scroll bar

2 participants