summaryrefslogtreecommitdiff
path: root/examples/with-content/src/components/HeaderLink.astro
diff options
context:
space:
mode:
Diffstat (limited to 'examples/with-content/src/components/HeaderLink.astro')
-rw-r--r--examples/with-content/src/components/HeaderLink.astro22
1 files changed, 0 insertions, 22 deletions
diff --git a/examples/with-content/src/components/HeaderLink.astro b/examples/with-content/src/components/HeaderLink.astro
deleted file mode 100644
index e8e2e103b..000000000
--- a/examples/with-content/src/components/HeaderLink.astro
+++ /dev/null
@@ -1,22 +0,0 @@
----
-export interface Props extends astroHTML.JSX.AnchorHTMLAttributes {}
-
-const { href, class: className, ...props } = Astro.props;
-
-const { pathname } = Astro.url;
-const isActive = href === pathname || href === pathname.replace(/\/$/, '');
----
-
-<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>