Answers for "add tailwind to next"

CSS
1

add tailwind to next

npx create-next-app -e with-tailwindcss my-project
cd my-project
Posted by: Guest on June-19-2021
0

add tailwind to next

# If you're on Next.js v10 or newer
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest

# If you're on Next.js v9 or older
npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
Posted by: Guest on August-28-2021
0

add tailwind to next

npx tailwindcss init -p
Posted by: Guest on August-28-2021
0

add tailwind to next

// tailwind.config.js
  module.exports = {
-   purge: [],
+   purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
    darkMode: false, // or 'media' or 'class'
    theme: {
      extend: {},
    },
    variants: {
      extend: {},
    },
    plugins: [],
  }
Posted by: Guest on August-28-2021
0

add tailwind to next

// pages/_app.js
- import '../styles/globals.css'
+ import 'tailwindcss/tailwind.css'

  function MyApp({ Component, pageProps }) {
    return <Component {...pageProps} />
  }

  export default MyApp
Posted by: Guest on August-28-2021
0

add tailwind to next

// pages/_app.js
import '../styles/globals.css'

function MyApp({ Component, pageProps }) {
  return <Component {...pageProps} />
}

export default MyApp
Posted by: Guest on August-28-2021
0

add tailwind to next

// tailwind.config.js
module.exports = {
  purge: [],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
}
Posted by: Guest on August-28-2021
0

add tailwind to next

/* ./styles/globals.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
Posted by: Guest on August-28-2021
0

add tailwind to next

// postcss.config.js
module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
}
Posted by: Guest on August-28-2021

Browse Popular Code Answers by Language