Integrate Twind with Remix with SSR.
Open this example on CodeSandbox:
This example shows how to use Twind in Remix. Twind is a small compiler (~13kB) that converts Tailwind utility classes into CSS at runtime.
Relevant files:
- app/entry.server.tsx where the twind styles have been added to the markup to enable server-side-rendering (SSR) of styles.
- app/root.tsx where twind has been set up.
- app/routes/_index.tsx and app/routes/anything.tsx where some basic styling has been demonstrated.
- remix.config.js where the twind modules have been added to
serverDependenciesToBundle
. - twind.config.ts (optional) where twind can be configured.