| 1 | /// <reference types="vite/client" /> |
| 2 | import { HeadContent, Scripts, createRootRoute } from "@tanstack/solid-router"; |
| 3 | import type * as Solid from "solid-js"; |
| 4 | import { HydrationScript } from "solid-js/web"; |
| 5 | |
| 6 | export const Route = createRootRoute({ |
| 7 | head: () => ({ |
| 8 | meta: [ |
| 9 | { charSet: "utf-8" }, |
| 10 | { |
| 11 | name: "viewport", |
| 12 | content: "width=device-width, initial-scale=1", |
| 13 | }, |
| 14 | { title: "TanStack Start Solid on Cloudflare" }, |
| 15 | ], |
| 16 | }), |
| 17 | shellComponent: RootDocument, |
| 18 | }); |
| 19 | |
| 20 | function RootDocument(props: Readonly<{ children: Solid.JSX.Element }>) { |
| 21 | return ( |
| 22 | <html lang="en"> |
| 23 | <head> |
| 24 | <HydrationScript /> |
| 25 | <HeadContent /> |
| 26 | </head> |
| 27 | <body |
| 28 | style={{ |
| 29 | margin: 0, |
| 30 | "font-family": "ui-sans-serif, system-ui, sans-serif", |
| 31 | background: "#f8fafc", |
| 32 | color: "#0f172a", |
| 33 | }} |
| 34 | > |
| 35 | {props.children} |
| 36 | <Scripts /> |
| 37 | </body> |
| 38 | </html> |
| 39 | ); |
| 40 | } |