style: add automatic colors to code

This commit is contained in:
robin committed 2026-08-04 15:53:13 +02:00
1 parent 14be41befd
commit 592b1a158a
7 files changed
+309 -4

No files matched your search

+25
View File
@@ -57,4 +57,29 @@ export function Step({ title, children }: { title: string, children: React.React
<div className="text-zinc-400 text-sm">{children}</div>
</div>
);
}
export function InlineCode({ children }: { children?: React.ReactNode }) {
return (
<code className="px-1.5 py-0.5 rounded-md bg-zinc-800 text-pink-400 font-mono text-sm border border-zinc-700/50">
{children}
</code>
);
}
// 2. Code Block (für mehrzeiligen Code)
export function PreBlock({ children }: { children?: React.ReactNode }) {
return (
<div className="relative my-6 overflow-hidden rounded-xl border border-zinc-800 bg-zinc-950">
{/* Optionaler Dekorations-Header für den Codeblock */}
<div className="flex items-center gap-1.5 bg-zinc-900/80 px-4 py-2 border-b border-zinc-800">
<div className="w-2.5 h-2.5 rounded-full bg-red-500/80" />
<div className="w-2.5 h-2.5 rounded-full bg-yellow-500/80" />
<div className="w-2.5 h-2.5 rounded-full bg-green-500/80" />
</div>
<pre className="p-4 overflow-x-auto text-sm font-mono text-zinc-200 m-0">
{children}
</pre>
</div>
);
}