Skip to content

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

Merged
donjo merged 2 commits intomainfrom
worktree-fix-copy-icon-hover
Mar 5, 2026
Merged

fix: restore copy icon visibility on code block hover#2944
donjo merged 2 commits 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
Copy link
Collaborator

@thisisjofrank thisisjofrank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch!

@donjo donjo enabled auto-merge (squash) March 5, 2026 19:29
@donjo donjo merged commit 4d98977 into main Mar 5, 2026
2 checks passed
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.

2 participants