Notice
Recent Posts
Recent Comments
Link
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

개발공부일지

[Project] - React + TypeScript + Tailwind css 본문

Project

[Project] - React + TypeScript + Tailwind css

보람- 2024. 2. 16. 15:13

https://tailwindcss.com/docs/installation/using-postcss

https://react.dev/learn/typescript

https://react-typescript-cheatsheet.netlify.app/docs/basic/setup

 

 

- 설치하기

npx create-react-app mini --template typescript

npm install @types/react @types/react-dom

npm install -D tailwindcss postcss autoprefixer

npx tailwindcss init -p

 

 

- tailwind.config.js

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ['./src/**/*.{html,js,jsx,ts,tsx}'],
  theme: {
    extend: {},
  },
  plugins: [],
};

 

 

- postcss.config.js

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
};

 

 

- index.css

@tailwind base;
@tailwind components;
@tailwind utilities;

 

 

- app.tsx

function App() {
  return (
    <div className="App">
      <div className="w-60 h-60 bg-yellow-400">test!!!</div>
    </div>
  );
}

export default App;