ui-ux-guidelines
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWeb Interface Guidelines
Web界面指南
Dispatch hub for UI/UX rules. Load the relevant reference file for full details.
UI/UX规则调度中心。加载相关参考文件以获取完整细节。
Contents
目录
Rule Categories by Priority
按优先级划分的规则分类
| Priority | Category | Impact | Reference File |
|---|---|---|---|
| 1 | Accessibility | CRITICAL | |
| 2 | Touch & Interaction | CRITICAL | |
| 3 | Performance | HIGH | |
| 4 | Layout & Responsive | HIGH | |
| 5 | Typography & Color | MEDIUM | |
| 6 | Animation | MEDIUM | |
| 7 | Forms | HIGH | |
| 8 | Content & Navigation | MEDIUM | |
| 9 | Charts & Data | LOW | |
| 优先级 | 分类 | 影响程度 | 参考文件 |
|---|---|---|---|
| 1 | Accessibility(可访问性) | 关键 | |
| 2 | 触摸与交互 | 关键 | |
| 3 | 性能 | 高 | |
| 4 | 布局与响应式设计 | 高 | |
| 5 | 排版与色彩 | 中 | |
| 6 | 动画 | 中 | |
| 7 | 表单 | 高 | |
| 8 | 内容与导航 | 中 | |
| 9 | 图表与数据 | 低 | |
Workflows
工作流程
1. Review UI code
1. 审查UI代码
- Read the target file(s).
- Load the relevant reference file(s) from based on what the code contains.
references/ - Check each applicable rule. Report violations in the output format below.
- 读取目标文件。
- 根据代码包含的内容,从加载相关参考文件。
references/ - 检查每条适用规则。按照以下输出格式报告违规情况。
2. Build new component
2. 构建新组件
- Load -- all components must meet CRITICAL rules.
references/accessibility-and-interaction.md - Load additional references based on component type:
- Form component ->
references/forms-content-checklist.md - Layout/visual component ->
references/layout-typography-animation.md
- Form component ->
- Follow rules during implementation.
- 加载——所有组件必须符合关键规则。
references/accessibility-and-interaction.md - 根据组件类型加载额外参考文件:
- 表单组件 ->
references/forms-content-checklist.md - 布局/视觉组件 ->
references/layout-typography-animation.md
- 表单组件 ->
- 实现过程中遵循规则。
3. Pre-delivery checklist
3. 交付前检查清单
- Load for the full checklist.
references/forms-content-checklist.md - Load for the interaction checklist.
references/accessibility-and-interaction.md - Walk through every checkbox before shipping.
- 加载获取完整检查清单。
references/forms-content-checklist.md - 加载获取交互检查清单。
references/accessibility-and-interaction.md - 发布前逐一核对所有检查项。
Anti-patterns (flag these)
反模式(需标记)
- or
user-scalable=no-- disables zoommaximum-scale=1 - with
onPaste-- blocks pastepreventDefault - -- list properties explicitly
transition: all - without
outline-nonereplacement:focus-visible - /
<div>with click handlers -- use<span>or<button><a> - without
<img>andwidth(causes CLS)height - Inline navigation without
onClick(breaks Cmd+click)<a> - Large without virtualization (>50 items)
.map() - Hardcoded date/number formats -- use
Intl.* - Icon-only buttons without
aria-label
- 或
user-scalable=no—— 禁用缩放maximum-scale=1 - 搭配
onPaste—— 阻止粘贴preventDefault - —— 需明确列出属性
transition: all - 未搭配
outline-none替代方案:focus-visible - 使用/
<div>添加点击事件处理程序——应使用<span>或<button><a> - 未设置
<img>和width(会导致CLS)height - 使用内联进行导航但未使用
onClick(破坏Cmd+click功能)<a> - 大型未使用虚拟化(超过50项)
.map() - 硬编码日期/数字格式——应使用
Intl.* - 仅含图标按钮未设置
aria-label
Code Review Output Format
代码审查输出格式
Group findings by file. Use format (VS Code clickable). Be terse -- state issue and location. Skip explanation unless fix is non-obvious.
file:linetext
undefined按文件分组展示结果。使用格式(VS Code可点击跳转)。表述简洁——说明问题和位置。除非修复方案不明显,否则无需解释。
file:linetext
undefinedsrc/Button.tsx
src/Button.tsx
src/Button.tsx:42 - icon button missing aria-label
src/Button.tsx:18 - input lacks label
src/Button.tsx:55 - animation missing prefers-reduced-motion
src/Button.tsx:67 - transition: all -> list properties explicitly
src/Button.tsx:42 - 图标按钮缺少aria-label
src/Button.tsx:18 - 输入框缺少标签
src/Button.tsx:55 - 动画未适配prefers-reduced-motion
src/Button.tsx:67 - transition: all -> 需明确列出属性
src/Modal.tsx
src/Modal.tsx
src/Modal.tsx:12 - missing overscroll-behavior: contain
src/Modal.tsx:34 - "..." -> "..."
src/Modal.tsx:12 - 缺少overscroll-behavior: contain
src/Modal.tsx:34 - "..." -> "..."
src/Card.tsx
src/Card.tsx
pass
---通过
---Reference Files
参考文件
Load these as needed during reviews and implementation:
- Accessibility & Interaction -- Focus, ARIA, keyboard, touch targets, cursors, drag UX
- Layout, Typography & Animation -- Performance, responsive, fonts, color, motion, charts
- Forms, Content & Checklist -- Forms, content handling, navigation, dark mode, locale, hydration, pre-delivery checklist
审查和实现过程中按需加载以下文件:
- Accessibility & Interaction —— 焦点、ARIA、键盘操作、触摸目标、光标、拖拽UX
- 布局、排版与动画 —— 性能、响应式设计、字体、色彩、动效、图表
- 表单、内容与检查清单 —— 表单、内容处理、导航、深色模式、本地化、水合、交付前检查清单