1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-02-14 21:10:25 +01:00
blog/src/components/Tag.astro
Matthias Kretschmann 05ad0470c2
migrate to biome (#944)
* migrate to biome

* cleanup

* fix

* use tsx

* script tweaks

* fix test runs

* path tweaks
2024-07-27 21:15:05 +01:00

39 lines
736 B
Plaintext

---
type Props = {
name: string
url: string
count?: number
style?: string | astroHTML.JSX.CSSProperties | null | undefined
}
const { name, url, count, style } = Astro.props
---
<style>
.tag {
color: var(--text-color-light);
margin-left: calc(var(--spacer) / 2);
margin-right: calc(var(--spacer) / 2);
margin-bottom: calc(var(--spacer) / 2);
white-space: nowrap;
display: inline-block;
}
.tag::before {
content: '#';
margin-right: 1px;
opacity: 0.65;
}
.count {
font-size: var(--font-size-small);
margin-left: calc(var(--spacer) / 6);
opacity: 0.65;
}
</style>
<a class="tag" href={url} style={style}>
{name}
{count && <span class="count">{count}</span>}
</a>