style: adjust style

This commit is contained in:
robin committed 2026-08-04 16:02:02 +02:00
1 parent 592b1a158a
commit aee4b8c567
5 files changed
+110 -78

No files matched your search

+34
View File
@@ -58,4 +58,38 @@ pre code {
background-color: transparent !important;
padding: 0 !important;
border: none !important;
}
/* Shiki / Rehype Pretty Code Block Container */
figure[data-rehype-pretty-code-figure] {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
border-radius: 0.75rem;
overflow: hidden;
border: 1px solid #27272a; /* Tailwind zinc-800 */
background-color: #0d1117; /* Dunkler VS-Code Hintergrund */
}
/* Der Titel/Dateiname (falls im MDX angegeben) */
div[data-rehype-pretty-code-title] {
background-color: #161b22;
border-bottom: 1px solid #27272a;
padding: 0.5rem 1rem;
font-family: monospace;
font-size: 0.75rem;
color: #8b949e;
}
/* Der eigentliche Code-Bereich */
figure[data-rehype-pretty-code-figure] pre {
margin: 0 !important;
padding: 1rem !important;
background-color: transparent !important;
overflow-x: auto;
font-size: 0.875rem;
line-height: 1.7;
}
figure[data-rehype-pretty-code-figure] code {
font-family: var(--font-mono, monospace);
}
+18 -8
View File
@@ -1,9 +1,8 @@
import { getWikiPageBySlug } from '@/lib/wiki';
import { notFound } from 'next/navigation';
import rehypePrettyCode from 'rehype-pretty-code';
import { MDXRemote } from 'next-mdx-remote/rsc';
import { Callout, Grid, Card, Steps, Step, InlineCode, PreBlock } from '@/components/mdx-components';
import rehypePrettyCode from 'rehype-pretty-code';
import { Callout, Grid, Card, Steps, Step, InlineCode } from '@/components/mdx-components';
const mdxOptions = {
mdxOptions: {
@@ -11,7 +10,7 @@ const mdxOptions = {
[
rehypePrettyCode,
{
theme: 'github-dark', // oder 'one-dark-pro', 'nord', etc.
theme: 'github-dark',
keepBackground: true,
},
],
@@ -20,12 +19,18 @@ const mdxOptions = {
};
const mdxComponents = {
// Eigene UI-Komponenten
Callout,
Grid,
Card,
Steps,
Step,
h2: (props: any) => <h2 className="text-2xl font-bold text-white mt-12 mb-4" {...props} />,
// Custom Typography Überschreibungen
code: InlineCode,
h1: (props: any) => <h1 className="text-3xl font-bold text-white mt-8 mb-4 border-b border-zinc-800 pb-3" {...props} />,
h2: (props: any) => <h2 className="text-2xl font-bold text-white mt-10 mb-4" {...props} />,
h3: (props: any) => <h3 className="text-xl font-semibold text-white mt-6 mb-3" {...props} />,
};
type PageProps = {
@@ -43,9 +48,14 @@ export default async function Page({ params }: PageProps) {
}
return (
<article className="prose prose-invert max-w-none p-6">
<h1>{article.title}</h1>
{/* Direkte MDX-Rendering-Komponente von Next.js */}
<article className="prose prose-invert prose-blue max-w-4xl mx-auto p-6 md:p-12 min-h-screen">
<header className="mb-8 border-b border-zinc-800 pb-6">
<h1 className="text-4xl font-extrabold text-white mb-2 m-0">{article.title}</h1>
{article.updatedAt && (
<p className="text-zinc-500 text-sm m-0">Zuletzt aktualisiert: {article.updatedAt}</p>
)}
</header>
<MDXRemote
source={article.rawContent}
components={mdxComponents}