summaryrefslogtreecommitdiff
path: root/examples/docs/src/components/PageContent/PageContent.astro
blob: 49a74ab7078d233f7b3c674797d394556e448caf (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
---
import MoreMenu from '../RightSidebar/MoreMenu.astro';
import TableOfContents from '../RightSidebar/TableOfContents';

const { frontmatter, headings, githubEditUrl } = Astro.props;
const title = frontmatter.title;
---

<article id="article" class="content">
	<section class="main-section">
		<h1 class="content-title" id="overview">{title}</h1>
		<nav class="block sm:hidden">
			<TableOfContents client:media="(max-width: 50em)" {headings} />
		</nav>
		<slot />
	</section>
	<nav class="block sm:hidden">
		<MoreMenu editHref={githubEditUrl} />
	</nav>
</article>

<style>
	.content {
		padding: 0;
		max-width: 75ch;
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
	}

	.content > section {
		margin-bottom: 4rem;
	}

	.block {
		display: block;
	}

	@media (min-width: 50em) {
		.sm\:hidden {
			display: none;
		}
	}
</style>