antfu-design
antfu/skills
使用 UnoCSS 構建介面,利用語義化令牌、深色模式一致性及設計細節最佳化,打造開發者工具和落地頁。
...展開全部在任意框架(React、Vue、Svelte、Solid 或純 HTML)中使用 UnoCSS 構建介面時,請使用此內容,無論是密集的開發工具面板還是落地頁。請先閱讀 core-design-read 以確立方向,然後應用令牌系統以及打磨和防冗餘規則。
核心規則
- 在標記中使用語義化快捷方式(
bg-base、border-base、color-active、btn-action),而非原始的工具鏈。 - 同時設計淺色和深色模式。核心令牌必須在兩種主題中均能正常工作。
- 為 z-index 層級命名(
z-top-nav、z-panel-content、z-drawer-content)。不要在模板中使用原始的 z 值。 - 僅生成基於類的工具(
class="..."")。避免在生成的程式碼中使用 Attributify 語法。 - 保持圖示/狀態類字串的字面量形式,以便 UnoCSS 能夠靜態提取它們(必要時使用
// @unocss-include)。 - 對於技術值(路徑、SHA 雜湊值、計數器、時間戳、百分比),使用
font-mono+tabular-nums。 - 對於長路徑和 ID,視覺上截斷但保留完整值於
title屬性中。 - 閱讀簡報並在選擇外觀前設定三個旋鈕(core-design-read)。
- 密集或結構性表面使用邊框,提升層級的表面使用分層陰影(features-micro-interactions)。
- 任何面向使用者的文字中不得包含任何 em-dash 和 en-dash 字元(best-practices-anti-slop)。
起始快捷方式
最小的語義核心。參見 core-starter-kit 以獲取完整的 uno.config.ts 和基礎樣式。
shortcuts: [
{
'color-base': 'color-neutral-800 dark:color-neutral-200',
'bg-base': 'bg-white dark:bg-#111',
'bg-secondary': 'bg-#eee dark:bg-#222',
'border-base': 'border-#8882',
'bg-active': 'bg-#8881',
'color-active': 'color-primary-600 dark:color-primary-300',
'border-active': 'border-primary-600/25 dark:border-primary-400/25',
'btn-action': 'inline-flex items-center gap-2 rounded border border-base px2 py1 op75 hover:op100 hover:bg-active disabled:pointer-events-none disabled:op30!',
'op-fade': 'op65 dark:op55',
'op-mute': 'op30 dark:op25',
'z-top-nav': 'z-60',
'z-panel-content': 'z-70',
'z-drawer-content': 'z-100',
},
]
核心參考
| 主題 | 描述 | 參考 |
|---|---|---|
| 核心原則 | 語義令牌、深色模式對等、z-index 命名、基於類的輸出 | core-principles |
| 起始套件 | 複製貼上 UnoCSS 起始配置及基礎淺色/深色樣式 | core-starter-kit |
| 令牌與組合 | 令牌家族、可複用的類組合、移動端安全的殼層令牌 | core-tokens-and-combinations |
| 設計閱讀與旋鈕 | 閱讀簡報,宣告設計閱讀,設定方差/運動/密度旋鈕 | core-design-read |
最佳實踐
| 主題 | 描述 | 參考 |
|---|---|---|
| 嚴格規則與預檢 | 做/不做清單及整合後的預檢 | best-practices-strict-rules |
| 基於類優於 Attributify | 為何生成的程式碼使用基於類的工具,以及轉換方法 | best-practices-class-utilities-over-attributify |
| 防冗餘衛生規範 | 破折號禁令及 AI 痕跡禁止模式 | best-practices-anti-slop |
| 偏差修正 | 排版、顏色、佈局和材質感的預設值以覆蓋 | best-practices-bias-correction |
功能特性
| 主題 | 描述 | 參考 |
|---|---|---|
| 資料展示 | 路徑、圖示、時間、日期、數字、徽章、按鈕 | features-data-presentation |
| 微互動 | 圓角、對齊、陰影、動畫、數字、輪廓、點選區域 | features-micro-interactions |
| Floating Vue 覆蓋 | 共享的 Floating Vue 設定及 popper 樣式 | features-floating-vue-overrides |
高階功能
| 主題 | 描述 | 參考 |
|---|---|---|
| 模式詞彙表 | 用於識別和呼叫的命名 UI 模式 | advanced-pattern-vocabulary |
| 重設計協議 | 檢測模式,先審計,保留資訊架構和 SEO | advanced-redesign-protocol |
---
name: antfu-design
description: Build interfaces with UnoCSS using semantic tokens, dark mode parity, and design polish for devtools and landing pages.
---
Use this when building interfaces with UnoCSS in any framework (React, Vue, Svelte, Solid, or plain HTML), from dense devtools panels to landing pages. Read core-design-read first to set the direction, then apply the token system plus the polish and anti-slop rules.
## Core Rules
- Use semantic shortcuts (`bg-base`, `border-base`, `color-active`, `btn-action`) instead of raw utility chains in markup.
- Design light and dark mode together. Core tokens must work in both themes.
- Name z-index layers (`z-top-nav`, `z-panel-content`, `z-drawer-content`). Do not use raw z values in templates.
- Generate class-based utilities only (`class="..."`). Avoid Attributify syntax in generated code.
- Keep icon/status class strings literal so UnoCSS can statically extract them (`// @unocss-include` when needed).
- Use `font-mono` + `tabular-nums` for technical values (paths, SHAs, counters, timestamps, percentages).
- For long paths and IDs, truncate visually but keep the full value in `title`.
- Read the brief and set the three dials before choosing a look (core-design-read).
- Borders for dense or structural surfaces, layered shadows for elevated ones (features-micro-interactions).
- Zero em-dash and en-dash characters in any user-facing text (best-practices-anti-slop).
## Starter shortcuts
A minimal semantic core. See core-starter-kit for the full `uno.config.ts` and base styles.
```ts
shortcuts: [
{
'color-base': 'color-neutral-800 dark:color-neutral-200',
'bg-base': 'bg-white dark:bg-#111',
'bg-secondary': 'bg-#eee dark:bg-#222',
'border-base': 'border-#8882',
'bg-active': 'bg-#8881',
'color-active': 'color-primary-600 dark:color-primary-300',
'border-active': 'border-primary-600/25 dark:border-primary-400/25',
'btn-action': 'inline-flex items-center gap-2 rounded border border-base px2 py1 op75 hover:op100 hover:bg-active disabled:pointer-events-none disabled:op30!',
'op-fade': 'op65 dark:op55',
'op-mute': 'op30 dark:op25',
'z-top-nav': 'z-60',
'z-panel-content': 'z-70',
'z-drawer-content': 'z-100',
},
]
```
## Core References
| Topic | Description | Reference |
|-------|-------------|-----------|
| Core Principles | Semantic tokens, dark mode parity, z-index naming, class-first output | [core-principles](references/core-principles.md) |
| Starter Kit | Copy-paste UnoCSS starter config and base light/dark styles | [core-starter-kit](references/core-starter-kit.md) |
| Tokens and Combos | Token families, reusable class combinations, mobile-safe shell tokens | [core-tokens-and-combinations](references/core-tokens-and-combinations.md) |
| Design Read and Dials | Read the brief, declare a design read, set variance/motion/density dials | [core-design-read](references/core-design-read.md) |
## Best Practices
| Topic | Description | Reference |
|-------|-------------|-----------|
| Strict Rules and Pre-Flight | Do/don't checklist and the consolidated pre-flight | [best-practices-strict-rules](references/best-practices-strict-rules.md) |
| Class over Attributify | Why generated code uses class utilities, with conversions | [best-practices-class-utilities-over-attributify](references/best-practices-class-utilities-over-attributify.md) |
| Anti-Slop Hygiene | The dash ban and the AI-tell forbidden patterns | [best-practices-anti-slop](references/best-practices-anti-slop.md) |
| Bias Correction | Typography, color, layout, and materiality defaults to override | [best-practices-bias-correction](references/best-practices-bias-correction.md) |
## Features
| Topic | Description | Reference |
|-------|-------------|-----------|
| Data Presentation | Paths, icons, time, date, numbers, badges, buttons | [features-data-presentation](references/features-data-presentation.md) |
| Micro-Interactions | Radius, alignment, shadows, animation, numbers, outlines, hit areas | [features-micro-interactions](references/features-micro-interactions.md) |
| Floating Vue Overrides | Shared Floating Vue setup and popper styling | [features-floating-vue-overrides](references/features-floating-vue-overrides.md) |
## Advanced
| Topic | Description | Reference |
|-------|-------------|-----------|
| Pattern Vocabulary | Named UI patterns to recognize and reach for | [advanced-pattern-vocabulary](references/advanced-pattern-vocabulary.md) |
| Redesign Protocol | Detect mode, audit first, preserve IA and SEO | [advanced-redesign-protocol](references/advanced-redesign-protocol.md) |
<!--
Source references:
- https://github.com/antfu/node-modules-inspector
- https://github.com/vitejs/devtools/tree/main/packages/rolldown
- https://github.com/eslint/config-inspector
- https://github.com/antfu/vite-plugin-inspect
- https://github.com/antfu/agent-container
- https://github.com/Leonxlnx/taste-skill
- https://github.com/jakubkrehel/make-interfaces-feel-better
-->
所有檔案
0 個檔案安裝 antfu-design
下載並將技能檔案解壓至你的 .claude/skills/ 目錄。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/antfu/skills/tree/main/skills/antfu-design # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
