tailwind, postcss, autoprefixer 설치
npm install -D tailwindcss postcss autoprefixer
tailwind config 파일 생성
npx tailwindcss init -p
tailwind.config.js 파일 설정
tailwind 를 적용할 파일들의 path 설정
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}"
],
theme: {
extend: {},
},
plugins: [],
}
global.css 파일 설정
@tailwind base;
@tailwind components;
@tailwind utilities;
이 단계에서 `Unknown at rule @tailwind css` 에러 문구 발생시 PostCSS Language Support 플러그인을 설치해주면 해결된다
'React' 카테고리의 다른 글
[React] Next.js 13 (0) | 2023.08.09 |
---|---|
[React] Vite 절대 경로 설정 (0) | 2023.07.06 |
[React] Emotion (0) | 2023.06.13 |
[React] Create React App 이미지 경로 (0) | 2023.05.23 |