728x90
맨날 직접 css 작성하다가 부트스트랩 한번 써보고싶어서 한번 해봄
완전 조음
설치하기
https://tailwindcss.com/docs/installation
Installation - Tailwind CSS
The simplest and fastest way to get up and running with Tailwind CSS from scratch is with the Tailwind CLI tool.
tailwindcss.com
테일윈드 css 들어가면 설치 방법이 있는데
따라하다가 헷갈리는 부분이 있어서
까먹을까봐 쓴다
npm install -D tailwindcss
npx tailwindcss init
순서대로 설치해준다
src 폴더 밖에 tailwind.confing.js 생기면
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}
코드 복붙해주기
그리고 index.css에 코드 복붙
@tailwind base;
@tailwind components;
@tailwind utilities;
하고나면 또 뭘 설치하라는데 나 이거 대충읽고 복붙해서 설치하니까 계속 파일이없다 경로를 못찾는다 뭐 이런 오류가 계속 나서
왜 안되나 했더니 내가 파일이름 다르게 해놓고 설치하려고 해서 그랬던거임
npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
저 input.css 를 index.css로 바꿔준다
그리고 퍼블릭 파일에 있는 index.html 파일을 찾아서
<link href="/dist/output.css" rel="stylesheet">
이 코드 복사해주면 끝
사용하다 보니까 뭐 아이콘같은거 불러오려면 추가로 또 뭘 설치하라더라
npm install @headlessui/react @heroicons/react
이거 설치하면 됨
'React' 카테고리의 다른 글
React 프로젝트 파이어 베이스로 배포하기 (1) | 2024.02.01 |
---|---|
React 마크다운 에디터 구현하기 (2) | 2024.01.09 |
React Email JS로 메일 보내기 (0) | 2024.01.08 |
리액트 스프링부트 연동해서 메일 보내기 (2) | 2023.07.14 |
스프링부트 + 리액트 연동하기 (0) | 2023.07.05 |