From 4562b92498bd794da4058a87c0c5cbb0d048f047 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 18 Apr 2026 19:27:34 +0200 Subject: fix: code block copy icon, light theme bg, horizontal scroll - Use .icon-copy/.icon-check classes on tags so Feather preserves them on generated ; 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 --- themes/danix-xyz-hacker/assets/js/code-copy.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'themes/danix-xyz-hacker/assets/js') 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 = ''; -- cgit v1.2.3