Skip to content

Only show the copy button when hovering #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tomasr8 opened this issue May 19, 2025 · 6 comments
Open

Only show the copy button when hovering #242

tomasr8 opened this issue May 19, 2025 · 6 comments
Assignees
Labels

Comments

@tomasr8
Copy link
Member

tomasr8 commented May 19, 2025

(Reported by @StanFromIreland on Discord)

The new copy button can sometimes cover part of the source code:
https://docs.python.org/dev/library/string.html#format-examples

Image

We can fix this by making the copy button appear only when hovered.

Please don't pick up this issue, I'd like to reserve it for someone at the PyConUS sprints :)

@StanFromIreland
Copy link

Please don't pick up this issue, I'd like to reserve it for someone at the PyConUS sprints :)

You should probably add it to the project, I doubt many will check this issue tracker.

@hugovk hugovk added help wanted good first issue Good for newcomers labels May 19, 2025
@encukou
Copy link
Member

encukou commented May 19, 2025

Please keep it possible to copy from a touchscreen.
It might be better to add padding-right, so users can scroll past the button.

@StanFromIreland
Copy link

It might be better to add padding-right, so users can scroll past the button.

That would be good, but to indicate there is text behind it making it somewhat transparent too would be nice IMO.

@tomasr8
Copy link
Member Author

tomasr8 commented May 19, 2025

Please keep it possible to copy from a touchscreen. It might be better to add padding-right, so users can scroll past the button.

The example given on discord (https://pradyunsg.me/furo/kitchen-sink/blocks/#literal-blocks) allows that by first tapping on the codeblock (probably some :active/:focus CSS rule) which I think is also fine, but a padding would work too

@kevteg
Copy link
Contributor

kevteg commented May 20, 2025

I'm taking a look

@kevteg
Copy link
Contributor

kevteg commented May 21, 2025

I fixed the issue in this PR. I decided to go with the hover approach, I think it looks better than the padding-right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants