wot-ui avatar

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-code

Installs 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

More from wot-ui/open-wot

All 4
1bitjaru avatarss-componentbitjaru/styleseedGenerate a new UI component following the StyleSeed design conventions836skills.sh installs
2aradotso avatarjkvideo-bilibili-react-nativearadotso/trending-skillsjkvideo bilibili react native835skills.sh installs
3signerlabs avataradd-componentsignerlabs/shipswift-skillsAdd a SwiftUI component from ShipSwift recipes. Use when the user says "add component", "add a view", "add X view", "I need a chart", "add animation", or wants 834skills.sh installs
4softaworks avatarbackend-to-frontend-handoff-docssoftaworks/agent-toolkitCreate API handoff documentation for frontend developers. Use when backend work is complete and needs to be documented for frontend integration, or user says 'c821skills.sh installs
5softaworks avatarfrontend-to-backend-requirementssoftaworks/agent-toolkitDocument frontend data needs for backend developers. Use when frontend needs to communicate API requirements to backend, or user says 'backend requirements', 'w820skills.sh installs
6mindrally avatarpwa-developmentmindrally/skillsProgressive Web App development guidelines covering service workers, caching strategies, offline functionality, and installability800skills.sh installs