https://tailwindcss.com/docs/guides/create-react-app 에 친절하게 설명이 되어있다.
- React-app 생성 (생략가능)
npx create-react-app my-project cd my-project
- npm install -D tailwindcss 를 사용하여
tailwindcss
설치
- npx tailwindcss init 을 사용하여 src내에 "tailwind.config.js"를 생성
- "tailwind.config.js" 에서 content 부분 추가 or 입력
/** @type {import('tailwindcss').Config} */ module.exports = { content: ["./src/**/*.{js,jsx,ts,tsx}"], theme: { extend: {}, }, plugins: [], }
- 프로젝트내에 "index.css" 에 붙여넣기
@tailwind base; @tailwind components; @tailwind utilities;
- npm run start
- 적용해보기
export default function App() { return ( <h1 className="text-3xl font-bold underline"> Hello world! </h1> ) }
감사합니다. 이런 정보를 나눠주셔서 좋아요.