Skip to content

fix(theme): use will-change transform on code block container to prevent paint overflow (#5475) - #5532

Closed
akhilrichie23-sys wants to merge 1 commit into
vuejs:mainfrom
akhilrichie23-sys:fix/5475-codeblock-will-change
Closed

akhilrichie23-sys wants to merge 1 commit into
vuejs:mainfrom
akhilrichie23-sys:fix/5475-codeblock-will-change

Conversation

@akhilrichie23-sys

Copy link
Copy Markdown

Description

Replaces redundant overflow-x: auto with will-change: transform on .vp-doc div[class*='language-'] and .vp-block.

In WebKit/Safari renderers, nested horizontal scroll containers (outer div + inner pre) combined with compositing layer bounds can fail to isolate paint invalidations, causing the code block's background and horizontal scrollbar to paint over following paragraphs on initial page loads or scroll. Applying will-change: transform instructs the browser to promote the code block container to its own compositing layer ahead of time, ensuring dedicated paint boundaries while eliminating the redundant outer scroll container.

Linked Issues

Fixes #5475

Additional Context

  • Horizontal scrolling remains fully handled by the inner pre element.
  • Copy buttons, line numbers, and language badges are positioned within the container and remain unaffected.

@brc-dd

brc-dd commented Oct 13, 2026

Copy link
Copy Markdown
Member

doesn't fix the issue

@brc-dd brc-dd closed this Oct 13, 2026
@brc-dd brc-dd added the invalid This doesn't seem right label Oct 13, 2026
@vuejs vuejs locked as spam and limited conversation to collaborators Oct 13, 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

2 participants