unocss
Skill này làm gì
Skill này giải thích cách tạo kiểu cho website bằng UnoCSS, một cách nhanh để viết kiểu trực tiếp trong tên class. Skill dành cho lập trình viên đã biết Tailwind hoặc muốn một lựa chọn linh hoạt khác.
Khi nào nên dùng
- ✓Khi bạn đang thiết lập UnoCSS trong một dự án web hoặc thay đổi file cấu hình của nó.
- ✓Khi bạn muốn thêm quy tắc kiểu hoặc shortcut tùy chỉnh cho các tổ hợp class lặp lại.
- ✓Khi bạn muốn dùng màu của theme, breakpoint hoặc biến thể hover và chế độ tối.
Liên kết skill
https://github.com/antfu/skills/blob/main/skills/unocss/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thiết lập UnoCSS trong dự án của tôi và thêm một shortcut cho kiểu nút chuẩn của tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra cấu hình UnoCSS của dự án trước, rồi viết kiểu dưới dạng các utility class dùng preset, shortcut và theme mà dự án đã có.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 v66.10.5, generated at 2026-09-25.
Core
| Topic | Description | Reference |
|---|---|---|
| Configuration | Config file setup and all configuration options | core-config |
| Rules | Static and dynamic rules for generating CSS utilities | core-rules |
| Shortcuts | Combine multiple rules into single shorthands | core-shortcuts |
| Theme | Theming system for colors, breakpoints, and design tokens | core-theme |
| Variants | Apply variations like hover:, dark:, responsive to rules | core-variants |
| Extracting | How UnoCSS extracts utilities from source code | core-extracting |
| Safelist & Blocklist | Force include or exclude specific utilities | core-safelist |
| Layers & Preflights | CSS layer ordering and raw CSS injection | core-layers |
| Processors | Transform generated CSS layers (incl. Lightning CSS) | core-processors |
Presets
Main Presets
| Topic | Description | Reference |
|---|---|---|
| Preset Wind3 | Tailwind CSS v3 / Windi CSS compatible preset (most common) | preset-wind3 |
| Preset Wind4 | Tailwind CSS v4 compatible preset with modern CSS features | preset-wind4 |
| Preset Mini | Minimal preset with essential utilities for custom builds | preset-mini |
Feature Presets
| Topic | Description | Reference |
|---|---|---|
| Preset Icons | Pure CSS icons using Iconify with any icon set | preset-icons |
| Preset Attributify | Group utilities in HTML attributes instead of class | preset-attributify |
| Preset Typography | Prose classes for typographic defaults | preset-typography |
| Preset Web Fonts | Easy Google Fonts and other web fonts integration | preset-web-fonts |
| Preset Tagify | Use utilities as HTML tag names | preset-tagify |
| Preset Rem to Px | Convert rem units to px for utilities | preset-rem-to-px |
Transformers
| Topic | Description | Reference |
|---|---|---|
| Variant Group | Shorthand for grouping utilities with common prefixes | transformer-variant-group |
| Directives | CSS directives: @apply, @screen, theme(), icon() | transformer-directives |
| Compile Class | Compile multiple classes into one hashed class | transformer-compile-class |
| Attributify JSX | Support valueless attributify in JSX/TSX | transformer-attributify-jsx |
Integrations
| Topic | Description | Reference |
|---|---|---|
| Vite Integration | Setting up UnoCSS with Vite and framework-specific tips | integrations-vite |
| Nuxt Integration | UnoCSS module for Nuxt applications | integrations-nuxt |
Câu hỏi thường gặp
UnoCSS có giống Tailwind không?
Không hoàn toàn, nhưng khá giống. Nó được mô tả là một superset của Tailwind, nên hầu hết tên class Tailwind đều dùng được.
Nếu thiết lập dự án của tôi chưa rõ thì sao?
Agent giữ các tên class đơn giản và tránh các tính năng nâng cao cho đến khi thiết lập rõ ràng.
Preset là gì?
Preset là các bộ utility kiểu có sẵn, chẳng hạn Wind cho class kiểu Tailwind và Icons cho class biểu tượng.
Chi tiết
Mô tả gốc của tác giả
UnoCSS instant atomic CSS engine, superset of Tailwind CSS. Use when configuring UnoCSS, writing utility rules, shortcuts, or working with presets like Wind, Icons, Attributify.
repo: antfu/skills
Độ phổ biến
- Sao GitHub
- 6.0k
- Vị trí xếp hạng
- #14444
- Giấy phép
- MIT
- Cập nhật
- 30/10/2026
Bình luận
- …
Thêm skill từ kho mã này
antfu-create-pr
6.0kGiúp agent của bạn mở một pull request GitHub rõ ràng từ nhánh của bạn, với bản tóm tắt đơn giản về những gì đã thay đổi và lý do.
antfu-issue-triage
6.0kGiúp agent của bạn rà soát các issue và pull request GitHub đang mở, phát hiện trùng lặp và mục đã sửa, rồi hỏi bạn trước khi hành động.
antfu-query
6.0kCho phép agent của bạn hỏi bạn từng bước về một kế hoạch hoặc ý tưởng cho đến khi hai bên cùng hiểu rõ và đã được kiểm chứng.
antfu-simplify
6.0kGiúp agent của bạn rút gọn các thay đổi code về phiên bản nhỏ nhất nhưng vẫn đúng, bằng cách bỏ những phần không cần thiết.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.