feat: restyle code block
This commit is contained in:
+11
-3
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -93,6 +93,7 @@ export const renderPageContent = async (content: string): Promise<Rendered> => {
|
||||
})
|
||||
.use(rehypePrism, {
|
||||
ignoreMissing: true,
|
||||
showLineNumbers: true,
|
||||
})
|
||||
.use(rehypeTable)
|
||||
.use(rehypeExternalLink)
|
||||
|
||||
Reference in New Issue
Block a user