tailwind-vite
v1.0.0
Published
Automates Tailwind CSS setup in Vite projects
Maintainers
Readme
tailwind-vite
Automate Tailwind CSS Setup in Your Vite Projects
Overview
tailwind-vite is a simple command-line tool designed to streamline the integration of Tailwind CSS v3 into your Vite projects. Forget the manual setup steps; this package handles the installation and configuration of necessary dependencies and files with a single command.
Features
- Automated Installation: Installs
tailwindcss@3,postcss, andautoprefixeras development dependencies. - Config Generation: Runs
npx tailwindcss init -pto createtailwind.config.jsandpostcss.config.js. - Path Configuration: Automatically configures
tailwind.config.jsto include standard template paths (./index.html,./src/**/*.{js,ts,jsx,tsx}). - CSS Directives: Adds the essential
@tailwinddirectives (base,components,utilities) to your./src/index.cssfile, creating it if it doesn't exist.
Installation
You can install tailwind-vite either globally (recommended for convenience) or as a development dependency in your project.
Global Installation
npm install -g tailwind-vite
# or
yarn global add tailwind-viteLocal Installation
npm install -D tailwind-vite
# or
yarn add -D tailwind-viteUsage
After installation, you can run the command in your terminal:
tailwind-viteWhat It Does
- Installs Dependencies: Adds
tailwindcss@3,postcss, andautoprefixerto your project. - Generates Config Files: Creates
tailwind.config.jsandpostcss.config.jsin your project root. - Configures Tailwind: Sets up the
contentpaths intailwind.config.jsto include your HTML and JavaScript files. - Creates CSS File: Generates
./src/index.csswith the necessary Tailwind directives if it doesn't already exist.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Abhay Patel - GitHub Profile
