Search
 
SCRIPT & CODE EXAMPLE
 

CSS

next js with tailwind css

npx create-next-app -e with-tailwindcss pName
Comment

next js with tailwind css

npx create-next-app -e with-tailwindcss projectname
//this will create your nextjs application and integrate JIT engine and Tailwind-CSS in it.
Comment

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
Comment

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: [],
  }
Comment

add tailwind to next

/* ./styles/globals.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
Comment

tailwind css next

yarn add -D tailwindcss postcss autoprefixer
Comment

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
Comment

add tailwind to next

// postcss.config.js
module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
}
Comment

add tailwind to next

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

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

export default MyApp
Comment

add tailwind to next

npx tailwindcss init -p
Comment

PREVIOUS NEXT
Code Example
Css :: css not working 
Css :: css display flex white-space: nowrap; 
Css :: download styles.css 
Css :: select parent element css 
Css :: css local variable 
Css :: z-index on position absolute 
Css :: :global css 
Css :: safari version 10+ media query 
Css :: media queries in scss 
Css :: transform css 
Css :: inline block and 50% width not aligning items 
Css :: spaziatura caratteri css 
Css :: how to make the position of a div always stay while scrolling 
Css :: exclude html content when print 
Css :: lando expose database port 
Css :: highchart change font 
Css :: ssh into docker container ddev 
Css :: before width not working 
Css :: map arrays 
Css :: center input element css 
Css :: css hide all elements after nth 
Css :: css responsive tabs 
Css :: css box-sizing property 
Css :: what happens when the width is 0 and there is a border and box-sizing is set to border-box? 
Css :: css make a cell twice as big flexbox 
Css :: selector css 
Css :: css font family for all titles 
Css :: css position 
Css :: grandezza caratteri css 
Css :: form style popup css 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =