How to add class to body in Solid Start

Probably a stupid beginners question, but I'm migrating my app from a Vite SPA to Solid Start and I have some tailwind classes on the body element but cannot find any examples anywhere of how to access the body element in Solid Start. I've looked through the docs, all the example in the repo, this discord and can't find anything. Below is my app.tsx
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";
import Nav from "~/components/Nav";
import "./app.css";
import { MetaProvider } from "@solidjs/meta";

export default function App() {
return (
<MetaProvider>
<Router
root={props => (
<>
<Nav />
<Suspense>{props.children}</Suspense>
</>
)}
>
<FileRoutes />
</Router>
</MetaProvider>
);
}
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";
import Nav from "~/components/Nav";
import "./app.css";
import { MetaProvider } from "@solidjs/meta";

export default function App() {
return (
<MetaProvider>
<Router
root={props => (
<>
<Nav />
<Suspense>{props.children}</Suspense>
</>
)}
>
<FileRoutes />
</Router>
</MetaProvider>
);
}
3 Replies
brenelz
brenelz11h ago
You can add them to entry-server file I believe
maxwell8888
maxwell8888OP11h ago
Ah yes it is right there. I didn't even think to look in the server file. Thanks!
brenelz
brenelz11h ago
Perfect

Did you find this page helpful?