Here's a step-by-step guide on how to install Tailwind CSS v4 in your Ionic project:
First, you need to install Tailwind CSS to use it within your Ionic project.
Open your terminal and run the following command:
Next, you'll need to configure Vite to use the Tailwind. Open your vite.config.ts file and add the following configuration:
Now, create or update your theme/variables.css to include the Tailwind CSS styles. This will allow you to customize and use Tailwind’s utility classes throughout your Ionic app.
In your variables.css, add the following:
That's it! You’ve successfully integrated Tailwind CSS v4 with your Ionic project. Now, you can use Tailwind’s utility classes throughout your app while retaining Ionic's unique styles!