
Wot Ui Unocss Preset Guide
This walks you through installing and configuring the @wot-ui/unocss-preset package for wot-ui projects. It covers the typical setup pain points: getting the preset into your unocss.config.ts, understanding what prefix, preflight, and baseTokens actually do, and debugging why classes don't generate or autocomplete fails. The guide includes copy-paste examples for cards, spacing, semantic colors, and dark mode using the wot- prefix convention. Honestly most useful when you're integrating wot-ui's design tokens into a UnoCSS workflow and need to skip the trial-and-error phase. The troubleshooting section is solid for CI/local mismatches and missing IntelliSense.
- skills.sh installs
- 848
- GitHub stars
- 38
- last updated
- Aug 21, 2026
Install
$ npx -y skills add wot-ui/open-wot --skill wot-ui-unocss-preset-guide --agent claude-codeInstalls into .claude/skills of the current project.
Files
Wot UnoCSS Preset 使用指南
适用场景
当用户询问以下内容时,优先使用本 Skill:
- 如何安装
@wot-ui/unocss-preset - 如何在
unocss.config.ts配置presetWot prefix、preflight、baseTokens怎么用- 为什么类名不生效、自动补全不出现、CI 与本地结果不一致
目标是给出可直接复制的最佳实践,帮助用户快速完成接入并稳定运行。
最小安装步骤
pnpm add -D unocss
pnpm add @wot-ui/unocss-preset
推荐配置(完整示例)
import { presetWot } from '@wot-ui/unocss-preset'
import { defineConfig } from 'unocss'
export default defineConfig({
presets: [
presetWot({
prefix: 'wot',
preflight: true,
baseTokens: false,
}),
],
})
配置项说明
prefix:工具类前缀,默认wot。示例:wot-text-primary、wot-m-main。preflight:是否注入 wot-ui CSS 变量,默认true。baseTokens:是否开放基础色板和原始 token 类名,默认false。
常用类名示例
- 颜色:
wot-text-primary、wot-bg-danger-surface、wot-border-border-main - 间距:
wot-m-main、wot-gap-tight、wot-gap-x-loose - 内边距:
wot-p-main、wot-px-tight、wot-pb-loose - 圆角:
wot-rounded-md、wot-rounded-full - 字重:
wot-font-medium、wot-font-semibold - 排版:
wot-text-body-main、wot-text-title-large - 透明度:
wot-opacity-disabled - 描边:
wot-border-stroke-main
上手示例(可复制)
1) 一个“卡片”示例(uni-app / Vue)
Sponsors
Details
- Repository
- github.com/wot-ui/open-wot
- Categories
- Frontend Development, Documentation
- First seen
- Jun 3, 2026