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

ashirbadgudu

Ashirbad Panigrahi

Posted on January 1, 2022

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

Create a new react project with yarn

yarn create react-app react-tailwind-css-stater
Enter fullscreen mode Exit fullscreen mode

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

module.exports = {
  content: ["./src/**/*.{js,jsx,ts,tsx}"],
  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

GitHub Repo

💖 💪 🙅 🚩
ashirbadgudu
Ashirbad Panigrahi

Posted on January 1, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related