Unverified Commit cffdf1e0 authored by Pranav P's avatar Pranav P Committed by GitHub

Update tailwind css to v2.1 with jit support (#23793)




## Documentation / Examples

- [x] Make sure the linting passes
parent a561dd9c
# Next.js + Tailwind CSS Example # Next.js + Tailwind CSS Example
This example shows how to use [Tailwind CSS](https://tailwindcss.com/) (v2) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs). This example shows how to use [Tailwind CSS](https://tailwindcss.com/) (v2.1) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs).
It uses the new [`@tailwindcss/jit`](https://github.com/tailwindlabs/tailwindcss-jit) engine for Tailwind CSS. It uses the new [`Just-in-Time Mode`](https://tailwindcss.com/docs/just-in-time-mode) for Tailwind CSS.
## Deploy your own ## Deploy your own
......
...@@ -13,9 +13,8 @@ ...@@ -13,9 +13,8 @@
"react-dom": "^17.0.1" "react-dom": "^17.0.1"
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/jit": "0.1.3",
"autoprefixer": "^10.0.4", "autoprefixer": "^10.0.4",
"postcss": "^8.1.10", "postcss": "^8.1.10",
"tailwindcss": "^2.0.2" "tailwindcss": "^2.1.1"
} }
} }
import '../styles/globals.css' import 'tailwindcss/tailwind.css'
function MyApp({ Component, pageProps }) { function MyApp({ Component, pageProps }) {
return <Component {...pageProps} /> return <Component {...pageProps} />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// https://tailwindcss.com/docs/using-with-preprocessors // https://tailwindcss.com/docs/using-with-preprocessors
module.exports = { module.exports = {
plugins: { plugins: {
'@tailwindcss/jit': {}, tailwindcss: {},
autoprefixer: {}, autoprefixer: {},
}, },
} }
@tailwind base;
@tailwind components;
@tailwind utilities;
module.exports = { module.exports = {
mode: 'jit',
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'], purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
darkMode: false, // or 'media' or 'class' darkMode: false, // or 'media' or 'class'
theme: { theme: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment