How to configure Tailwind CSS for Remix when using SPA mode (Vite with ssr: false)? #9125
Replies: 3 comments 1 reply
-
follow this guide: |
Beta Was this translation helpful? Give feedback.
0 replies
-
The correct content of
Strangely an error still shows in the terminal; however, Remix + Vite + Tailwind seem to be working now.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
The URL param (?url) at the end of the tailwind.css stylesheet import solved my issue. In root.tsx file,
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to understand how to configure Tailwind CSS for Remix when using SPA mode template.
I created normal SPA Remix using the new template:
npx create-remix@latest --template remix-run/remix/templates/spa
I have configured the 'base
and
basenameof
vite.config.ts` for GitHub deploymentThen I attempted to go through the standard Tailwind CSS however the default configuration using @tailwind directives in CSS seem to fail.
Error
I looked more at the documentation and saw this note:
The docs for PostCSS are very minimal, but from my understanding I should create
postcss.config.ts
that specifies to use tailwind likeHowever, then this failed with
At this point I realized I didn't know enough to continue and decided it was better to ask for help 😊
I thought either there is something simple I can configure such as
base
andbasename
to make the@tailwind
directive work OR perhaps this is more complicated and this is the reason that there are not dedicated documentation for yetIf anyone has done this successfully, a link to repo or docs would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions