@jpgilldev / steid

1.1 KBRaw
1use topcoat::{Result, router::layout, tailwind, view::view};
2
3/// The HTML shell every page renders inside.
4///
5/// A layout rather than a helper function: `view!` needs the request context in scope,
6/// so a plain `fn shell(..)` cannot build one. Layouts wrap by path prefix, and this
7/// one is at `/`, so it wraps everything.
8///
9/// `class="dark"` opts the whole document into the dark palette. Steid is dark-first —
10/// developers live there — and light mode is a later toggle rather than the default.
11#[layout("/")]
12async fn root_layout(slot: Result) -> Result {
13 let content = slot?;
14
15 view! {
16 <!DOCTYPE html>
17 <html lang="en" class="dark">
18 <head>
19 <meta charset="utf-8" />
20 <meta name="viewport" content="width=device-width, initial-scale=1" />
21 <title>"steid"</title>
22 <link rel="stylesheet" href=(tailwind::stylesheet!()) />
23 topcoat::dev::script()
24 </head>
25 <body>
26 <main class="mx-auto max-w-3xl px-6 py-10">(content)</main>
27 </body>
28 </html>
29 }
30}