- Install tailwindcss via npm, and create your tailwind.config.js file
npm install -D tailwindcss
npx tailwindcss init
-
/** @type {import('tailwindcss').Config} */ module.exports = { content: ["./src/**/*.{html,js,jsx}"], theme: { extend: {}, }, plugins: [], }
- Add the @tailwind directives for each of Tailwind’s layers to your ./src/index.css file.
-
@tailwind base; @tailwind components; @tailwind utilities;
-
- Run your build process with npm run start.
-
npm run start
-
-
Start using Tailwind’s utility classes to style your content.
-
export default function App() { return ( <h1 className="text-3xl font-bold underline"> Hello world! </h1> ) }
-