-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmdx-components.tsx
41 lines (40 loc) · 1.24 KB
/
mdx-components.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { MDXComponents } from "mdx/types";
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
// Allows customizing built-in components, e.g. to add styling.
h1: ({ children }) => (
<>
{" "}
<h1 style={{ fontSize: "3rem" }} className='font-semibold tracking-tight'>
{children}
</h1>
</>
),
h3: ({ children }) => (
<h1
style={{ fontSize: "1.75rem", padding: "10px 0 10px 0" }}
className='font-semibold tracking-tight'
>
{children}
</h1>
),
p: ({ children }) => (
<>
<p>{children}</p>
<div id='spacer' className='w-full h-5'></div>
</>
),
a: (props) => (
<a style={{ color: "#a855f7" }} {...props}>
{props.children}
</a>
),
ul: ({ children }) => (
<ul className='list-disc' style={{ marginLeft: "25px" }}>
{children}
</ul>
),
li: ({ children }) => <li className='my-1'>{children}</li>,
...components,
};
}