summaryrefslogtreecommitdiff
path: root/examples/portfolio/src/components/Hero.astro
blob: 21b5ed1bf20b4e1eff28f3f8cea20e2f734479bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
interface Props {
	title: string;
	tagline?: string;
	align?: 'start' | 'center';
}

const { align = 'center', tagline, title } = Astro.props;
---

<header class:list={['hero stack gap-4', align]}>
	<div class="stack gap-2">
		<h1 class="title">{title}</h1>
		{tagline && <p class="tagline">{tagline}</p>}
	</div>
	<slot />
</header>

<style>
	.hero {
		font-size: var(--text-lg);
		text-align: center;
	}

	.title,
	.tagline {
		max-width: 37ch;
		margin-inline: auto;
	}

	.title {
		font-size: var(--text-3xl);
		color: var(--gray-0);
	}

	@media (min-width: 50em) {
		.hero {
			font-size: var(--text-xl);
		}

		.start {
			text-align: start;
		}

		.start .title,
		.start .tagline {
			margin-inline: unset;
		}

		.title {
			font-size: var(--text-5xl);
		}
	}
</style>