FE4902
article thumbnail
Published 2023. 12. 18. 11:24
[React] Tailwind React

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
profile

FE4902

@FE4902

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!