MaverickChan's avatar

Using Tailwindcss 2.0 in a Laravel8 project

Finally i figure out how to install Tailwindcss 2.0 in a Laravel 8 project. The offical document is not so clear.

1 run install command

npm install tailwindcss postcss autoprefixer

1 - a Put the directives in app.css located in /resources/css/

@tailwind base;
@tailwind components;
@tailwind utilities;

2 create a file called postcss.config.js under the root directory of your project, and make the file like this

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  }
}

3 the most tricky part is , you have to upgrade laravel-mix to 6.0, in your package.json file change laravel-mix line to

"laravel-mix": "^6.0.0-beta.14",

4 run

npm install

5 run

npm run dev
0 likes
3 replies
srasch's avatar

Pretty cool.

You can run npx mix instead of npm run dev if it's setup correctly.

Sinnbeck's avatar

Consider creating a new thread where you explain your problem and what errors you are getting.

Please or to participate in this conversation.