npx create-next-app@latest <name-of-project> --javascript --eslint
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
In tailwinds.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./app/**/*.{js,ts,jsx,tsx}",
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
// Or if using `src` directory:
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
In styles/globals.css
@tailwind base;
@tailwind components;
@tailwind utilities;
pages/index.js
Head
Create a proof of life
<h1 className='text-3xl font-bold underline'>Hello World</h1>
npm run dev
to start the server
header
main
footer
To create links to new pages
import Link from 'next/link`
<Link href='linktopage'>Link Display Name</Link>
pages
, create a new js
file: pageName.js
careers.js
js
file, write your functional components and links to other pagesimport Link from 'next/link`;
export default function Careers() {
return(
<div>
<h1>Careers Page Coming Soon</h2>
<Link href="/">Home</Link>
</div>
);
};
className
styling with TailwindCSS as you go