Skip to content

Commit

Permalink
Update example for Tailwind v3 (#32339)
Browse files Browse the repository at this point in the history
# Update example for Tailwind v3

I updated the example used by the [official docs](https://tailwindcss.com/docs/guides/nextjs) to reference Tailwind v3 with the necessary changes. I _did not_ update the emotion example because it's using the xwind package which will likely need to be updated first.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
  • Loading branch information
thecrypticace committed Dec 9, 2021
1 parent 93ef28b commit 4d4f309
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
4 changes: 1 addition & 3 deletions examples/with-tailwindcss/README.md
@@ -1,8 +1,6 @@
# Next.js + Tailwind CSS Example

This example shows how to use [Tailwind CSS](https://tailwindcss.com/) [(v2.2)](https://blog.tailwindcss.com/tailwindcss-2-2) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs).

It uses the new [`Just-in-Time Mode`](https://tailwindcss.com/docs/just-in-time-mode) for Tailwind CSS.
This example shows how to use [Tailwind CSS](https://tailwindcss.com/) [(v3.0)](https://tailwindcss.com/blog/tailwindcss-v3) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs).

## Preview

Expand Down
6 changes: 3 additions & 3 deletions examples/with-tailwindcss/package.json
Expand Up @@ -11,8 +11,8 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"autoprefixer": "^10.2.6",
"postcss": "^8.3.5",
"tailwindcss": "^2.2.4"
"autoprefixer": "^10.4.0",
"postcss": "^8.4.4",
"tailwindcss": "^3.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/with-tailwindcss/pages/_app.js
@@ -1,4 +1,4 @@
import 'tailwindcss/tailwind.css'
import '../styles/globals.css'

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
Expand Down
3 changes: 3 additions & 0 deletions examples/with-tailwindcss/styles/globals.css
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
10 changes: 4 additions & 6 deletions examples/with-tailwindcss/tailwind.config.js
@@ -1,12 +1,10 @@
module.exports = {
mode: 'jit',
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
darkMode: false, // or 'media' or 'class'
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [],
}

0 comments on commit 4d4f309

Please sign in to comment.