Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates): website template copy code button darkmode behavior #9715

Conversation

MotorcycleEnjoyer
Copy link
Contributor

What?

Makes copybutton's CopyIcon behave as expected in darkmode.

Why?

CopyIcon inverts on its own now and has a preset size.
Therefore this wrapper div creates unwanted behavior and is not needed anymore.

<div className="w-6 h-6 dark:invert">
    <CopyIcon />
</div>

With div
image
Without div
image
Light mode is unaffected.

How?

Remove the wrapper div above, leaving only the CopyIcon.

@paulpopus
Copy link
Contributor

Thank you for catching and fixing this! Could you replicate this for the Vercel website template too please? https://github.com/payloadcms/payload/blob/main/templates/with-vercel-website/src/blocks/Code/CopyButton.tsx

I'll merge your PR after that

@paulpopus paulpopus enabled auto-merge (squash) December 3, 2024 23:31
@paulpopus paulpopus merged commit fd9a007 into payloadcms:main Dec 3, 2024
53 checks passed
Copy link
Contributor

github-actions bot commented Dec 4, 2024

🚀 This is included in version v3.4.0

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