Skip to content

Commit bf9009a

Browse files
committed
fix: added a slight background to the blog posts to increase readability
in dark mode
1 parent 6f3e8ec commit bf9009a

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

app/assets/main.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* background colors */
1010
--bg: oklch(0.145 0 0);
1111
--bg-subtle: oklch(0.178 0 0);
12+
--bg-blog: oklch(0.195 0 0);
1213
--bg-muted: oklch(0.218 0 0);
1314
--bg-elevated: oklch(0.252 0 0);
1415

app/components/BlogPostWrapper.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@ const blueskyPostUri = computed(() => blueskyLink.value?.postUri ?? null)
2222

2323
<template>
2424
<main class="container w-full py-8">
25-
<article class="prose dark:prose-invert mx-auto border-b border-border">
25+
<article
26+
class="max-w-prose mx-auto p-2 border-b border-border"
27+
:style="{
28+
background: `linear-gradient(to bottom, transparent 0%, var(--bg-blog) 2%, var(--bg-blog) 94%, transparent 100%)`,
29+
}"
30+
>
2631
<slot />
2732
</article>
28-
<div v-if="frontmatter.authors" class="mt-12 max-w-prose mx-auto">
33+
<article v-if="frontmatter.authors" class="mt-12 max-w-prose mx-auto">
2934
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
3035
<AuthorList :authors="frontmatter.authors" variant="expanded" />
3136
</div>
32-
</div>
37+
</article>
3338

3439
<!--
3540
- Only renders if Constellation found a Bluesky post linking to this slug
@@ -38,3 +43,9 @@ const blueskyPostUri = computed(() => blueskyLink.value?.postUri ?? null)
3843
<LazyBlueskyComments v-if="blueskyPostUri" :post-uri="blueskyPostUri" />
3944
</main>
4045
</template>
46+
47+
<style scoped>
48+
:deep(.markdown-body) {
49+
@apply prose dark:prose-invert;
50+
}
51+
</style>

nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ export default defineNuxtConfig({
246246
Markdown({
247247
include: [/\.(md|markdown)($|\?)/],
248248
wrapperComponent: 'BlogPostWrapper',
249+
wrapperClasses: 'prose dark:prose-invert mx-auto',
249250
async markdownItSetup(md) {
250251
const shiki = await import('@shikijs/markdown-it')
251252
md.use(

0 commit comments

Comments
 (0)