Skip to content

Commit 870075d

Browse files
committed
remove code block border
1 parent 173afde commit 870075d

File tree

2 files changed

+85
-8
lines changed

2 files changed

+85
-8
lines changed

app/globals.css

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,21 @@ body {
8181

8282
.prose pre {
8383
padding: 0;
84-
border: none;
84+
border: none !important;
85+
box-shadow: none !important;
86+
outline: none !important;
8587
}
8688

8789
.prose pre code {
8890
background-color: inherit;
91+
color: inherit;
92+
border: none !important;
93+
}
94+
95+
.prose pre > div {
96+
border: none !important;
97+
box-shadow: none !important;
98+
outline: none !important;
8999
}
90100

91101
.prose code::before {
@@ -96,6 +106,52 @@ body {
96106
content: '';
97107
}
98108

109+
.dark .prose code {
110+
background-color: #2a2b36;
111+
color: #DCDDDD; /* shironezu - light grey */
112+
}
113+
114+
.dark .prose pre {
115+
border: none !important;
116+
box-shadow: none !important;
117+
outline: none !important;
118+
}
119+
120+
.dark .prose pre > div {
121+
border: none !important;
122+
box-shadow: none !important;
123+
outline: none !important;
124+
}
125+
126+
/* Nuclear option: target all possible code block elements */
127+
.prose pre[class*="language-"],
128+
.prose div[class*="language-"],
129+
.prose code[class*="language-"] {
130+
border: none !important;
131+
border-left: none !important;
132+
border-right: none !important;
133+
border-top: none !important;
134+
border-bottom: none !important;
135+
box-shadow: none !important;
136+
outline: none !important;
137+
ring: none !important;
138+
border-radius: 0 !important;
139+
}
140+
141+
.dark .prose pre[class*="language-"],
142+
.dark .prose div[class*="language-"],
143+
.dark .prose code[class*="language-"] {
144+
border: none !important;
145+
border-left: none !important;
146+
border-right: none !important;
147+
border-top: none !important;
148+
border-bottom: none !important;
149+
box-shadow: none !important;
150+
outline: none !important;
151+
ring: none !important;
152+
border-radius: 0 !important;
153+
}
154+
99155
.prose ul li::before {
100156
content: '\25E6'; /* Unicode for a small circle */
101157
color: slategrey; /* Change the color */

components/RenderPost.tsx

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,36 @@ import remarkGfm from 'remark-gfm';
1010

1111
import 'katex/dist/katex.min.css';
1212

13+
// Override dracula theme to remove borders
14+
const customDracula = {
15+
...dracula,
16+
'pre[class*="language-"]': {
17+
...dracula['pre[class*="language-"]'],
18+
borderRadius: 0,
19+
border: 'none',
20+
borderImage: 'none',
21+
borderWidth: 0,
22+
marginTop: 0,
23+
marginBottom: 0,
24+
marginLeft: '-1.5rem', // break out of prose (0.5rem) + parent (1rem) padding
25+
marginRight: '-1.5rem',
26+
padding: '1rem',
27+
},
28+
};
29+
1330
const RenderPost = ({ post, prev, next, slug }: any) => {
1431
const components = {
1532
code({ node, inline, className, children, ...props }: any) {
1633
const match = /language-(\w+)/.exec(className || '');
1734
return !inline && match ? (
1835
<SyntaxHighlighter
19-
style={dracula}
36+
style={customDracula}
2037
language={match[1]}
21-
customStyle={{ border: 'none' }}
38+
customStyle={{
39+
border: 'none',
40+
boxShadow: 'none',
41+
outline: 'none',
42+
}}
2243
PreTag="div"
2344
{...props}
2445
>
@@ -108,24 +129,24 @@ const RenderPost = ({ post, prev, next, slug }: any) => {
108129
</div>
109130

110131
{/* Navigation */}
111-
<div className="mt-8 flex flex-col text-sm gap-1">
132+
<div className="mt-8 flex flex-col text-base gap-2">
112133
{next && (
113134
<div className="flex group">
114-
<p className="text-japanese-soshoku dark:text-japanese-murasakisuishiyou">Next:</p>
135+
<p className="text-japanese-sumiiro dark:text-japanese-shironezu font-semibold">Next:</p>
115136
<Link
116137
href={`/posts/${next.slug}`}
117-
className="ml-2 text-japanese-sumiiro dark:text-japanese-shironezu hover:text-japanese-sumiiro/70 dark:hover:text-japanese-murasakisuishiyou transition-colors duration-200"
138+
className="ml-2 text-japanese-sumiiro dark:text-japanese-nyuhakushoku hover:text-japanese-nezumiiro dark:hover:text-japanese-murasakisuishiyou transition-colors duration-200 underline"
118139
>
119140
{next.title}
120141
</Link>
121142
</div>
122143
)}
123144
{prev && (
124145
<div className="flex group">
125-
<p className="text-japanese-soshoku dark:text-japanese-murasakisuishiyou">Previous:</p>
146+
<p className="text-japanese-sumiiro dark:text-japanese-shironezu font-semibold">Previous:</p>
126147
<Link
127148
href={`/posts/${prev.slug}`}
128-
className="ml-2 text-japanese-sumiiro dark:text-japanese-shironezu hover:text-japanese-sumiiro/70 dark:hover:text-japanese-murasakisuishiyou transition-colors duration-200"
149+
className="ml-2 text-japanese-sumiiro dark:text-japanese-nyuhakushoku hover:text-japanese-nezumiiro dark:hover:text-japanese-murasakisuishiyou transition-colors duration-200 underline"
129150
>
130151
{prev.title}
131152
</Link>

0 commit comments

Comments
 (0)