9 Replies
Wohooo @Jestem_Kamil, you just became a Waspeteer level 1!
Hi @Jestem_Kamil. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
i just want bot answer
----------------------
To add Tailwind CSS to your Wasp project, you need to follow these steps:
1. Add two configuration files,
tailwind.config.cjs
and postcss.config.cjs
, to the root directory of your project.
Here's an example of how these files should look:
tailwind.config.cjs
:
postcss.config.cjs
:
2. Import Tailwind into your CSS file. For example, in a new project you might import Tailwind into Main.css
.
./src/Main.css
:
3. Start using Tailwind in your React components. For example:
./src/MainPage.jsx
:
If you want to add Tailwind plugins, install them as npm development dependencies and add them to the plugins list in your tailwind.config.cjs
file. For example:
And then add them to your tailwind.config.cjs
file:
If you can't use Tailwind after adding the required config files, make sure to restart wasp start
. This is sometimes needed to ensure that Wasp picks up the changes and enables Tailwind integration.
For more details, you can refer to the Wasp documentation (https://wasp-lang.dev/docs/project/css-frameworks#tailwind).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Jestem_Kamil, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?can i install it 100% like in normal Vite project? npx tailwindcss init
@kapa.ai
Let me check the knowledge base for you. One moment! :books:
Sorry @Jestem_Kamil, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
@kapa.ai can i install it 100% like in normal Vite project? npx tailwindcss init
Let me check the knowledge base for you. One moment! :books:
----------------------
No, the process of adding Tailwind CSS to a Wasp project is slightly different from a normal Vite project. In a Wasp project, you need to manually create and configure the
tailwind.config.cjs
and postcss.config.cjs
files in the root directory of your project.
Here's an example of how these files should look:
tailwind.config.cjs
:
postcss.config.cjs
:
You then need to import Tailwind into your CSS file and start using Tailwind in your React components.
For more details, you can refer to the Wasp documentation (https://wasp-lang.dev/docs/project/css-frameworks#tailwind).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Jestem_Kamil, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@Jestem_Kamil check this out for exact instructions https://wasp-lang.dev/docs/project/css-frameworks#tailwind