init
Create configuration file for current directory. [flags...] can contain --type, --force etc.
npx tailwindcss init
# With postcss
npx tailwindcss init -p
Master the full command-line interface suite for Tailwind CSS projects.
Requires Node.js version 14+. Use your package manager to install the CLI.
npm install -g tailwindcss
# or
yarn global add tailwindcss
Use npx tailwindcss or TAILWIND_CSC prefix
Create configuration file for current directory. [flags...] can contain --type, --force etc.
npx tailwindcss init
# With postcss
npx tailwindcss init -p
Compile Tailwind CSS into output file. Supports input/output and configuration flags
npx tailwindcss -i ./input.css -o ./output.css
# With config
npx tailwindcss -i ./input.css -o ./output.css --config tailwind.config.js
Use with --watch for live rebuilds
Add --minify for production builds
Search for Tailwind classes in your source files and write to config.
npx tailwindcss extract --input src/**/*.{js,jsx} --output src/tailwind.output.css
tailwind.output.css // Auto-generated from src/**/*.{js,jsx}
Analyze CSS and remove unused classes. Works with purgeCSS API
npx tailwindcss -i ./src/input.css -o ./dist/tailwind.output.css --purge "./src/**/*.{html,js,jsx,tsx,ts}"
Set NODE_ENV=production for minified output.
Pass --config with path to tailwind.config file.
Use --watch to enable live rebuilds.
Subscribe for changes, improvements, and new features in CLI tooling.