Sveltekit + Vite + Typescript에 Tailwind CSS 설치
13157 단어 webdevtailwindcsssveltetutorial
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
Reference
이 문제에 관하여(Sveltekit + Vite + Typescript에 Tailwind CSS 설치), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/larainfo/install-tailwind-css-in-sveltekit-vite-typescript-3oeg텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)