astro-ghostcms/.pnpm-store/v3/files/7b/19ed1ca47a76f0ebc5458f126fd...

38 lines
784 B
Plaintext
Raw Permalink Normal View History

2024-02-14 14:10:47 +00:00
---
interface Props {
color?: string | undefined;
}
import colors from '../config/colors.json';
if (Astro.props.color === undefined) {
Astro.props.color =
colors[Math.floor(Math.random() * colors.length)];
}
const { color } = Astro.props;
---
<style define:vars={{ color: color }}>
span.brutal-pill {
filter: drop-shadow(3px 3px 0 rgb(0 0 0 / 1));
user-select: none;
background-color: white;
border-radius: 9999px;
border: 2px solid black;
padding: 0.25rem 0.75rem;
transition: all;
transition-duration: 0.5s;
animation: ease-in-out;
font-size: small;
}
span.brutal-pill:hover {
filter: drop-shadow(5px 5px 0 rgb(0 0 0 / 1));
background-color: var(--color);
}
</style>
<span class='brutal-pill'>
<slot />
</span>