jawsdev / Basic-Tailwind-Parcel-Starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build

npx parcel src/index.html

To re-create this type of build:

https://tailwindcss.com/docs/guides/parcel

Create your project

Terminal

mkdir my-project
cd my-project
npm install -D parcel
mkdir src
touch src/index.html

Install Tailwind CSS

Terminal
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

Configure your template paths

tailwind.config.js
  content: [
    "./src/**/*.{html,js,ts,jsx,tsx}",
  ],

Add the Tailwind directives to your CSS

style.css
@tailwind base;
@tailwind components;
@tailwind utilities;

Start your build process

Terminal
npx parcel src/index.html

Start using Tailwind in your project

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

About


Languages

Language:HTML 50.7%Language:JavaScript 38.5%Language:CSS 10.8%