Skip to content

Commit

Permalink
Major Update: Tailwindcss v3 + Parcel v2
Browse files Browse the repository at this point in the history
  • Loading branch information
imsus committed Oct 15, 2021
1 parent f5727c4 commit 9da3424
Show file tree
Hide file tree
Showing 18 changed files with 4,930 additions and 2,777 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.cache
.parcel-cache
node_modules
dist
6 changes: 6 additions & 0 deletions .postcssrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": {
"tailwindcss": {},
"autoprefixer": {}
}
}
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,14 @@
<p align="center">Basic project boilerplate with TailwindCSS. This is suited for in-browser prototyping.<p>
<p align="center">
<a href="https://github.com/imsus"><img src="https://badgen.net/badge/author/@imsus/grey" alt="author badge with @imsus written on it"></a>
<img src="https://badgen.net/badge/featuring/tailwindcss%2ftailwindcss,parcel-bundler%2fparcel/cyan?list=1" alt="featuring badge with tailwind/tailwindcss and parcel-bundler/parcel written on it">
<img src="https://badgen.net/badge/featuring/tailwindlabs%2ftailwindcss,parcel-bundler%2fparcel/cyan?list=1" alt="featuring badge with tailwindlabs/tailwindcss and parcel-bundler/parcel written on it">
<a href="https://github.com/imsus/tailwind-parcel/blob/master/LICENSE.md"><img src="https://badgen.net/badge/license/MIT/blue" alt="license badge with MIT written on it"></a>
</p>



## ⭐️ Features

