Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tbs96/tailwindcss-tutorial


https://github.com/tbs96/tailwindcss-tutorial

tailwindcss

Last synced: 23 days ago
JSON representation

Awesome Lists containing this project

README

        

# TailwindCSS setup with `Vite`, `PostCSS`, `AutoPrefixer`:

## 1. Setup `npm`:
```bash
npm init -y
```

## 2. Install & initialize:
```bash
npm install -D tailwindcss postcss autoprefixer vite
```
```bash
npx tailwindcss init -p
```

## 3. Open `tailwind.config.js` file & set content as ALL (*):
```bash
content: ['*']
```

## 4. Create folder `CSS` & a file within it, as `main.css` & add the Tailwind directives:
```bash
@tailwind base;
@tailwind components;
@tailwind utilities;
```

## 5. Link `CSS/main.css` with `index.html`
```bash

```

## 6. Open `package.json` and set the below, under scripts:
```bash
"start": "vite"
```

## 7. Open terminal & run:
```bash
npm run start
```

# To install & use `daisyUI`:

## 1. Follow upto `5th` step from above.

## 2. Install `daisyUI` as a Node package:
```bash
npm i -D daisyui@latest
```

## 3. Add `daisyUI` to `tailwind.config.js` => `module.exports` => `plugins[]`:
```bash
require('daisyui')
```

## 4. Goto `package.json` => `"scripts":{}` & add the following:
```bash
"dev": "vite"
```

## 5. Open terminal & run:
```bash
npm run dev
```

# To build for production:

## Goto `package.json` => `"scripts":{}` & add the following:
```bash
"build": "vite build"
```