Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)6.0k · #14444

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.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/antfu/skills/blob/main/skills/unocss/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

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

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự