Skip to content

fix(website): prevent playground page from overflowing the viewport - #11428

Open
timotheeguerin wants to merge 1 commit into
microsoft:mainfrom
timotheeguerin:fix/playground-height
Open

fix(website): prevent playground page from overflowing the viewport#11428
timotheeguerin wants to merge 1 commit into
microsoft:mainfrom
timotheeguerin:fix/playground-height

Conversation

@timotheeguerin

Copy link
Copy Markdown
Member

Problem

The /playground page overflows the viewport slightly, adding a vertical scrollbar.

The container hard-coded its height as calc(100vh - var(--header-height)). --header-height is 50px, but the header actually renders at 54px. Since #11292 changed the header from position: fixed (out of flow, overlaid) to position: sticky (in flow) and switched the navbar to min-height and the body to min-height: 100vh, that 4px difference now stacks: 54px + (100vh - 50px) = 100vh + 4px → a small vertical scroll.

This is not related to header wrapping — the overflow is a constant 4px at every width.

Fix

Stop hard-coding the header offset. Make .main a flex column in the base layout and let the playground fill the remaining space with flex: 1, so it always tracks the real rendered header height.

Verification (Chromium / Playwright)

  • Playground: container height = 846px (= 900 - 54), 0 vertical overflow at 1440px and 800px viewports (previously 4px).
  • Regression check on /community, /videos, /blog, /can-i-use/http, and /: rendered page height is identical with .main as a flex column vs. block (diff = 0), so the layout change is neutral for existing pages.

@typespec/website is a private package (not published), so no changelog entry is required.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the meta:website TypeSpec.io updates label Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@azure-sdk-automation

azure-sdk-automation Bot commented Jul 28, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@timotheeguerin
timotheeguerin marked this pull request as ready for review July 28, 2026 19:09
@timotheeguerin
timotheeguerin marked this pull request as draft July 28, 2026 19:09
The playground container hard-coded its height as `calc(100vh - var(--header-height))`. Since microsoft#11292 made the header `position: sticky` (in flow) with a `min-height` navbar, the real rendered header is 54px while `--header-height` is 50px, so the page overflowed by ~4px and showed a vertical scrollbar.

Make `.main` a flex column in the base layout and let the playground fill the remaining space via `flex: 1`, so it tracks the actual header height. Layout-neutral for other pages.
@timotheeguerin
timotheeguerin force-pushed the fix/playground-height branch from 5ce5076 to 11cd741 Compare July 28, 2026 19:16
@timotheeguerin
timotheeguerin marked this pull request as ready for review July 28, 2026 21:25
@timotheeguerin
timotheeguerin enabled auto-merge July 28, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant