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

Updating playground to recent (v1.7) Tailwind version #17

Merged
merged 1 commit into from
Aug 20, 2020
Merged
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
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@ 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 up [cssnano](https://cssnano.co/) to optimize your CSS for production.

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

Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
"start": "npm run serve"
},
"dependencies": {
"autoprefixer": "^9.5.1",
"tailwindcss": "^1.0"
"autoprefixer": "^9.8.6",
"tailwindcss": "^1.7.2"
},
"devDependencies": {
"@fullhuman/postcss-purgecss": "^1.2.0",
"concurrently": "^4.1.0",
"cross-env": "^5.2.0",
"concurrently": "^5.3.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"
}
}
17 changes: 5 additions & 12 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("tailwindcss"),
require("autoprefixer"),
...(process.env.NODE_ENV === "production" ? [require("cssnano")] : []),
],
};
7 changes: 4 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
purge: ["./public/**/*.html"],
theme: {
extend: {},
variants: {},
plugins: [],
},
variants: {},
plugins: [],
}
};