Skip to content
Agentmart
Submit a tool

byted-util-vite-react-tailwind

使用 Vite + React + TailwindCSS v4 + lucide-react 进行前端项目搭建和开发的技能。当用户需要创建前端项目、搭建 React 开发环境、使用 TailwindCSS 进行样式开发时使用此技能。

Skill by bytedanceOfficial

IndexedApache-2.0★ 473
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/bytedance-byted-util-vite-react-tailwind

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

使用 Vite + React + TailwindCSS v4 + lucide-react 进行前端项目搭建和开发的技能。当用户需要创建前端项目、搭建 React 开发环境、使用 TailwindCSS 进行样式开发时使用此技能。

Use cases: frontend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/byted-util-vite-react-tailwind

What's inside

Skill name
byted-util-vite-react-tailwind
Description
使用 Vite + React + TailwindCSS v4 + lucide-react 进行前端项目搭建和开发的技能。当用户需要创建前端项目、搭建 React 开发环境、使用 TailwindCSS 进行样式开发时使用此技能。
License
Apache-2.0
Metadata
display_name: Vite+React+TailwindCSS前端开发工具
Instructions
380 lines in SKILL.md · view on GitHub

Files (3)

  • LICENSE
  • SKILL.md
  • _meta.json

SKILL.md (first lines)

# Vite + React + TailwindCSS v4 开发技能

> 基于 Vite + React + TailwindCSS v4 + lucide-react 技术栈的前端项目搭建和开发指南。

## 技术栈

| 技术 | 版本 | 用途 |
|------|------|------|
| Vite | ^5.x 或 ^6.x | 构建工具、开发服务器 |
| React | ^18.x 或 ^19.x | UI 框架 |
| TailwindCSS | ^4.x | 原子化 CSS 框架(Vite 插件模式) |
| @tailwindcss/vite | ^4.x | TailwindCSS Vite 插件 |
| lucide-react | latest | 图标库 |
| TypeScript | ^5.x 或 ^6.x | 类型安全 |

## 项目初始化

### Step 1: 创建 Vite + React 项目

```bash
# 创建项目(使用 React + TypeScript 模板)
npm create vite@latest . -- --template react-ts

# 安装依赖
npm install
```

### Step 2: 安装 TailwindCSS v4

```bash
# 安装 TailwindCSS v4 及 Vite 插件
npm install tailwindcss @tailwindcss/vite
```

> **注意:** v4 不再需要 `postcss`、`autoprefixer`,也不需要运行 `npx tailwindcss init`。

### Step 3: 配置 Vite 插件

在 `vite.config.ts` 中添加 `@tailwindcss/vite` 插件:

**vite.config.ts:**
```ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'

export default defineConfig({
  plugins: [
    react(),
    tailwindcss(),
  ],
})
```

### Step 4: 清空默认样式并配置 CSS(⚠️ 强制关键步骤)

**必须将 `src/index.css` 和 `src/App.css` 的全部内容清空**,然后在 `src/index.css` 中只写 TailwindCSS 引入(和可选的 `@theme`):

**src/index.css:**
```css
@import "tailwindcss";
```

**src/App.css:**
```css
/* 清空此文件所有内容,或直接删除此文件 */
```

> **🚨 严格禁止:** 不要在 `index.css` 中写任何 `*`、`body`、`html` 等全局选择器样式!包括但不限于:
> ```css
> /* ❌ 以下全部禁止 */
> * { margin: 0; padding: 0; box-sizing: border-box; }
> body { font-family: ...; -webkit-font-smoothing: antialiased; }
> html { scroll-behavior: smooth; }
> ```
> 这些全局 reset 样式会覆盖 TailwindCSS 的 preflight(内置 reset),导致间距、字体、布局等样式全部异常。TailwindCSS v4 已经内置了完善的 CSS Reset,**不需要也不允许额外添加全局 reset**。
>
> **正确的 `index.css` 只包含**:`@import "tailwindcss"` + 可选的 `@theme` 自定义主题变量。除此之外不写任何 CSS 规则。

> **v4 使用 `@import "tailwindcss"` 替代 v3 的 `@tailwind base; @tailwind components; @tailwind utilities;`。不再需要 `tailwind.config.js` 配置文件。**

### Step 5: 安装 lucide-react 图标库

```bash
npm install lucide-react
```

### Step 6: 安装工具库(如需 cn 工具函数)

```bash
# 用于合并 className 的工具库
npm install clsx tailwind-merge
```

工具函数 `src/utils/cn.ts`:
```typescript
import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}
```

### Step 7: 启动开发服务器

```bash
npm run dev
```

## TypeScript 配置(重要)

### tsconfig.app.json 关键配置

```json
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",

From bytedance/agentkit-samples, Apache-2.0.

More from bytedance/agentkit-samples

Signals

Stars
473
Forks
101
Open issues
14
Last commit (this folder)
May 26, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from bytedance

Cite this page

byted-util-vite-react-tailwind skill. Agent Mart. https://agentmart.dev/skills/bytedance-byted-util-vite-react-tailwind (last updated 2026-10-24)