codu-code / codu

Codú's open-source codebase. A space for coders. Visit our community!
https://codu.co/
Apache License 2.0
121 stars 92 forks source link

Show copy code block icon only on hover #344

Closed praveen-quizizz closed 1 year ago

praveen-quizizz commented 1 year ago

Expected Behavior

The copy icon should be displayed when the user hovers over the code block.

Current Behavior

Currently the icon is always visible leading to poor reading experience.

Screenshots

image

Steps to reproduce

Please provide detailed steps for reproducing the issue

  1. Goto any article with code block e.g. https://www.codu.co/articles/setting-up-metacall-development-environment-on-windows-jxk6iltl
github-actions[bot] commented 1 year ago

Hello @praveen-quizizz, thanks for opening your first issue! your contribution is valuable to us. The maintainers will review this issue and provide feedback as soon as possible.

Shane-Donlon commented 1 year ago

Hi Praveen,

Requirements update:

  1. The copy / clipboard button should be visible for mobile.
  2. The code excerpt / text should be completely visible to reduce side-scrolling.
  3. On desktop the copy / clipboard button should be visible on mouse hover.

Thanks, Shane

sudarshansb143 commented 1 year ago

@NiallJoeMaher Suggested enhancement here. Is the underlined empty space on code block is is needed or we can make copy code button positioning absolute so that it will remove this empty space ? image

Ex. image

NiallJoeMaher commented 1 year ago

Thanks for that @sudarshansb143! We did that. 🥳