Skip to content

Commit 4fbbdb9

Browse files
committed
project sticky left column, blog link underline opacity
1 parent 558df54 commit 4fbbdb9

3 files changed

Lines changed: 29 additions & 22 deletions

File tree

src/layouts/BlogPost.astro

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ const { title, description, pubDate, updatedDate, cover, coverAlt } = Astro.prop
2828
</div>
2929
<div
3030
class="prose dark:prose-invert prose-headings:font-medium prose-th:text-left prose-a:text-blue-700
31-
prose-a:hover:text-blue-900 prose-a:dark:text-sky-400 prose-a:dark:hover:text-sky-300
32-
prose-inline-code:rounded prose-inline-code:bg-neutral-900 prose-inline-code:before:content-none
31+
prose-a:hover:text-blue-900 prose-a:decoration-blue-700/50 prose-a:dark:text-sky-400
32+
prose-a:dark:hover:text-sky-300 prose-a:underline prose-a:underline-offset-4
33+
prose-a:dark:decoration-sky-400/50 prose-a:hover:decoration-current prose-inline-code:rounded
34+
prose-inline-code:bg-neutral-900 prose-inline-code:before:content-none
3335
prose-inline-code:after:content-none prose-inline-code:py-0.5 prose-inline-code:px-1.5
3436
prose-inline-code:font-medium mx-auto"
3537
>
@@ -44,7 +46,9 @@ const { title, description, pubDate, updatedDate, cover, coverAlt } = Astro.prop
4446
</div>
4547
)
4648
}
47-
<h1 class="mb-11 border-b border-neutral-700 pb-8 text-5xl font-medium dark:text-white">
49+
<h1
50+
class="mb-11 border-b border-neutral-300 pb-8 text-5xl font-medium dark:border-neutral-700 dark:text-white"
51+
>
4852
{title}
4953
</h1>
5054
</div>

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

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { components } from '@/components/mdx/index.astro';
66
import { iconMap } from '@/consts';
77
import { Icon } from 'astro-icon/components';
88
9-
// This is a dynamic route that generates a page for every Markdown file in src/content/
9+
// This is a dynamic route that generates a page for every Markdown file in src/content/work/
1010
// Read more about dynamic routes and this `getStaticPaths` function in the Astro docs:
1111
// https://docs.astro.build/en/core-concepts/routing/#dynamic-routes
1212
export async function getStaticPaths() {
@@ -27,24 +27,27 @@ const { Content } = await render(entry);
2727
<BaseLayout {...entry.data}>
2828
<div class="grid-cols-12 lg:grid">
2929
<div class="col-span-3">
30-
<h1 class="mb-1 text-4xl font-medium dark:text-white">{title}</h1>
31-
<p class="opacity-50">
32-
<FormattedDate date={pubDate} />
33-
</p>
34-
{description && <p class="mb-12">{description}</p>}
35-
<div class="mb-1 text-lg dark:text-white">Tools used</div>
36-
<ul class="mb-6 flex list-none flex-wrap gap-2">
37-
{
38-
tags.map((tag) => (
39-
<li>
40-
<span class="inline-block rounded-md px-2 py-1 text-xs font-medium dark:bg-gray-500 dark:text-white">
41-
{iconMap[tag] && <Icon name={iconMap[tag]} size={16} class="me-1" />} {tag}
42-
</span>
43-
</li>
44-
))
45-
}
46-
</ul>
30+
<div class="sticky top-12">
31+
<h1 class="mb-1 text-4xl font-medium dark:text-white">{title}</h1>
32+
<p class="opacity-50">
33+
<FormattedDate date={pubDate} />
34+
</p>
35+
{description && <p class="mb-12">{description}</p>}
36+
<div class="mb-1 text-lg dark:text-white">Tools used</div>
37+
<ul class="mb-6 flex list-none flex-wrap gap-2">
38+
{
39+
tags.map((tag) => (
40+
<li>
41+
<span class="inline-block rounded-md px-2 py-1 text-xs font-medium dark:bg-gray-500 dark:text-white">
42+
{iconMap[tag] && <Icon name={iconMap[tag]} size={16} class="me-1" />} {tag}
43+
</span>
44+
</li>
45+
))
46+
}
47+
</ul>
48+
</div>
4749
</div>
50+
4851
<div class="col-span-8 col-start-5">
4952
<Content components={components} />
5053
</div>

src/styles/base.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
}
6868

6969
a {
70-
@apply text-blue-700 underline-offset-3 hover:text-blue-900 dark:text-sky-400 dark:hover:text-sky-300;
70+
@apply text-blue-700 hover:text-blue-900 dark:text-sky-400 dark:hover:text-sky-300;
7171
}
7272

7373
strong {

0 commit comments

Comments
 (0)