A starter template for simplest and fastest way to get up and running with Tailwind CSS from scratch is with the Tailwind CLI Tool.
Tailwind CSS works by scanning all of your HTML files, JavaScript components, and any other templates for class names, generating the corresponding styles
and then writing them to a static CSS file
.
Tailwind CSS requires Node.js 12.13.0 or higher.
-
Clone the repository
git clone https://github.com/syedsohan/tailwind-css-starter-using-cli.git {{ your project name }}
Alternatively you can download the zip file and unzip it.
-
The project folder that was copied across is now in your possession. Launch the Visual Studio Code editor and choose the project (recommended code editor for Tailwind CSS Projects).
-
Open new terminal within Visual Studio Code.
-
Install dependencies (Tailwind)
npm install
-
To build once run
npm run dev
You can edit the scripts in package.json
and the tailwind.config.js
file to change input/output locations.