Tailwind CSS CLI

Tailwind CSS

install

npm init -y
npm install -D tailwindcss postcss-cli autoprefixer
npx tailwindcss init -p

postcss.config.js

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

tree

src
 |- index.html
 |- input.css
 |- style.css

input.css

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

tailwind.config.js

module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    extend: {},
  },
  plugins: [],
}

package.json > scripts

"dev": "postcss ./src/input.css -o ./src/style.css --watch --verbose"

run

npm run dev