Skip to content

Commit c64b172

Browse files
committed
fix: code block color
1 parent a0f2d49 commit c64b172

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

components/code/code-block.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export default function CodeBlock({children, className, copyString, preClassName
2121
return (
2222
<div
2323
className={cn(
24-
'relative bg-gray-300 grid grid-cols-6 gap-x-2 w-full dark:bg-gray-700 rounded-md p-4 justify-between',
24+
'relative bg-gray-100 flex gap-x-2 w-full dark:bg-gray-900 rounded-md p-4 justify-between',
2525
className
2626
)}
2727
>
28-
<pre className={cn('text-foreground col-span-5 whitespace-pre-wrap w-full content-center overflow-x-auto', preClassName)}>
28+
<pre className={cn('text-foreground basis-full whitespace-pre-wrap content-center overflow-x-auto', preClassName)}>
2929
{children}
3030
</pre>
3131
<CopyButton content={copyString || children as string} className={'m-0 self-center'}/>

components/code/copy2clipboard.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export default function CopyButton({content, className, ...rest}: CopyButtonProp
2525
}
2626
}, [copied])
2727

28-
const icon = copied ? <ClipboardCheck size={18} className={'text-green-800'}/> : <ClipboardCopy size={18} className={'text-black'}/>
29-
const border = copied ? 'border-green-700' : 'border-gray-500'
30-
const classes = `m-3 text-white bg-gray-300 hover:bg-gray-400 border ${border}`
28+
const icon = copied ? <ClipboardCheck size={18} className={'text-green-600'}/> : <ClipboardCopy size={18} className={'text-black dark:text-white'}/>
29+
const border = copied ? 'border-green-500' : 'border-gray-500'
30+
const classes = `m-3 text-white bg-gray-200 hover:bg-gray-300 dark:bg-gray-800 dark:hover:bg-gray-700 border ${border}`
3131
return (
3232
<Button paddingH={'sm'} onClick={copyToClipboard} className={cn(classes, className)} {...rest}>
3333
{icon}

0 commit comments

Comments
 (0)