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 :: write html is jsx extension for vscode 
Javascript :: redirecting in react 
Javascript :: how to get current year in nodejs 
Javascript :: scroll to top jquery 
Javascript :: install jmeter mac 
Javascript :: detect keypress 
Javascript :: how to convert the file pdf into json format in python 
Javascript :: how to make javascript progarm that randomly displayes a word 
Javascript :: generate random email javascript 
Javascript :: delete all childs in node 
Javascript :: adding font awesome to npm or react 
Javascript :: disable default sorting in datatable 
Javascript :: angular 8 how to iterate json object in view 
Javascript :: javascript check if date is less than today 
Javascript :: string pop last char js 
Javascript :: fs in angular 
Javascript :: how to remove id in jquery 
Javascript :: how to make a purge command discord.js 
Javascript :: min object value in array 
Javascript :: angular form set value without fire event 
Javascript :: laravel 8 include javascript in blade 
Javascript :: js before unload 
Javascript :: npm could not determine node.js install directory 
Javascript :: javascript prepend element to array 
Javascript :: datatable processing 
Javascript :: laravel variable in javascript 
Javascript :: leaflet change zoom button position 
Javascript :: how to filter array objesct in express node js 
Javascript :: formdata appen array of strings 
Javascript :: javascript get form data 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =