Tailwind 플러그인 + Vite + Typescript + Tailwind CSS 3 설치

이 섹션에서는 Tailwind CSS 3와 함께 tailwind css 양식 플러그인 + 타이포그래피 플러그인 + vite + typescript를 설치 및 설정합니다. 이 섹션에서는 create-tw를 사용하여 CLI가 tailwindcss-ready 프로젝트를 스캐폴딩하는 데 도움이 됩니다. create-tw tailwind css 3을 사용하여 바닐라 js 및 typescript에 대한 간단한 준비 템플릿을 만드는 데 도움이 됩니다.
view

Tailwind CSS 프로젝트 만들기



npx로 tailwind v3 프로젝트 생성:

npx create-tw@latest
# OR
npx create-tw@latest <project-name> --template <id>


원사를 사용하여 tailwind v3 프로젝트를 만듭니다.

yarn create tw
# OR
yearn create tw <project-name> --template <id>


바닐라 프로젝트를 선택합니다.



타이프스크립트를 선택합니다.


 _ ._ _  _. _|_ _  _|_     
 (_ | (/_ (_| |_ (/_  |_ \/\/  


Welcome to create-tw!
The easiest way to create a Tailwind project

? Project name tailwind-app
? App type Vanilla (create-vite)
tid vanilla
? What language will your project be written in? (Use arrow keys)
 TypeScript 
 JavaScript 


코드 스타일을 선택합니다.

? Project name tailwind-app
? App type Vanilla (create-vite)
tid vanilla
? What language will your project be written in? ts
templateIdKey vanilla-ts
? Which dependencies would you like to include? (Press <space> to select, <a> to toggle all, <i> to invert selection,
 and <enter> to proceed)
❯◯ prettier
  clsx


tailwind css 양식 플러그인 및 타이포그래피 플러그인을 선택합니다.

? Project name tailwind-app
? App type Vanilla (create-vite)
tid vanilla
? What language will your project be written in? ts
templateIdKey vanilla-ts
? Which dependencies would you like to include? 
? Which plugins would you like to include? (Press <space> to select, <a> to toggle all, <i> to invert selection, and 
<enter> to proceed)
❯◯ @tailwindcss/typography
  @tailwindcss/forms
  @tailwindcss/aspect-ratio


프로젝트로 이동하여 vite를 실행합니다.

cd tailwind-app
npm run dev


index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Create Tailwind</title>
    <link rel="stylesheet" href="/src/style.css" />
  </head>

  <body
    class="h-screen bg-gradient-to-b from-gray-900 to-slate-800 flex flex-col text-white"
  >
    <header class="py-16">
      <h1 class="text-4xl font-bold text-center mb-6">Tailwind Plugins + Vite +  Typescript + Tailwind CSS 3</h1>
      <div class="flex flex-row justify-center items-center gap-4">
        <a
          class="github-button"
          href="https://github.com/andrejjurkin/create-tailwind-app"
          data-color-scheme="no-preference: dark; light: dark; dark: dark;"
          data-icon="octicon-star"
          data-size="large"
          data-show-count="true"
          aria-label="Star andrejjurkin/create-tailwind-app on GitHub"
          >Star</a
        >
        <a
          class="github-button"
          href="https://github.com/andrejjurkin/create-tailwind-app/discussions"
          data-color-scheme="no-preference: dark; light: dark; dark: dark;"
          data-icon="octicon-comment-discussion"
          data-size="large"
          aria-label="Discuss andrejjurkin/create-tailwind-app on GitHub"
          >Discuss</a
        >
      </div>
    </header>

    <main class="flex-1">
      <section class="text-center">
        <div class="w-full grid place-items-center p-12">
          <a href="https://vitejs.dev/">
            <img src="/vite.svg" alt="Vite" class="h-24" />
          </a>
        </div>
        <h2 class="text-3xl font-bold text-center">Tailwind Plugins + Vite +  Typescript + Tailwind CSS 3</h2>
        <p class="mb-6">The Next Generation Frontend Tooling</p>
        <ul
          class="flex flex-row items-center w-full gap-8 justify-center text-blue-300 font-medium"
        >
          <li>
            <a href="https://vitejs.dev/">Learn More</a>
          </li>
          <li>
            <a href="https://vitejs.dev/guide/why.html">Why Vite?</a>
          </li>
        </ul>
      </section>
    </main>

    <footer class="px-8 py-12 border-t border-gray-800">
      <div class="px-8 font-medium text-center">
        <a href="https://github.com/andrejjurkin/create-tailwind-app">
          Create Tailwind
        </a>
      </div>
    </footer>
    <script type="module" src="/src/main.ts"></script>
    <!-- Place this tag in your head or just before your close body tag. -->
    <script async defer src="https://buttons.github.io/buttons.js"></script>
  </body>
</html>


좋은 웹페이지 즐겨찾기