Repository navigation
Expand file tree
/
Copy pathCaseStudyLayout.astro
More file actions
128 lines (122 loc) · 2.68 KB
/
Copy pathCaseStudyLayout.astro
File metadata and controls
128 lines (122 loc) · 2.68 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
import BaseLayout from "../layouts/BaseLayout.astro";
import Icon from "./Icon.astro";
import { ICON_SIZES } from "../data/iconSizes";
interface Props {
title: string;
description: string;
backHref?: string;
backLabel?: string;
eyebrow: string;
heading: string;
intro: string;
}
const {
title,
description,
backHref = "/#projects",
backLabel = "Back to selected work",
eyebrow,
heading,
intro,
} = Astro.props;
---
<BaseLayout title={title} description={description}>
<main class="case-study container" id="top">
<a class="back-link" href={backHref}>
<Icon name="arrow-left" size={ICON_SIZES.sm} />
{backLabel}
</a>
<header class="case-study__hero">
<p class="eyebrow">{eyebrow}</p>
<h1>{heading}</h1>
<p class="case-study__intro">{intro}</p>
<slot name="meta" />
</header>
<div class="case-study__body">
<aside class="case-study__aside">
<slot name="aside" />
</aside>
<article class="case-study__prose">
<slot />
</article>
</div>
</main>
</BaseLayout>
<style>
.case-study {
padding-top: 10rem;
padding-bottom: 7rem;
}
.back-link {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--color-text-muted);
font-size: 0.85rem;
}
.case-study__hero {
max-width: 60rem;
margin: 5rem 0 4rem;
}
h1 {
max-width: 11ch;
margin: 1rem 0 1.75rem;
font-size: clamp(3.5rem, 9vw, 8rem);
line-height: 0.92;
letter-spacing: -0.07em;
}
.case-study__intro {
max-width: 40rem;
color: var(--color-text-secondary);
font-size: clamp(1.15rem, 2vw, 1.5rem);
line-height: 1.65;
}
.case-study__body {
display: grid;
grid-template-columns: minmax(12rem, 0.6fr) minmax(0, 1.4fr);
gap: clamp(3rem, 10vw, 9rem);
margin-top: 7rem;
}
.case-study__aside {
position: sticky;
top: 8rem;
align-self: start;
}
.case-study__prose {
max-width: 42rem;
}
.case-study__prose .eyebrow:not(:first-child) {
margin-top: 5rem;
}
.case-study__prose h2 {
max-width: 15ch;
margin: 0.8rem 0 1.5rem;
font-size: clamp(2rem, 4vw, 3.5rem);
line-height: 1;
letter-spacing: -0.055em;
}
.case-study__prose p:not(.eyebrow) {
color: var(--color-text-secondary);
line-height: 1.85;
}
.case-study__prose code {
color: var(--color-text);
font: 0.9em var(--font-mono);
}
@media (max-width: 700px) {
.case-study {
padding-top: 8rem;
}
.case-study__hero {
margin-top: 4rem;
}
.case-study__body {
grid-template-columns: 1fr;
margin-top: 5rem;
}
.case-study__aside {
position: static;
}
}
</style>