summaryrefslogtreecommitdiff
path: root/examples/with-nanostores/src/layouts/Layout.astro
blob: 0eb4ecb763da1c87a78040d084bdaab7b9c72535 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
import CartFlyoutToggle from '../components/CartFlyoutToggle';
import CartFlyout from '../components/CartFlyout';

export interface Props {
	title: string;
}

const { title } = Astro.props as Props;
---

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width">
	<link rel="icon" type="image/x-icon" href="/favicon.ico" />
	<title>{title}</title>
</head>
<body>
	<header>
		<nav>
			<a href="/" class="nav-header"><span style="color: var(--astro-blue)">Astro</span> storefront</a>
			<CartFlyoutToggle client:load />
		</nav>
	</header>
	<slot />
	<CartFlyout client:load />
</body>
</html>

<style is:global>
	:root {
		--font-family: system-ui, sans-serif;
		--font-size-base: clamp(1rem, 0.34vw + 0.91rem, 1.19rem);
		--font-size-lg: clamp(1.2rem, 0.7vw + 1.2rem, 1.5rem); 
		--font-size-xl: clamp(2.0rem, 1.75vw + 1.35rem, 2.75rem);

		--color-text: hsl(12, 5%, 4%);
		--color-bg: hsl(17, 20%, 97%);
		--color-bg-2: hsl(17, 20%, 94%);
		--color-bg-3: hsl(17, 20%, 88%);
		--astro-blue: #4F39FA;
		--astro-pink: #DA62C4;

		--content-max-width: 90ch;
		--nav-height: clamp(2.44rem, 2.38vw + 1.85rem, 3.75rem);
	}

	h1 {
		font-size: var(--font-size-xl);
	}

	button {
		border: none;
		color: var(--astro-blue);
		border: 2px solid var(--astro-blue);
		transition: color 0.2s, background-color 0.2s;
		background-color: transparent;
		padding: 0.4rem 0.8rem;
		border-radius: 0.4rem;
		font-family: var(--font-family);
		font-size: var(--font-size-base);
		font-weight: bold;
		cursor: pointer;
	}

	button:hover {
		background-color: var(--astro-blue);
		color: white;
	}
</style>

<style>
	html {
		font-family: var(--font-family);
		font-size: var(--font-size-base);
		color: var(--color-text);
		background-color: var(--color-bg);
	}

	body {
		margin: 0;
	}

	header {
		background: var(--color-bg-2);
	}

	nav {
		max-width: var(--content-max-width);
		height: var(--nav-height);
		margin: auto;
		padding-inline: 1rem;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.nav-header, .nav-header:visited {
		font-size: var(--font-size-base);
		font-weight: bold;
		color: inherit;
		text-decoration: none;
	}
</style>