SolidJSS
SolidJSโ€ข5mo agoโ€ข
3 replies
maxwell8888

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>
  );
}
Was this page helpful?