Skip to content

Commit 46bc845

Browse files
committed
refactor: clean up global styles and enhance list styling in rich text editor
1 parent b94e22f commit 46bc845

File tree

4 files changed

+31
-106
lines changed

4 files changed

+31
-106
lines changed

src/app/globals.css

Lines changed: 24 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -217,117 +217,50 @@
217217
animation-delay: 4s;
218218
}
219219

220-
/* List styles */
221-
ul,
222-
ol {
223-
list-style: none;
224-
margin: 0;
225-
226-
li p {
227-
display: inline;
228-
}
229-
}
230-
ol {
231-
list-style-type: none;
232-
counter-reset: list-0 list-1 list-2 list-3 list-4;
233-
margin: 0;
234-
}
235-
h1,
236-
h2,
237-
h3,
238-
h4,
239-
h5,
240-
h6 {
241-
}
242-
243-
h1,
244-
h2 {
245-
}
246-
247-
h1 {
248-
font-size: 1.4rem;
249-
}
250-
251-
h2 {
252-
font-size: 1.2rem;
253-
}
254-
255-
h3 {
256-
font-size: 1.1rem;
257-
}
258-
259-
h4,
260-
h5,
261-
h6 {
262-
font-size: 1rem;
263-
}
264-
265-
code {
266-
background-color: rgba(27, 31, 35, 0.05);
267-
border-radius: 0.4rem;
268-
color: black;
269-
font-size: 0.85rem;
270-
padding: 0.25em 0.3em;
271-
}
272-
273-
pre {
274-
background: black;
275-
border-radius: 0.5rem;
276-
color: white;
277-
font-family: "JetBrainsMono", monospace;
278-
margin: 1.5rem 0;
279-
padding: 0.75rem 1rem;
280-
281-
code {
282-
background: none;
283-
color: inherit;
284-
font-size: 0.8rem;
285-
padding: 0;
286-
}
287-
}
288-
289-
blockquote {
290-
border-left: 3px solid gray;
291-
margin: 1.5rem 0;
292-
padding-left: 1rem;
293-
}
294-
295-
hr {
296-
border: none;
297-
border-top: 1px solid gray;
298-
margin: 2rem 0;
299-
}
300-
301220
* {
302221
margin: 0;
303222
padding: 0;
304223
box-sizing: border-box;
305224
}
306225

307-
.custom-list,
226+
/* .custom-list,
308227
.custom-list-ordered {
309228
list-style-type: none;
310229
}
311230
312231
.custom-list li::marker,
313232
.custom-list-ordered li::marker {
314233
display: none;
315-
}
234+
} */
316235

317-
.custom-list li::before {
236+
/* .custom-list li::before {
318237
content: "•";
319-
/* width: 4px;
320-
height: 4px;
321-
border-radius: 50%;
322-
background: #000;
323-
vertical-align: middle; */
324238
display: inline-block;
325239
margin-right: 10px;
326-
}
240+
} */
327241

328-
.custom-list-ordered li::before {
242+
/* .custom-list-ordered li::before {
329243
content: counter(list-0, decimal) ". ";
330244
counter-increment: list-0;
331245
display: inline-block;
332246
margin-right: 5px;
247+
} */
248+
249+
.custom-list {
250+
list-style-type: disc;
251+
padding: 0 1rem;
252+
}
253+
254+
.custom-list li p {
255+
margin-top: 0.25em;
256+
margin-bottom: 0.25em;
257+
}
258+
259+
.custom-list-ordered {
260+
list-style-type: decimal;
261+
padding: 0 1rem;
262+
}
263+
264+
.custom-list-ordered li p {
265+
margin-top: 0.25em;
333266
}

src/app/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export const metadata: Metadata = {
1717
follow: true,
1818
"max-video-preview": -1,
1919
"max-image-preview": "large",
20-
"max-snippet": -1
21-
}
22-
}
20+
"max-snippet": -1,
21+
},
22+
},
2323
};
2424

2525
export default function RootLayout({ children }: Props) {

src/components/shared/rich-editor/RichEditor.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ import { cn } from "@/lib/utils";
3737
import ListItem from "@tiptap/extension-list-item";
3838
import BulletList from "@tiptap/extension-bullet-list";
3939
import OrderedList from "@tiptap/extension-ordered-list";
40+
41+
import "@/styles/tiptap.scss";
42+
4043
interface RichTextEditorProps {
4144
content?: string;
4245
onChange: (content: string) => void;

src/styles/tiptap.scss

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
/* Basic editor styles */
21
.tiptap {
32
min-height: 300px;
4-
border: 1px solid #d1d5db;
5-
padding: 2px;
63
border-radius: 0 0 4px 4px;
7-
:first-child {
8-
margin-top: 0;
9-
}
10-
11-
/* List styles */
124
ul,
135
ol {
146
list-style-type: disc;
157
padding: 0 1rem;
16-
margin: 1.25rem 1rem 1.25rem 0.4rem;
178

189
li p {
1910
margin-top: 0.25em;
@@ -22,8 +13,7 @@
2213
}
2314
ol {
2415
list-style-type: decimal;
25-
padding: 0 1rem;
26-
margin: 1.25rem 1rem 1.25rem 0.4rem;
16+
padding: 1rem;
2717

2818
li p {
2919
margin-top: 0.25em;
@@ -66,7 +56,6 @@
6656
font-size: 1rem;
6757
}
6858

69-
/* Code and preformatted text styles */
7059
code {
7160
background-color: rgba(27, 31, 35, 0.05);
7261
border-radius: 0.4rem;

0 commit comments

Comments
 (0)