Skip to content

A ux/ui design tool to setup a quick tailwind environment which is also vscode friendly

Notifications You must be signed in to change notification settings

awebfactory/awf-quickie-tailwind-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tailwind CLI Environment

Usage

Install dependencies in package.json

npm install

Run watch script

npm run watch
  • Tailwind output goes to ./html/css/style.css

Work in VSCode

code .
  • Then edit ./html/index.html
    • It is looking at ./html/css/style.css
  • View in Live Server or wherever to visualize changes

Or run build if you're just going to look without making changes

npm run build

Created roughly like this

Install Tailwind CSS

npm init
npm install -D tailwindcss
npx tailwindcss init

Configure template paths in tailwind.config.js

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

Add the Tailwind directives to your CSS (./tailwind.css)

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

Add watch and build scripts to package.json

  "scripts": {
    "watch": "tailwindcss -i ./tailwind.css -o ./html/css/style.css --watch",
    "build": "tailwindcss -i ./tailwind.css -o ./html/css/style.css"
  },

Start using Tailwind in your HTML

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="css/output.css" rel="stylesheet" />
  </head>
  <body>
    <h1 class="text-3xl font-bold underline">Hello world!</h1>
  </body>
</html>

Run watch script

npm run watch

Run build

npm run build

About

A ux/ui design tool to setup a quick tailwind environment which is also vscode friendly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published