Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

tailwind nextjs

//Code from Tailwind docs - https://tailwindcss.com/docs/guides/nextjs

//Terminal - Start your project
npx create-next-app my-project
cd my-project

//Terminal - Install Tailwind
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

//Create tailwind.config.js
module.exports = {
  content: [
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

//Add Tailwind to your globals.css file
@tailwind base;
@tailwind components;
@tailwind utilities;

//Terminal - Initiate your project
npm run dev

//START USING TAILWIND!
export default function ExampleComponent() {
  return (
    <h1 className="text-3xl font-bold underline">
      Hello from Tailwind!
    </h1>
  )
}

//Extra - Install Tailwind Intellisense from VS Code for
//an amazing experience!
Comment

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;
Comment

PREVIOUS NEXT
Code Example
Javascript :: use emmet autocomplete with jsx vs code 
Javascript :: componentdidmount hooks 
Javascript :: jquery loop through json 
Javascript :: htmlWebpackPlugin.options.title 
Javascript :: mac install jmeter 
Javascript :: golang convert json string to map 
Javascript :: javascript max safe integer 
Javascript :: pattern telefone js 
Javascript :: jquery change text of div 
Javascript :: material ui input placeholder color 
Javascript :: react font awesome npm 
Javascript :: javascript subtract days from date 
Javascript :: title case a sentence-javascript 
Javascript :: js add value to html input 
Javascript :: how to run react build locally 
Javascript :: remove multiple values from array javascript 
Javascript :: read json file node js 
Javascript :: install the same version of package in the package.json 
Javascript :: react native textinput lowercase 
Javascript :: login to discord using token 
Javascript :: fetch bearer token 
Javascript :: location on select dropdown redirect jquery 
Javascript :: string to JSONobject + android 
Javascript :: express hello world 
Javascript :: javascript array unique values 
Javascript :: javascript reserved words 
Javascript :: This version of CLI is only compatible with Angular versions 0.0.0 || ^10.0.0-beta || =10.0.0 <11.0.0, but Angular version 9.1.3 was found instead. 
Javascript :: how to check if url has hash in react 
Javascript :: change font js 
Javascript :: canvas fillrect 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =