npm init -y
Note: installing tailwindcss, postcss, postcss-cli, autoprefixer, vite as Dev dependicies.
npm install -D tailwindcss postcss postcss-cli autoprefixer vite
Note: generating a configuration file for Tailwindcss and postcss
npx tailwindcss init -p
Note: in oreder to get the tailwindcss classes, you have to create a css compile file, and another css file where you store the complie result
toch src/css/app.css
toch src/css/main.css
- Add the following lines to
app.css
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
- Compling the
app.css
file tomain.css
file by runing the following commande
npm run build:css
npm run dev
Note: all commandes are definde in
package.json
file.