Fix content typography sizes

This commit is contained in:
2025-04-21 13:25:48 -07:00
parent a9cbbb7e8e
commit c6aa014d29
3 changed files with 32 additions and 47 deletions

View File

@@ -63,7 +63,7 @@ const jsonLd = {
> >
<script type="application/ld+json" set:html={JSON.stringify(jsonLd)} /> <script type="application/ld+json" set:html={JSON.stringify(jsonLd)} />
<div class="relative max-w-8xl mx-auto"> <div class="relative max-w-8xl mx-auto">
<article class="prose prose-lg mx-auto max-w-4xl"> <article class="prose prose-invert prose-lg mx-auto max-w-4xl">
{post.data.image && ( {post.data.image && (
<div class="-mx-4 sm:mx-0 mb-8"> <div class="-mx-4 sm:mx-0 mb-8">
<Image <Image
@@ -97,7 +97,7 @@ const jsonLd = {
</span> </span>
))} ))}
</div> </div>
<div class="prose prose-invert max-w-none"> <div class="prose prose-invert prose-lg max-w-none">
<Content /> <Content />
</div> </div>
</article> </article>

View File

@@ -59,7 +59,7 @@ const { Content } = await project.render();
</div> </div>
</header> </header>
<div class="prose prose-invert max-w-none"> <div class="prose prose-invert prose-lg max-w-none">
<Content /> <Content />
</div> </div>
</article> </article>

View File

@@ -41,10 +41,15 @@ module.exports = {
"draw-line": { "draw-line": {
"0%": { "stroke-dashoffset": "100" }, "0%": { "stroke-dashoffset": "100" },
"100%": { "stroke-dashoffset": "0" } "100%": { "stroke-dashoffset": "0" }
},
"fade-in": {
"0%": { opacity: "0" },
"100%": { opacity: "1" }
} }
}, },
animation: { animation: {
"draw-line": "draw-line 0.6s ease-out forwards" "draw-line": "draw-line 0.6s ease-out forwards",
"fade-in": "fade-in 0.3s ease-in-out forwards"
}, },
typography: (theme) => ({ typography: (theme) => ({
DEFAULT: { DEFAULT: {
@@ -126,17 +131,28 @@ module.exports = {
borderRadius: '0.25rem', borderRadius: '0.25rem',
fontFamily: 'Comic Code, monospace', fontFamily: 'Comic Code, monospace',
fontWeight: '400', fontWeight: '400',
fontSize: 'inherit', // Match the parent text size
'&::before': { content: 'none' }, '&::before': { content: 'none' },
'&::after': { content: 'none' }, '&::after': { content: 'none' },
}, },
'pre': {
backgroundColor: '#282828',
color: theme("colors.foreground"),
borderRadius: '0.5rem',
overflow: 'visible', // This allows the copy button to be positioned outside
position: 'relative', // For the copy button positioning
marginTop: '1.5rem', // Space for the copy button and language label
fontSize: 'inherit', // Match the parent font size
},
'pre code': { 'pre code': {
display: 'grid', // This ensures line backgrounds stretch full width display: 'block',
minWidth: '100%',
fontFamily: 'Comic Code, monospace', fontFamily: 'Comic Code, monospace',
fontSize: '0.875rem', // text-sm fontSize: '1em', // This will inherit from the prose-lg setting
lineHeight: '1.7142857', // leading-6 padding: '1.25rem',
padding: '1rem', // p-4 overflow: 'auto', // Enable horizontal scrolling
whiteSpace: 'pre',
'&::before': { content: 'none' }, '&::before': { content: 'none' },
'&::after': { content: 'none' }, '&::after': { content: 'none' },
}, },
@@ -155,44 +171,6 @@ module.exports = {
borderRadius: '0.25rem', borderRadius: '0.25rem',
}, },
code: {
color: theme("colors.purple.bright"),
backgroundColor: "#282828", // A dark gray that works with black
padding: "0.2em 0.4em",
borderRadius: "0.25rem",
fontWeight: "400",
"&::before": {
content: "\"\"",
},
"&::after": {
content: "\"\"",
},
},
// Inline code
"code::before": {
content: "\"\"",
},
"code::after": {
content: "\"\"",
},
// Pre
pre: {
backgroundColor: "#282828",
color: theme("colors.foreground"),
code: {
backgroundColor: "transparent",
padding: "0",
color: "inherit",
fontSize: "inherit",
fontWeight: "inherit",
"&::before": { content: "none" },
"&::after": { content: "none" },
},
},
// Horizontal rules // Horizontal rules
hr: { hr: {
borderColor: theme("colors.foreground"), borderColor: theme("colors.foreground"),
@@ -226,6 +204,13 @@ module.exports = {
}, },
}, },
}, },
lg: {
css: {
"pre code": {
fontSize: "1rem",
},
},
},
}), }),
}, },
}, },