프론트 엔드 개발자로 나는 css 도 완벽히 모르는게 맞다 :(
근데 이것저것 듣는것은 많아서 요즘 뭐가 대세래~ 요런 것들은 주워듣는 편이다.
Tailwind는 너무 자주 들어 귀에 익어 있는 프레임 워크고 설치라도 해보고 맛이라도 봐보려고 한다.
공식 : https://tailwindcss.com/
TailwindCSS는 CSS 프레임워크다.
TailwindCSS가 사용자도 많아지고, 사용자의 만족도도 확실히 높은 프레임워크임에는 틀림이 없는 것 같다.
트렌드 한번 쫒아가보자💁
TailwindCSS의 특징.
실제 프로젝트나 개발을 하다보면 가장 아래 두 부분이 좀 구미가 당기게 만드는 느낌
나는 이미 프로젝트가 있어서 해당 프로젝트에 설치를 진행하려 한다.
공식문서의 설치방법
/** @type {import('tailwindcss').Config} */
module.exports = {
// content: [], -->
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
@tailwind base;
@tailwind components;
@tailwind utilities;
tailwind.css
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import { ThemeProvider } from "styled-components";
import { theme } from "./theme";
import "./tailwind.css";
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
);
root.render(
// <React.StrictMode>
<ThemeProvider theme={theme}>
<App />
</ThemeProvider>
// </React.StrictMode>
);
여기 까지 하면 기본적인 세팅은 끝이다.
<Header>
<h1 className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
hello Tailwind!
</h1>
</Header>