Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

tailwindcss nextjs setup

npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

// Remember to add to tailwind.config.js

/** @type {import('tailwindcss').Config} */ 
module.exports = {
  content: [
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

// and to globals.css

@tailwind base;
@tailwind components;
@tailwind utilities;
Source by tailwindcss.com #
 
PREVIOUS NEXT
Tagged: #tailwindcss #nextjs #setup
ADD COMMENT
Topic
Name
6+1 =