2023-12-25 20:01:37 -07:00
|
|
|
---
|
|
|
|
import type { HTMLAttributes } from 'astro/types';
|
|
|
|
|
|
|
|
type Props = HTMLAttributes<'a'>;
|
|
|
|
|
2023-12-26 21:07:41 -07:00
|
|
|
const { href, ...props } = Astro.props;
|
2023-12-25 20:01:37 -07:00
|
|
|
|
|
|
|
const { pathname } = Astro.url;
|
|
|
|
const isActive = href === pathname || href === pathname.replace(/\/$/, '');
|
|
|
|
---
|
|
|
|
|
2023-12-26 21:07:41 -07:00
|
|
|
<a href={href} {...props}>
|
|
|
|
<slot />
|
2023-12-25 20:01:37 -07:00
|
|
|
</a>
|
2023-12-25 22:08:17 -07:00
|
|
|
|
2023-12-26 20:57:47 -07:00
|
|
|
<style is:inline>
|
2023-12-26 21:07:41 -07:00
|
|
|
a {
|
|
|
|
display: inline-block;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
a:hover {
|
|
|
|
text-decoration: underline;
|
|
|
|
text-decoration-color: var(--accent-color);
|
|
|
|
}
|
|
|
|
a.inverted-button {
|
|
|
|
color: white;
|
|
|
|
background-color: black;
|
|
|
|
border-radius: 8px;
|
|
|
|
border: 2px solid black;
|
|
|
|
padding: 2px 8px;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
a.inverted-button:hover {
|
|
|
|
background-color: var(--accent-color);
|
|
|
|
border-color: var(--accent-color);
|
|
|
|
}
|
2023-12-25 20:01:37 -07:00
|
|
|
</style>
|