nicco.io/src/components/Tag.astro

34 lines
506 B
Plaintext
Raw Normal View History

2024-11-22 00:42:48 +01:00
---
export type Props = {
name: string
href: string
2024-11-29 17:58:26 +01:00
count?: number
2024-11-22 00:42:48 +01:00
}
const { name, href, count } = Astro.props
---
<a {href}>
<div>
{name}
2024-11-29 17:58:26 +01:00
{count && <i>{count}</i>}
2024-11-22 00:42:48 +01:00
</div>
</a>
<style>
div {
display: inline-block;
margin: 0.25rem;
padding: 0 0.5rem;
background-color: var(--clr-primary);
width: max-content;
}
i {
font-family: 'Courier New', Courier, monospace;
font-size: 0.85em;
font-weight: bold;
color: var(--clr-secondary);
}
</style>