Skip to content
This repository was archived by the owner on Jan 5, 2021. It is now read-only.

Updated repo #14

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,46 @@ To get started:

1. Clone the repository:

```bash
git clone https://github.com/tailwindcss/playground.git tailwindcss-playground
```bash
git clone https://github.com/tailwindcss/playground.git tailwindcss-playground

cd tailwindcss-playground
```
cd tailwindcss-playground
```

2. Install the dependencies:

```bash
# Using npm
npm install
```bash
# Using npm
npm install

# Using Yarn
yarn
```
# Using Yarn
yarn
```

3. Start the development server:

```bash
# Using npm
npm run serve
```bash
# Using npm
npm run serve

# Using Yarn
yarn run serve
```
# Using Yarn
yarn run serve
```

Now you should be able to see the project running at localhost:8080.
Now you should be able to see the project running at localhost:8080.

4. Open `public/index.html` in your editor and start experimenting!

## Building for production

Even though this isn't necessarily a starter kit for a proper project, we've included an example of setting up both [Purgecss](https://www.purgecss.com/) and [cssnano](https://cssnano.co/) to optimize your CSS for production.
Even though this isn't necessarily a starter kit for a proper project, we've included an example of setting [cssnano](https://cssnano.co/) to optimize your CSS for production and added configured [tailwind.config.js](tailwind.config.css) to remove unused CSS.

```js
module.exports = {
purge: ['./public/**/*.html'],
...
};
```

To build an optimized version of your CSS, simply run:

Expand Down
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
"production": "cross-env NODE_ENV=production postcss public/tailwind.css -o public/build/tailwind.css",
"start": "npm run serve"
},
"dependencies": {
"autoprefixer": "^9.5.1",
"tailwindcss": "^1.0"
},
"devDependencies": {
"@fullhuman/postcss-purgecss": "^1.2.0",
"concurrently": "^4.1.0",
"cross-env": "^5.2.0",
"concurrently": "^5.2.0",
"cross-env": "^7.0.2",
"cssnano": "^4.1.10",
"live-server": "^1.2.1",
"postcss-cli": "^6.1.2"
"postcss-cli": "^7.1.1",
"postcss-preset-env": "^6.7.0",
"tailwindcss": "^1.4.6"
}
}
15 changes: 4 additions & 11 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
const purgecss = require('@fullhuman/postcss-purgecss')({
content: ['./public/**/*.html'],
defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || []
})

module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
...process.env.NODE_ENV === 'production'
? [purgecss, require('cssnano')]
: []
]
}
require('postcss-preset-env'),
...(process.env.NODE_ENV === 'production' ? [require('cssnano')] : []),
],
};
Loading