Skip to content

Add copy buttons to code blocks#8

Open
ritorhymes wants to merge 1 commit into
eips-wg:masterfrom
ritovision:copy-code
Open

Add copy buttons to code blocks#8
ritorhymes wants to merge 1 commit into
eips-wg:masterfrom
ritovision:copy-code

Conversation

@ritorhymes

@ritorhymes ritorhymes commented Apr 24, 2026

Copy link
Copy Markdown

Description

This PR adds copy buttons to fenced code blocks across the site.

Demo site: wg-eips.ritovision.com/721/

This improves usability for pages with command snippets and longer code examples by making it easier to copy code directly from the page.

The button stays hidden by default, appears fixed on the top right when a code block is hovered or focused, and provides visible success and failure states after interaction. The implementation is theme-only and uses a small client-side script plus shared styling.

Screenshots

Default - hidden

default-hidden

Code block hover / touch revealed

copy-icon-revealed

Icon hovered

copy-icon-revealed-hover

Icon focused

copy-icon-focused

Successful copy

copy-icon-success

Failed copy

copy-icon-failure

@ritorhymes ritorhymes marked this pull request as draft April 24, 2026 12:06
@ritorhymes ritorhymes marked this pull request as ready for review April 24, 2026 12:32
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.

1 participant