Skip to content

Commit 049d103

Browse files
committed
Merge branch 'master' into eternalcombat-docs-remake
2 parents 6df55ba + c299af6 commit 049d103

1 file changed

Lines changed: 42 additions & 5 deletions

File tree

‎components/ui/mdx/mdx-components.tsx‎

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { LinkPreview } from "@/components/ui/mdx/link-preview";
1919
import { MdxLink } from "@/components/ui/mdx/mdx-link";
2020
import { MdxImage } from "@/components/ui/mdx/mdx-image";
2121
import { Step, Steps } from "@/components/ui/mdx/steps";
22+
import { cn } from "@/lib/utils";
2223

2324
type HeadingProps = HTMLAttributes<HTMLHeadingElement>;
2425

@@ -33,7 +34,7 @@ export const components: MDXComponents = {
3334

3435
h2: (props: HeadingProps) => (
3536
<Heading
36-
className="mt-12 mb-6 border-border border-b pb-2 font-semibold text-3xl tracking-tight"
37+
className="mt-12 mb-6 pb-2 font-semibold text-3xl tracking-tight"
3738
tag="h2"
3839
{...props}
3940
/>
@@ -90,9 +91,35 @@ export const components: MDXComponents = {
9091

9192
pre: CodeBlock,
9293

94+
p: (props) => (
95+
<p
96+
className="my-4 text-base leading-relaxed text-gray-700 first:mt-0 last:mb-0 dark:text-gray-300"
97+
{...props}
98+
/>
99+
),
100+
101+
a: ({ className, ...props }: ComponentProps<"a">) => (
102+
<a
103+
className={cn(
104+
"font-medium text-blue-600 underline decoration-blue-400/60 decoration-2 underline-offset-4 transition-colors",
105+
"hover:text-blue-700 hover:decoration-blue-500/80",
106+
"dark:text-sky-400 dark:decoration-sky-400/50 dark:hover:text-sky-300 dark:hover:decoration-sky-300/70",
107+
className
108+
)}
109+
{...props}
110+
/>
111+
),
112+
113+
br: () => (
114+
<span
115+
aria-hidden="true"
116+
className="my-5 block h-px w-full bg-gradient-to-r from-transparent via-gray-200/70 to-transparent dark:via-gray-700/60"
117+
/>
118+
),
119+
93120
blockquote: (props) => (
94121
<blockquote
95-
className="border-gray-300 border-l-4 pl-4 text-gray-600 italic dark:border-gray-600 dark:text-gray-400"
122+
className="my-6 rounded-xl border-gray-200 border-l-4 bg-gray-50 px-5 py-4 text-gray-700 italic shadow-sm dark:border-gray-700 dark:bg-gray-900/50 dark:text-gray-300"
96123
{...props}
97124
/>
98125
),
@@ -124,11 +151,21 @@ export const components: MDXComponents = {
124151

125152
hr: (props) => <hr className="my-12 border-border" {...props} />,
126153

127-
ul: (props) => <ul className="my-4 list-disc space-y-2 pl-6" {...props} />,
154+
ul: (props) => (
155+
<ul
156+
className="my-4 list-disc space-y-2 pl-6 text-gray-700 marker:text-gray-400 dark:text-gray-300 dark:marker:text-gray-500"
157+
{...props}
158+
/>
159+
),
128160

129-
ol: (props) => <ol className="my-4 list-decimal space-y-2 pl-8" {...props} />,
161+
ol: (props) => (
162+
<ol
163+
className="my-4 list-decimal space-y-2 pl-8 text-gray-700 marker:text-gray-400 dark:text-gray-300 dark:marker:text-gray-500"
164+
{...props}
165+
/>
166+
),
130167

131-
li: (props) => <li className="leading-relaxed" {...props} />,
168+
li: (props) => <li className="leading-relaxed text-gray-700 dark:text-gray-300" {...props} />,
132169

133170
img: (props) => <MdxImage {...props} />,
134171

0 commit comments

Comments
 (0)