Astro blog starter

This commit is contained in:
Cassidy Williams committed 2022-08-22 22:31:53 -05:00
commit 8e0ada2db2
31 files changed
+11141

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
---
export interface Props extends astroHTML.JSX.AnchorHTMLAttributes {}
const { href, class: className, ...props } = Astro.props as Props;
const isActive = href === Astro.url.pathname;
---
<a href={href} class:list={[className, { active: isActive }]} {...props}>
<slot />
</a>
<style>
a {
display: inline-block;
text-decoration: none;
}
a.active {
font-weight: bolder;
text-decoration: underline;
}
</style>