网页 综合 更新时间 2026-11-13 15:37:08

Installing Tailwind CSS with Vite - Tailwind CSS

自动蜘蛛 tailwindcss.com 正文约 969 字
Installing Tailwind CSS with Vite - Tailwind CSS
Tailwind CSS works by scanning all of your HTML files, JavaScript components, and any other templates for class names, generating the corresponding styles and then writing them to a static CSS file.
It's fast, flexible, and reliable — with zero-runtime.
Installing Tailwind CSS as a Vite plugin is the most seamless way to integrate it with frameworks like Laravel, SvelteKit, React Router, Nuxt, and SolidJS.
Start by creating a new Vite project if you don’t have one set up already. The most common approach is to use Create Vite.
Install tailwindcss and @tailwindcss/vite via npm.
Add the @tailwindcss/vite plugin to your Vite configuration.
Add an @import to your CSS file that imports Tailwind CSS.
Run your build process with npm run dev or whatever command is configured in your package.json file.
Make sure your compiled CSS is included in the <head> (your framework might handle this for you), then start using Tailwind’s utility classes to style your content.
访问原文 返回搜索 https://tailwindcss.com/docs
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。