
vite 설치
npm create vite@latest .tailwind 설치
npm install tailwindcsspostcss와 autoprefixer 설치
npm install -D postcss autoprefixer
postcss는 css 후처리기입니다.
autoprefixer는 각 브라우저 호환을 위해 그에 맞는 벤더 프리픽서를 자동으로 붙여주는 도구입니다.
구성파일 생성
npx tailwindcss init -ptailwind.config.js 파일 수정
/** @type {import('tailwindcss').Config} */
export default {
content: ["./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
};
index.css에 코드추가@tailwind base;
@tailwind components;
@tailwind utilities;