Skip to content

Commit a6da6d7

Browse files
committed
styles(project): add libraries for markdown manipulation and custom styles for the MDX component
1 parent 7ddd023 commit a6da6d7

File tree

3 files changed

+147
-11
lines changed

3 files changed

+147
-11
lines changed

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,31 @@
1616
"@react-spring/web": "9.7.5",
1717
"@supabase/ssr": "^0.6.1",
1818
"@supabase/supabase-js": "^2.49.4",
19+
"@tailwindcss/typography": "^0.5.16",
1920
"@uiw/react-markdown-preview": "^5.1.4",
2021
"@uiw/react-md-editor": "^4.0.6",
2122
"date-fns": "^4.1.0",
23+
"esbuild": "^0.25.4",
2224
"framer-motion": "^12.10.5",
25+
"gray-matter": "^4.0.3",
2326
"lucide-react": "0.475.0",
27+
"mdx-bundler": "^10.1.1",
2428
"next": "15.2.5",
2529
"next-themes": "^0.4.6",
30+
"prismjs": "^1.30.0",
2631
"react": "^18.3.1",
2732
"react-dom": "^18.3.1",
2833
"react-hook-form": "^7.56.3",
2934
"react-intersection-observer": "^9.16.0",
35+
"rehype-prism-plus": "^2.0.1",
36+
"rehype-slug": "^6.0.0",
3037
"slugify": "^1.6.6",
3138
"zod": "^3.24.4",
3239
"zustand": "5.0.3"
3340
},
3441
"devDependencies": {
3542
"@eslint/eslintrc": "^3.3.1",
43+
"@types/mdx": "^2.0.13",
3644
"@types/node": "^20.17.46",
3745
"@types/react": "^19.1.3",
3846
"@types/react-dom": "^19",

src/styles/globals.css

Lines changed: 136 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,143 @@
77
--font-roboto-mono: "Roboto Mono", monospace;
88
}
99

10-
html {
11-
@apply text-neutral-950 dark:text-white selection:bg-neutral-950 selection:text-white dark:selection:bg-white dark:selection:text-neutral-950;
12-
}
10+
@layer base {
11+
html {
12+
@apply text-neutral-950 dark:text-white selection:bg-neutral-950 selection:text-white dark:selection:bg-white dark:selection:text-neutral-950;
13+
scroll-behavior: smooth;
14+
}
15+
16+
body {
17+
font-family: var(--font-outfit);
18+
}
19+
20+
h1[id],
21+
h2[id] {
22+
@apply scroll-mt-16;
23+
}
24+
25+
.prose h1 {
26+
@apply text-4xl font-black text-neutral-950 dark:text-white;
27+
}
28+
29+
.prose h2 {
30+
@apply text-3xl font-extrabold text-neutral-950 dark:text-white;
31+
}
32+
33+
.prose h3 {
34+
@apply text-xl font-bold text-neutral-950 dark:text-white;
35+
}
36+
37+
.prose h1:first-of-type {
38+
@apply hidden;
39+
}
40+
41+
.prose a {
42+
@apply text-blue-400 no-underline hover:underline;
43+
}
44+
45+
.prose strong {
46+
@apply font-black text-neutral-950 dark:text-white;
47+
}
48+
49+
.prose hr {
50+
@apply border-1 border-neutral-200 dark:border-neutral-800 rounded-xl my-8 first:hidden;
51+
}
52+
53+
.prose blockquote {
54+
@apply border-l-4 pl-4 italic text-neutral-500 border-neutral-200 dark:border-neutral-800 rounded-xl;
55+
quotes: "“" "”";
56+
}
57+
58+
.prose blockquote::before {
59+
content: "“";
60+
color: theme("colors.neutral.500");
61+
font-family: "Victor Mono", monospace;
62+
font-size: 4rem;
63+
line-height: 0;
64+
margin-right: 0.25rem;
65+
vertical-align: -0.4em;
66+
}
67+
68+
.prose blockquote::after {
69+
content: "”";
70+
display: none;
71+
}
72+
73+
.prose blockquote cite {
74+
@apply block text-sm font-medium mt-2 text-right text-neutral-500;
75+
}
76+
77+
.prose table {
78+
@apply w-full text-sm text-left rtl:text-right text-white;
79+
}
80+
81+
.prose thead {
82+
@apply text-xs font-black uppercase bg-neutral-800 text-white;
83+
}
84+
85+
.prose tr > th {
86+
@apply min-w-52 text-xs px-4 py-2;
87+
}
88+
89+
.prose tr {
90+
@apply border-b border-transparent;
91+
}
92+
93+
.prose tr > td {
94+
@apply min-w-52 text-xs px-4 h-10 pb-1;
95+
}
96+
97+
.prose ul > li::marker {
98+
@apply font-bold text-neutral-500 leading-relaxed;
99+
/* content: '- '; */
100+
}
101+
102+
.prose :not(pre) > code {
103+
@apply text-neutral-950 dark:text-white bg-neutral-100 dark:bg-neutral-900 border-2 border-neutral-200 dark:border-neutral-800 rounded-lg px-1.5 py-0.5 font-medium;
104+
}
105+
106+
.prose :not(pre) > code::before,
107+
.prose :not(pre) > code::after {
108+
content: none !important;
109+
}
110+
111+
.prose pre {
112+
@apply rounded-xl border-2 border-neutral-200 dark:border-neutral-800 overflow-x-auto p-4 !bg-neutral-100 dark:!bg-neutral-900;
113+
}
114+
115+
.prose pre code {
116+
@apply text-sm lg:text-xs font-mono leading-relaxed text-neutral-950 dark:text-white;
117+
font-family: "Fira Code", monospace;
118+
}
119+
120+
.prose pre {
121+
overflow-x: auto;
122+
overflow-y: hidden;
123+
}
124+
125+
.prose pre::-webkit-scrollbar {
126+
height: 8px;
127+
width: 0px;
128+
}
129+
130+
.prose pre::-webkit-scrollbar-track {
131+
background: transparent;
132+
margin-left: 8px;
133+
margin-right: 8px;
134+
}
135+
136+
.prose pre::-webkit-scrollbar-thumb {
137+
background-color: #737373;
138+
border-radius: 10px;
139+
border: 2px solid transparent;
140+
background-clip: content-box;
141+
transition: background-color 0.2s ease;
142+
}
13143

14-
body {
15-
font-family: var(--font-outfit);
144+
.prose pre::-webkit-scrollbar-thumb:active {
145+
background-color: rgba(255, 255, 255, 0.9);
146+
}
16147
}
17148

18149
::-webkit-scrollbar {

tailwind.config.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Config } from "tailwindcss";
22
import { heroui } from "@heroui/theme";
3+
import typography from "@tailwindcss/typography";
34

45
export default {
56
content: [
@@ -9,14 +10,10 @@ export default {
910
"./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}",
1011
],
1112
theme: {
12-
extend: {
13-
colors: {
14-
primary: "#8A2BE2",
15-
secondary: "#FF9100",
16-
},
17-
},
13+
extend: {},
1814
},
1915
plugins: [
16+
typography(),
2017
heroui({
2118
layout: {
2219
dividerWeight: "1px",

0 commit comments

Comments
 (0)