Closed dviererbe closed 9 months ago
According to the copybutton docs, the button should be hidden by default and only be displayed on hover. I wonder what in our setup prevents this from happening? Fixing whatever breaks this behaviour would be the best solution imo.
Otherwise, my personal preference would be option 3, because it shows that a button is there. While option 1 is what the extension is supposed to do, so I'm fine with that as well. Option 2 could be confusing, I think people might not find the button in this case.
The copy button of code-blocks can hide content, see for example:
rendered as:
I propose three possible solutions:
Hide button on mouse hover over the code block unless the mouse hovers over the copy button
<pre>
element below the copy button, therefore the button can not cover any content.This would look like this
Note: GitHub seems to solve this by hiding the copy button when you start scrolling or selecting text. It also start to show the copy button as soon as the mouse is near the copy button. I think they use javascript, because I could not find any
:hover
css for the copy button. Try it out for yourself:Note: I also noted that there is margin on the left side on the code block, but not on the right. Is this on purpose? See image above.
Note: There also seems to be problems with the "Copied!" text, when you click on the button and content is below: