Skip to content

Commit 267fe03

Browse files
committed
fix: minor ux improvements
1 parent 2373024 commit 267fe03

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

src/components/SwitchTheme.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function SwitchTheme() {
4444
return (
4545
<button
4646
onClick={toggleTheme}
47-
className="hidden md:block fixed top-0 mt-5 mr-5 right-0 p-2 rounded-full bg-muted-foreground/40 hover:bg-muted-foreground/60 text-headings transition-colors cursor-pointer"
47+
className="hidden md:block fixed z-50 top-0 mt-5 mr-5 right-0 p-2 rounded-full bg-muted-foreground/40 hover:bg-muted-foreground/60 text-headings transition-colors cursor-pointer"
4848
aria-label={`Switch to ${theme === DARK_THEME ? 'light' : 'dark'} theme`}
4949
>
5050
{theme === DARK_THEME ? (

src/components/partials/Header.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const isWritingPage = pathname.startsWith('/writing');
88
99
---
1010

11-
<header>
11+
<header class="relative z-10">
1212
<Container>
1313
<div class="flex justify-end">
1414
<nav class="flex items-center gap-4">

src/pages/writing/[...slug].astro

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,31 @@ const { Content } = await render(entry);
2020
---
2121

2222
<BaseLayout seo={entry.data.seo}>
23-
<Container>
24-
<article class="flex flex-col gap-6">
25-
<div class="flex flex-col gap-2 pt-6">
26-
<a href="/writing" class="transition-all text-muted-foreground hover:text-foreground pb-4 text-sm">
27-
Back to writing
28-
</a>
29-
<div class="flex flex-col gap-1.5">
30-
<Avatar />
31-
<span class="text-foreground">{DEFAULT_CONFIGURATION.author.name}</span>
23+
<section class="-mt-12">
24+
<Container>
25+
<article class="flex flex-col gap-6">
26+
<div class="flex flex-col gap-2 pt-6">
27+
<a href="/writing" class="fixed z-20 transition-all text-muted-foreground hover:text-foreground pb-4 text-sm w-max">
28+
Back to writing
29+
</a>
30+
<div class="flex flex-col gap-1.5 mt-12">
31+
<Avatar />
32+
<span class="text-foreground">{DEFAULT_CONFIGURATION.author.name}</span>
33+
</div>
34+
<h1 class="text-3xl font-semibold text-headings">{entry.data.title}</h1>
3235
</div>
33-
<h1 class="text-3xl font-semibold text-headings">{entry.data.title}</h1>
34-
</div>
35-
<div class="relative aspect-video overflow-hidden rounded-lg">
36-
<Image
37-
src={entry.data.image}
38-
alt={entry.data.title}
39-
class="object-cover"
40-
/>
41-
</div>
42-
<div class="prose dark:prose-invert">
43-
<Content />
44-
</div>
45-
</article>
46-
</Container>
36+
<div class="relative aspect-video overflow-hidden rounded-lg">
37+
<Image
38+
src={entry.data.image}
39+
alt={entry.data.title}
40+
class="object-cover"
41+
/>
42+
</div>
43+
<div class="prose dark:prose-invert">
44+
<Content />
45+
</div>
46+
</article>
47+
</Container>
48+
</section>
4749
</BaseLayout>
4850

0 commit comments

Comments
 (0)