feat: restyle code block

This commit is contained in:
DIYgod
2022-09-20 00:21:52 +01:00
parent 0d90755bb2
commit 22caa0cee2
3 changed files with 16 additions and 7 deletions
+11 -3
View File
@@ -1,11 +1,19 @@
pre {
@apply rounded-xl;
@apply my-7;
@apply p-5 md:p-8;
@apply p-5;
background-color: var(--code-bg);
color: var(--code-fg);
@apply text-sm;
}
:not(pre) > code {
@apply inline-flex items-center font-mono break-all leading-snug px-1;
background-color: var(--code-bg);
color: var(--code-fg);
}
:not(pre) > code {
@apply bg-purple-100 text-purple-700 inline-flex items-center font-mono break-all leading-snug;
.line-number::before {
@apply inline-block w-4 text-right mr-5 -ml-2 text-zinc-400;
content: attr(line);
}
+4 -4
View File
@@ -1,9 +1,9 @@
/** based on prism tomorror */
pre {
--lang-color: #8d8c8c;
--code-bg: rgb(18, 18, 38);
--code-fg: #fff;
pre,
code {
--code-bg: #f7f7f7;
--code-fg: #4d4d4c;
}
.token.comment,
+1
View File
@@ -93,6 +93,7 @@ export const renderPageContent = async (content: string): Promise<Rendered> => {
})
.use(rehypePrism, {
ignoreMissing: true,
showLineNumbers: true,
})
.use(rehypeTable)
.use(rehypeExternalLink)