Skip to content

Commit fd9a007

Browse files
fix(templates): website template copy code button darkmode behavior (#9715)
### 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. ```tsx <div className="w-6 h-6 dark:invert"> <CopyIcon /> </div> ``` With div ![image](https://github.com/user-attachments/assets/9ff84539-022a-4b2a-93b8-3b0733b7a915) Without div ![image](https://github.com/user-attachments/assets/b3a2c1e2-5690-4824-9394-fee704170f5c) Light mode is unaffected. ### How? Remove the wrapper div above, leaving only the CopyIcon.
1 parent 67179a7 commit fd9a007

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

templates/website/src/blocks/Code/CopyButton.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ export function CopyButton({ code }: { code: string }) {
2626
}}
2727
>
2828
<p>{text}</p>
29-
30-
<div className="w-6 h-6 dark:invert">
31-
<CopyIcon />
32-
</div>
29+
<CopyIcon />
3330
</Button>
3431
</div>
3532
)

templates/with-vercel-website/src/blocks/Code/CopyButton.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ export function CopyButton({ code }: { code: string }) {
2626
}}
2727
>
2828
<p>{text}</p>
29-
30-
<div className="w-6 h-6 dark:invert">
31-
<CopyIcon />
32-
</div>
29+
<CopyIcon />
3330
</Button>
3431
</div>
3532
)

0 commit comments

Comments
 (0)