summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker/assets/js/code-copy.js
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-18 19:27:34 +0200
committerDanilo M. <danix@danix.xyz>2026-04-18 19:27:34 +0200
commit4562b92498bd794da4058a87c0c5cbb0d048f047 (patch)
tree08cf251868c760e6d5144ae3a0351e0320b3568f /themes/danix-xyz-hacker/assets/js/code-copy.js
parent17048ab79312f1752a296ab150984a4ef30aed5c (diff)
downloaddanixxyz-4562b92498bd794da4058a87c0c5cbb0d048f047.tar.gz
danixxyz-4562b92498bd794da4058a87c0c5cbb0d048f047.zip
fix: code block copy icon, light theme bg, horizontal scroll
- Use .icon-copy/.icon-check classes on <i> tags so Feather preserves them on generated <svg>; fixes copy button not swapping to checkmark - Add .chroma to light theme background override so #eff1f5 applies correctly - Change .chroma overflow: hidden to overflow-x: auto to restore horizontal scrolling for long code lines Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'themes/danix-xyz-hacker/assets/js/code-copy.js')
-rw-r--r--themes/danix-xyz-hacker/assets/js/code-copy.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/themes/danix-xyz-hacker/assets/js/code-copy.js b/themes/danix-xyz-hacker/assets/js/code-copy.js
index bfcfd4a..8591436 100644
--- a/themes/danix-xyz-hacker/assets/js/code-copy.js
+++ b/themes/danix-xyz-hacker/assets/js/code-copy.js
@@ -53,16 +53,16 @@
if (!text) return;
navigator.clipboard.writeText(text).then(function () {
- var copyIcon = btn.querySelector('[data-feather="copy"]');
- var checkIcon = btn.querySelector('[data-feather="check"]');
+ var copyIcon = btn.querySelector('.icon-copy');
+ var checkIcon = btn.querySelector('.icon-check');
var liveRegion = wrapper.querySelector('.code-copy-status');
- if (copyIcon) copyIcon.style.display = 'none';
+ if (copyIcon) copyIcon.classList.add('hidden');
if (checkIcon) checkIcon.classList.remove('hidden');
btn.classList.add('is-copied');
if (liveRegion) liveRegion.textContent = 'Code copied to clipboard.';
setTimeout(function () {
- if (copyIcon) copyIcon.style.display = '';
+ if (copyIcon) copyIcon.classList.remove('hidden');
if (checkIcon) checkIcon.classList.add('hidden');
btn.classList.remove('is-copied');
if (liveRegion) liveRegion.textContent = '';