Sveltekit + Vite + Typescript에 Tailwind CSS 설치

이 섹션에서는 Tailwind CSS 3과 함께 Svelte 키트 + Vite + Typescript를 설치 및 설정합니다. 이 섹션에서는 create-tw을 사용하여 CLI가 tailwindcss-ready 프로젝트를 스캐폴딩하는 데 도움이 됩니다. create-tw 도움말은 tailwind css 3을 사용하여 Svelte kit + vite + typescript를 위한 간단한 준비된 템플릿을 만드는 데 도움을 줍니다.
view

Sveltekit으로 Tailwind CSS 프로젝트 만들기



npx를 사용하여 sveltekit으로 tailwind-app 만들기:

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


원사를 사용하여 sveltekit으로 tailwind-app 만들기:

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


Sveltekit 프로젝트를 선택합니다.



다음으로 typescript를 선택해야 합니다.

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


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

? Project name tailwind-sveltekit
? App type Svelte Kit (create-svelte)
tid svelte-kit
? What language will your project be written in? (Use arrow keys)
 TypeScript 
 JavaScript  


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

? 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


svelte 키트용 tailwind 플러그인을 선택합니다.


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


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

? Project name tailwind-sveltekit
? App type Svelte Kit (create-svelte)
tid svelte-kit
? What language will your project be written in? ts
templateIdKey svelte-kit-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 svelte kit를 실행합니다.

cd tailwind-sveltekit
npm run dev


src/routes/index.svelte

<svelte:head>
  <script async defer src="https://buttons.github.io/buttons.js"></script>
</svelte:head>

<div
  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-1">Create Tailwind + Sveltekit + Vite + TypeScript</h1>
    <p class="text-center mb-6 text-neutral-300">
      If you like this project, consider giving it a star on GitHub!
    </p>
    <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>
</div>




또한 읽기



Install Skeleton Svelte UI with Tailwind CSS in Svelte + SvelteKit
Install Tailwind Plugins + Vite + Typescript + Tailwind CSS 3
Install Tailwind CSS in SolidJS + Vite + Typescript

좋은 웹페이지 즐겨찾기