unocss
antfu/skills
配置并使用 UnoCSS,这是一个即时的原子 CSS 引擎,提供预设、规则、快捷方式以及针对 Vite 和 Nuxt 的集成支持。
...展开全部UnoCSS 是一个即时原子 CSS 引擎,旨在灵活且可扩展。其核心不预设任何观点——所有 CSS 工具类均通过预设提供。它是 Tailwind CSS 的超集,因此你可以复用 Tailwind 的知识来使用基本语法。
重要提示: 在编写 UnoCSS 代码之前,代理应检查项目根目录中是否存在 uno.config.* 或 unocss.config.* 文件,以了解可用的预设、规则和快捷方式。如果项目设置不明确,请避免使用属性模式(attributify mode)和其他高级功能——仅坚持使用基本的 class 用法。
该技能基于 UnoCSS 66.x 版本,生成于 2026-01-28。
核心
| 主题 | 描述 | 参考 |
|---|---|---|
| 配置 | 配置文件设置及所有配置选项 | core-config |
| 规则 | 用于生成 CSS 工具类的静态和动态规则 | core-rules |
| 快捷方式 | 将多个规则组合为单个简写形式 | core-shortcuts |
| 主题 | 颜色、断点和设计令牌的主题系统 | core-theme |
| 变体 | 将 hover:、dark:、响应式等变体应用于规则 | core-variants |
| 提取 | UnoCSS 如何从源代码中提取工具类 | core-extracting |
| 白名单 & 黑名单 | 强制包含或排除特定工具类 | core-safelist |
| 层 & 预检 | CSS 层排序及原始 CSS 注入 | core-layers |
预设
主要预设
| 主题 | 描述 | 参考 |
|---|---|---|
| Preset Wind3 | Tailwind CSS v3 / Windi CSS 兼容预设(最常用) | preset-wind3 |
| Preset Wind4 | Tailwind CSS v4 兼容预设,具有现代 CSS 功能 | preset-wind4 |
| Preset Mini | 包含基本工具类的极简预设,适用于自定义构建 | preset-mini |
功能预设
| 主题 | 描述 | 参考 |
|---|---|---|
| Preset Icons | 使用 Iconify 和任意图标集生成的纯 CSS 图标 | preset-icons |
| Preset Attributify | 在 HTML 属性中而非 class 中组合工具类 | preset-attributify |
| Preset Typography | 用于排版默认值的 Prose 类 | preset-typography |
| Preset Web Fonts | 轻松集成 Google Fonts 及其他网络字体 | preset-web-fonts |
| Preset Tagify | 将工具类用作 HTML 标签名 | preset-tagify |
| Preset Rem to Px | 将工具类中的 rem 单位转换为 px | preset-rem-to-px |
转换器
| 主题 | 描述 | 参考 |
|---|---|---|
| 变体组 | 具有共同前缀的工具类组合简写 | transformer-variant-group |
| 指令 | CSS 指令:@apply、@screen、theme()、icon() | transformer-directives |
| 编译类 | 将多个类编译为一个哈希类 | transformer-compile-class |
| 属性模式 JSX | 支持 JSX/TSX 中的无值属性模式 | transformer-attributify-jsx |
集成
| 主题 | 描述 | 参考 |
|---|---|---|
| Vite 集成 | 使用 Vite 设置 UnoCSS 及特定框架的技巧 | integrations-vite |
| Nuxt 集成 | 用于 Nuxt 应用的 UnoCSS 模块 | integrations-nuxt |
---
name: unocss
description: Configure and use UnoCSS, an instant atomic CSS engine with presets, rules, shortcuts, and integrations for Vite and Nuxt.
---
UnoCSS is an instant atomic CSS engine designed to be flexible and extensible. The core is un-opinionated - all CSS utilities are provided via presets. It's a superset of Tailwind CSS, so you can reuse your Tailwind knowledge for basic syntax usage.
**Important:** Before writing UnoCSS code, agents should check for `uno.config.*` or `unocss.config.*` files in the project root to understand what presets, rules, and shortcuts are available. If the project setup is unclear, avoid using attributify mode and other advanced features - stick to basic `class` usage.
> The skill is based on UnoCSS 66.x, generated at 2026-01-28.
## Core
| Topic | Description | Reference |
|-------|-------------|-----------|
| Configuration | Config file setup and all configuration options | [core-config](references/core-config.md) |
| Rules | Static and dynamic rules for generating CSS utilities | [core-rules](references/core-rules.md) |
| Shortcuts | Combine multiple rules into single shorthands | [core-shortcuts](references/core-shortcuts.md) |
| Theme | Theming system for colors, breakpoints, and design tokens | [core-theme](references/core-theme.md) |
| Variants | Apply variations like hover:, dark:, responsive to rules | [core-variants](references/core-variants.md) |
| Extracting | How UnoCSS extracts utilities from source code | [core-extracting](references/core-extracting.md) |
| Safelist & Blocklist | Force include or exclude specific utilities | [core-safelist](references/core-safelist.md) |
| Layers & Preflights | CSS layer ordering and raw CSS injection | [core-layers](references/core-layers.md) |
## Presets
### Main Presets
| Topic | Description | Reference |
|-------|-------------|-----------|
| Preset Wind3 | Tailwind CSS v3 / Windi CSS compatible preset (most common) | [preset-wind3](references/preset-wind3.md) |
| Preset Wind4 | Tailwind CSS v4 compatible preset with modern CSS features | [preset-wind4](references/preset-wind4.md) |
| Preset Mini | Minimal preset with essential utilities for custom builds | [preset-mini](references/preset-mini.md) |
### Feature Presets
| Topic | Description | Reference |
|-------|-------------|-----------|
| Preset Icons | Pure CSS icons using Iconify with any icon set | [preset-icons](references/preset-icons.md) |
| Preset Attributify | Group utilities in HTML attributes instead of class | [preset-attributify](references/preset-attributify.md) |
| Preset Typography | Prose classes for typographic defaults | [preset-typography](references/preset-typography.md) |
| Preset Web Fonts | Easy Google Fonts and other web fonts integration | [preset-web-fonts](references/preset-web-fonts.md) |
| Preset Tagify | Use utilities as HTML tag names | [preset-tagify](references/preset-tagify.md) |
| Preset Rem to Px | Convert rem units to px for utilities | [preset-rem-to-px](references/preset-rem-to-px.md) |
## Transformers
| Topic | Description | Reference |
|-------|-------------|-----------|
| Variant Group | Shorthand for grouping utilities with common prefixes | [transformer-variant-group](references/transformer-variant-group.md) |
| Directives | CSS directives: @apply, @screen, theme(), icon() | [transformer-directives](references/transformer-directives.md) |
| Compile Class | Compile multiple classes into one hashed class | [transformer-compile-class](references/transformer-compile-class.md) |
| Attributify JSX | Support valueless attributify in JSX/TSX | [transformer-attributify-jsx](references/transformer-attributify-jsx.md) |
## Integrations
| Topic | Description | Reference |
|-------|-------------|-----------|
| Vite Integration | Setting up UnoCSS with Vite and framework-specific tips | [integrations-vite](references/integrations-vite.md) |
| Nuxt Integration | UnoCSS module for Nuxt applications | [integrations-nuxt](references/integrations-nuxt.md) |
所有文件
0 个文件安装 unocss
将技能文件下载并解压至你的 .claude/skills/ 目录。
下载ZIP克隆仓库并复制技能文件到您的项目中。
git clone https://github.com/antfu/skills/tree/main/skills/unocss # Copy SKILL.md to your .claude/skills/ directory
复制





首页
