web/src/components/Card.astro

49 lines · 830 bytes

 1---
 2interface Props {
 3	title: string;
 4	body: string;
 5	href: string;
 6}
 7
 8const { href, title, body } = Astro.props;
 9---
10
11<li class="link-card">
12	<a href={href}>
13		<h2>
14			{title}
15			<span>&rarr;</span>
16		</h2>
17		<p>
18			{body}
19		</p>
20	</a>
21</li>
22<style lang="scss">
23	.link-card {
24    color: var(--foreground);
25    background: var(--background);
26    border: 2px solid var(--foreground);
27    box-shadow: 6px 6px 0 var(--foreground);
28    font-family: "Lekton", sans-serif;
29    font-weight: 700;
30		transition: all ease-in-out 0.1s;
31		list-style: none;
32		&:hover {
33			box-shadow: 8px 8px 0 var(--foreground);
34			background: var(--accent);
35			color: var(--background);
36		
37		}
38		a {
39			box-sizing: border-box;
40			color: currentColor;
41			text-decoration: none;
42			transition: all ease-in-out 0.1s;
43		}
44		h2 {
45			margin: 0;
46		}
47	}
48	
49</style>