Preact에 Tailwind CSS 설치
Preact로 Tailwind CSS 프로젝트 만들기
npx를 사용하여 preact로 tailwind-app 만들기:
npx create-tw@latest
# OR
npx create-tw@latest <project-name> --template <id>
Yarn을 사용하여 preact로 tailwind-app 만들기:
yarn create tw
# OR
yearn create tw <project-name> --template <id>
사전 프로젝트를 선택합니다.
? Project name tailwind-preact
? App type
Next.js (create-next-app)
Vanilla (create-vite)
React (create-vite)
Vue (create-vite)
Astro (create-astro)
Svelte Kit (create-svelte)
❯ Preact (create-vite)
Solid (degit solidjs/templates/js)
타이프스크립트를 선택합니다.
? 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
◯ tailwind-merge
요구 사항에 맞는 tailwind 플러그인을 선택하십시오.
? 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
◯ @tailwindcss/line-clamp
◯ daisyui
◯ prettier-plugin-tailwindcss
프로젝트로 이동 및 서버 실행
cd tailwind-preact
npm run dev
src/app.tsx
export function App() {
return (
<header className="flex flex-col h-screen p-20 text-white bg-gradient-to-b from-gray-900 to-slate-800">
<h1 className="mb-2 text-5xl font-bold text-center">Create Tailwind with Preact</h1>
<p className="mb-6 text-xl text-center">
If you like this project, consider giving it a star on GitHub!
</p>
<div className="flex flex-row items-center justify-center gap-4">
<a
className="font-bold text-indigo-300 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
className="font-bold text-indigo-300 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>
);
}
Reference
이 문제에 관하여(Preact에 Tailwind CSS 설치), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/larainfo/install-tailwind-css-in-preact-3chi텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)