Skip to content

Commit 9ff3fb8

Browse files
committed
fix: link underline implementation
1 parent 489a277 commit 9ff3fb8

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/components/Link.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const { href, external, underline = true, ...rest } = Astro.props;
1313
<a
1414
href={href}
1515
target={ external ? "_blank" : "_self" }
16-
class={cn("inline-block decoration-black/15 dark:decoration-white/30 hover:decoration-black/25 hover:dark:decoration-white/50 text-current hover:text-black hover:dark:text-white transition-colors duration-300 ease-in-out", underline && "underline underline-offset-2")}
16+
class={cn("inline-block decoration-black/15 dark:decoration-white/30 hover:decoration-black/25 hover:dark:decoration-white/50 text-current hover:text-black hover:dark:text-white transition-colors duration-300 ease-in-out")}
1717
{...rest}>
18-
<slot/>
18+
<span class={underline ? "border-b border-b-stone-400" : ""}>
19+
<slot/>
20+
</span>
1921
</a>

src/components/custom/CopyText.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { text, label } = Astro.props;
99

1010
<span class="font-base text-sm">
1111
<span
12-
class="underline hover:text-black dark:hover:text-white transition-colors duration-300 ease-in-out cursor-pointer"
12+
class="border-b border-b-stone-400 hover:text-black dark:hover:text-white transition-colors duration-300 ease-in-out cursor-pointer"
1313
data-copy-text={text}
1414
data-copy-label={label}
1515
onclick="

src/components/custom/LinkToFile.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const path = `/blog/${slug}`;
1919
href={`${path}/index.tex`}
2020
class="hover:text-black dark:hover:text-white transition-colors duration-300 ease-in-out"
2121
>
22-
<span class="underline">LaTeX</span>
22+
<span class="border-b border-b-stone-400">LaTeX</span>
2323
</a>
2424
{pdf && " and "}
2525
</>
@@ -29,7 +29,7 @@ const path = `/blog/${slug}`;
2929
href={`${path}/index.pdf`}
3030
class="hover:text-black dark:hover:text-white transition-colors duration-300 ease-in-out"
3131
>
32-
<span class="underline">PDF</span>
32+
<span class="border-b border-b-stone-400">PDF</span>
3333
</a>
3434
)}
3535
</div>

src/styles/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ article {
4747

4848
@layer utilities {
4949
article a {
50-
@apply font-sans text-current underline underline-offset-2;
50+
@apply font-sans text-current border-b border-b-stone-400;
5151
@apply decoration-black/15 dark:decoration-white/30;
5252
@apply transition-colors duration-300 ease-in-out;
5353
}

0 commit comments

Comments
 (0)