DEV Community

Cover image for Set Up Tailwind Css With vite-react-app and yarn
Hridoy Halder Partho
Hridoy Halder Partho

Posted on

Set Up Tailwind Css With vite-react-app and yarn

Install Tailwind CSS with postcss & autoprefixer

yarn add -D tailwindcss postcss autoprefixer
Enter fullscreen mode Exit fullscreen mode

Generate tailwind.config.js and postcss.config.js

yarn tailwindcss init -p
Enter fullscreen mode Exit fullscreen mode

Modify tailwind.config.js file

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    extend: {},
  },
  plugins: [],
}
Enter fullscreen mode Exit fullscreen mode

Add tailwind base, components and utilities to index.css

@tailwind base;
@tailwind components;
@tailwind utilities;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)