Skip to content

fix(theme): clip vertical overflow on code block wrapper to prevent paint leak (#5475) - #5537

Closed
akhilrichie23-sys wants to merge 1 commit into
vuejs:mainfrom
akhilrichie23-sys:fix/5475-codeblock-overflow-y-clip
Closed

akhilrichie23-sys wants to merge 1 commit into
vuejs:mainfrom
akhilrichie23-sys:fix/5475-codeblock-overflow-y-clip

Conversation

@akhilrichie23-sys

Copy link
Copy Markdown

Description

Adds overflow-y: clip to .vp-doc div[class*='language-'] and .vp-block alongside overflow-x: auto.

Under the CSS Overflow specification, setting overflow-x: auto alone causes overflow-y to compute to auto rather than visible. In WebKit/Safari, this turns the rounded outer code block wrapper into an active vertical scroll container, causing paint invalidation and compositing layer boundaries to leak the container's background and horizontal scrollbar over subsequent paragraphs on initial render. Adding overflow-y: clip explicitly forbids vertical scrollport creation and strictly bounds the vertical paint edge.

Linked Issues

Fixes #5475

Additional Context

  • Horizontal scrolling remains fully handled by the inner pre element.
  • Unlike overflow-y: hidden, overflow-y: clip prevents vertical scroll container creation altogether without creating a secondary scrollport.
  • Copy buttons, line numbers, and language badges are positioned within the container and remain unaffected.

@posva posva closed this Oct 15, 2026
@brc-dd brc-dd added the invalid This doesn't seem right label Oct 15, 2026
@vuejs vuejs locked as spam and limited conversation to collaborators Oct 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Large code block can paint over the following paragraph on initial render

3 participants