- Structured import using [postcss-import](https://github.com/postcss/postcss-import).
- Support nested like Sass using [postcss-nested](https://github.com/postcss/postcss-nested).
- Support future CSS spec using [postcss-preset-env](https://github.com/csstools/postcss-preset-env).
- Build system using [parcel-bundler](https://github.com/parcel-bundler/parcel).
- Remove all unnecessary CSS on production using [postcss-purgecss](https://github.com/FoundrySH/postcss-purgecss).

## ⚠️ Requirements

1. You must installed `parcel-bundler` globally. Run `npm i -g parcel-bundler` or `yarn global add parcel-bundler` if you have `yarn`.
2. Make sure you can run `parcel` in terminal. You should put `parcel` inside your `PATH` environment variable (`npm` and `yarn` takes care of this).

## ✅ Usage

1. Clone/Download this repo.
2. Install code dependencies. Run `npm install` or `yarn install` if you prefer `yarn` over `npm`.
3. Start the development. Run `npm run dev` or `yarn dev`. This will watch `index.html` file and other files referenced inside `index.js` file.
4. If you are finished the development and want to move into production then run `npm run prod` or `yarn prod`. This will bundle all of the code, minify, and remove all unused code inside from `tailwindcss` dependencies.
- All Just-in-time TailwindCSS using v3
- Short cold start dev-server
- Powered by PNPM
6 changes: 0 additions & 6 deletions css/base.css

This file was deleted.

1 change: 0 additions & 1 deletion css/lib/components.css

This file was deleted.

1 change: 0 additions & 1 deletion css/lib/preflight.css

This file was deleted.

1 change: 0 additions & 1 deletion css/lib/utilities.css

This file was deleted.

7 changes: 0 additions & 7 deletions css/main.css

This file was deleted.

1 change: 0 additions & 1 deletion img/tailwind.svg

This file was deleted.

75 changes: 23 additions & 52 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,58 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Tailwind Parcel</title>
<meta name="description" content="Simple TailwindCSS boilerplate designed for in-browser prototyping.">
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/pwacompat.min.js" integrity="sha384-GOaSLecPIMCJksN83HLuYf9FToOiQ2Df0+0ntv7ey8zjUHESXhthwvq9hXAZTifA" crossorigin="anonymous"></script>
</head>
<body>
<div class="min-h-screen font-sans container px-3 py-24 mx-auto leading-none bg-bottom bg-no-repeat">

<header class="text-center mb-16 md:mb-32">
<h1 class="font-semibold text-3xl lg:text-5xl mb-3">Tailwind Parcel</h1>
<p class="text-lg lg:text-2xl mb-8 leading-tight">Simple TailwindCSS boilerplate designed for in-browser prototyping.</p>
<div class="text-lg flex justify-center">
<a target="_blank" rel="noopener" class="text-blue-dark no-underline inline-flex items-center" href="https://github.com/imsus/tailwind-parcel">
<span>Github Repository</span>
<i data-feather="chevron-right"></i>
</a>
</div>
</header>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tailwind Parcel</title>
<meta name="description" content="Simple TailwindCSS boilerplate designed for in-browser prototyping.">
<link rel="stylesheet" href="./main.css">
</head>

<main class="max-w-lg mx-auto">
<div class="md:-mx-8 flex flex-wrap">
<div class="w-full mb-16 md:mb-0 md:w-1/2 md:px-8">
<img class="flex mb-6 object-fit" height="50" src="./img/tailwind.svg" alt="">
<h3 class="font-semibold text-2xl mb-4">TailwindCSS</h3>
<p class="leading-normal mb-4">Tailwind is a utility-first CSS framework for rapidly building custom user interfaces.</p>
<a target="_blank" rel="noopener" class="text-blue-dark no-underline inline-flex items-center" href="https://tailwindcss.com/docs/what-is-tailwind/">
<span>View TailwindCSS Docs</span>
<i data-feather="arrow-up-right"></i>
</a>
</div>
<div class="w-full md:w-1/2 md:px-8">
<img class="flex mb-6 object-fit" height="50" width="175" src="https://user-images.githubusercontent.com/19409/31321658-f6aed0f2-ac3d-11e7-8100-1587e676e0ec.png" alt="">
<h3 class="font-semibold text-2xl mb-4">Parcel Bundler</h3>
<p class="leading-normal mb-4">Parcel is a web application bundler, differentiated by its developer experience. It offers blazing fast performance utilizing multicore processing, and requires zero configuration.</p>
<a target="_blank" rel="noopener"class="text-blue-dark no-underline inline-flex items-center" href="https://parceljs.org/getting_started.html">
<span>View how to use ParcelJS</span>
<i data-feather="arrow-up-right"></i>
</a>
</div>
</div>
</main>
<body class="bg-white dark:bg-black">
<div class="font-sans mx-auto min-h-screen leading-none py-24 px-3">
<h1
class="font-extrabold mx-auto my-5 text-black leading-tight max-w-4xl text-4xl md:text-5xl lg:my-10 xl:text-6xl dark:text-white">
<span class="text-teal-500 dark:text-teal-400">TailwindCSS&nbsp;v3</span>
&times;
<span class="text-violet-500 dark:text-violet-400">Parcel&nbsp;v2</span>
</h1>
<p class="mx-auto leading-normal max-w-4xl text-2xl text-gray-700 lg:text-3xl">
Boilerplate to create HTML page for speedy website prototyping.
<a class="text-blue-700 underline" href="https://github.com/imsus/tailwind-parcel" target="_blank"
rel="noopener">View&nbsp;Repo&nbsp;on&nbsp;GitHub.</a>
</p>
</div>
</body>

</div>

<script defer src="./index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/feather.min.js" integrity="sha256-km9ViEDg2jYMRIV3IgvhZkrGIXt7e+T0zYez9FC064c=" crossorigin="anonymous"></script>
<script>
feather.replace({
height: 19
})
</script>
</body>
</html>
1 change: 0 additions & 1 deletion index.js

This file was deleted.

3 changes: 3 additions & 0 deletions main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
39 changes: 26 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
{
"name": "tailwind-parcel",
"version": "1.0.0",
"version": "2.0.0",
"description": "Sample boilerplate with tailwindcss and parceljs aimed for speedy webpage development.",
"main": "index.js",
"source": "index.html",
"browserslist": "> 0.5%, last 2 versions, not dead",
"scripts": {
"dev": "parcel",
"build": "parcel build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/imsus/tailwind-parcel.git"
},
"keywords": [
"tailwindcss",
"parceljs"
],
"author": "Imam Susanto",
"license": "MIT",
"private": true,
"devDependencies": {
"cssnano": "^4.0.4",
"postcss-import": "^11.1.0",
"postcss-nested": "^3.0.0",
"postcss-preset-env": "^5.3.0",
"postcss-purgecss": "^1.0.0",
"tailwindcss": "^0.6.4"
"bugs": {
"url": "https://github.com/imsus/tailwind-parcel/issues"
},
"scripts": {
"dev": "parcel serve index.html",
"prod": "parcel build index.html"
"homepage": "https://github.com/imsus/tailwind-parcel#readme",
"devDependencies": {
"@tailwindcss/forms": "^0.4.0-alpha.1",
"@tailwindcss/typography": "^0.5.0-alpha.2",
"autoprefixer": "^10.3.7",
"parcel": "^2.0.0",
"postcss": "^8.3.9",
"tailwindcss": "^3.0.0-alpha.1"
}
}
Loading

0 comments on commit 9da3424

Please sign in to comment.