Skip to content

fix: restore copy icon visibility on code block hover#2944

Open
donjo wants to merge 1 commit intomainfrom
worktree-fix-copy-icon-hover
Open

fix: restore copy icon visibility on code block hover#2944
donjo wants to merge 1 commit intomainfrom
worktree-fix-copy-icon-hover

Conversation

@donjo
Copy link
Member

@donjo donjo commented Mar 2, 2026

Summary

  • The copy icon SVG path was using fill="hsla(var(--foreground-secondary))", referencing a CSS variable (--foreground-secondary) that doesn't exist in Tailwind v4 — the correct variable name is --color-foreground-secondary
  • This made the icon's fill resolve to an invalid/transparent value, so the icon was invisible even though the button itself was present and functional
  • Changed fill to currentColor so the icon inherits the correct color from the button's existing text-foreground-secondary CSS class

Test plan

  • Hover over a code block — copy icon should now be visible in the top-right corner
  • Click the copy icon — text should copy and checkmark should appear
  • Verify in both light and dark mode

The SVG path fill was using `hsla(var(--foreground-secondary))` which
references a CSS variable that doesn't exist in Tailwind v4 — the correct
variable is `--color-foreground-secondary`. This made the copy icon
invisible while the button itself was still present and clickable.

Changed the fill to `currentColor` so the icon inherits the correct color
from the button's `text-foreground-secondary` CSS class.
@donjo donjo requested a review from thisisjofrank March 2, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant