diff --git a/app/globals.css b/app/globals.css index 0eb6f0a..265eaa8 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,5 +1,6 @@ @import 'tailwindcss'; @import '../node_modules/highlight.js/styles/monokai.min.css'; +@import '../node_modules/katex/dist/katex.min.css'; @theme { --color-bg: #040404; @@ -24,6 +25,16 @@ pre code.hljs { @apply p-0; } +.katex-display { + overflow-x: auto; + overflow-y: hidden; + padding-block-end: 0.25rem; +} + +.katex-display > .katex > .katex-html > .tag { + @apply relative ml-8 lg:absolute lg:right-1; +} + * { @apply scroll-smooth; } diff --git a/app/posts/[slug]/page.tsx b/app/posts/[slug]/page.tsx index 17d944b..931abda 100644 --- a/app/posts/[slug]/page.tsx +++ b/app/posts/[slug]/page.tsx @@ -43,7 +43,7 @@ export default async function Post({ params }: { params: Promise<{ slug: string return (
-
+
{meta.category && ( = () => async (tree: Root) => { const svg = await renderMermaidToSvg(chart) const svgTree = fromHtmlIsomorphic(svg, { fragment: true }) const svgNode = svgTree.children.find((c) => c.type === 'element') as Element | undefined + svgNode?.properties.className?.push('max-w-160', 'mx-auto', 'my-4') + if (svgNode?.properties.style) svgNode.properties.style = '' if (svgNode) { ;(parent.children as Element[])[index] = svgNode }