Skip to content

fix(docs): keep copy button fixed in horizontally scrollable code blocks#16294

Open
DraXx-Van wants to merge 1 commit into
Automattic:masterfrom
DraXx-Van:fix-copy-button-scroll
Open

fix(docs): keep copy button fixed in horizontally scrollable code blocks#16294
DraXx-Van wants to merge 1 commit into
Automattic:masterfrom
DraXx-Van:fix-copy-button-scroll

Conversation

@DraXx-Van
Copy link
Copy Markdown

Fixes #16293

Summary:

  • Wrap each pre element in a .code-block-wrapper container
  • Move copy button positioning to the wrapper instead of the scrollable pre element
  • Update hover selector to target the wrapper

Result:
The copy button now remains fixed in the top-right corner while horizontally scrolling code blocks.

Tested:

  • Copy button appears on hover
  • Copy functionality still works
  • Button remains fixed during horizontal scrolling
  • Verified on actual Mongoose docs pages using browser overrides

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.

Docs: Copy button becomes misaligned in horizontally scrollable code blocks

1 participant