openai-ui-skills
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenAI UI Skills
OpenAI UI设计规范
Opinionated constraints for building OpenAI-style interfaces with AI agents.
用于借助AI Agent构建OpenAI风格界面的约束规范。
When to Apply
适用场景
Reference these guidelines when:
- Building light-mode interfaces
- Creating OpenAI-inspired design systems
- Implementing UIs with Inter font and 4px grid
参考以下指南的场景:
- 构建浅色模式界面
- 创建受OpenAI启发的设计系统
- 实现采用Inter字体和4px网格的UI
Colors
色彩规范
- SHOULD use light backgrounds for primary surfaces
- MUST use as page background (
#FFFFFF)surface-base - SHOULD limit color palette to 8 distinct colors
- MUST maintain text contrast ratio of at least 4.5:1 for accessibility
- 主界面应使用浅色背景
- 页面背景必须使用(
#FFFFFF)surface-base - 色彩调色板应限制为8种不同颜色
- 为保证可访问性,文本对比度必须至少达到4.5:1
Semantic Tokens
语义令牌
| Token | HEX | RGB | Usage |
|---|---|---|---|
| #FFFFFF | rgb(255,255,255) | Page background |
| #525252 | rgb(82,82,82) | Headings, body text |
| #747474 | rgb(116,116,116) | Secondary, muted text |
| #8A8A8A | rgb(138,138,138) | Additional text |
| #C9C0BB | rgb(201,192,187) | Subtle borders, dividers |
| Token | HEX | RGB | 用途 |
|---|---|---|---|
| #FFFFFF | rgb(255,255,255) | 页面背景 |
| #525252 | rgb(82,82,82) | 标题、正文文本 |
| #747474 | rgb(116,116,116) | 次要、弱化文本 |
| #8A8A8A | rgb(138,138,138) | 辅助文本 |
| #C9C0BB | rgb(201,192,187) | 细微边框、分隔线 |
Typography
排版规范
- MUST use as primary font family
Inter - SHOULD use single font family for consistency
- MUST use /
24pxfor primary headingssemi_bold - MUST use /
14pxfor body text400 - MUST limit font weights to: regular, semi_bold, light
- MUST use for headings and
text-balancefor body texttext-pretty - SHOULD use for numeric data
tabular-nums - NEVER modify letter-spacing unless explicitly requested
- 必须将作为主要字体族
Inter - 为保持一致性,应使用单一字体族
- 主标题必须使用/
24pxsemi_bold - 正文文本必须使用/
14px400 - 字体字重必须限制为:regular、semi_bold、light
- 标题必须使用,正文必须使用
text-balancetext-pretty - 数字数据应使用
tabular-nums - 除非明确要求,否则不得修改字间距
Text Styles
文本样式
| Style | Font | Size | Weight | Color | Count |
|---|---|---|---|---|---|
| Inter | 24px | semi_bold | #212121 | 1 |
| Inter | 24px | semi_bold | #222222 | 1 |
| Inter | 14px | 400 | #8F8F8F | 1 |
| Inter | 13px | 400 | #525252 | 2 |
| Inter | 13px | 400 | #5B5B5B | 1 |
| Inter | 13px | 400 | #565656 | 1 |
| Inter | 11px | 400 | #8A8A8A | 1 |
| Inter | 11px | 400 | #8D8D8D | 1 |
| Inter | 10px | 400 | #5C5C5C | 2 |
| Inter | 10px | 400 | #575757 | 2 |
| 样式 | 字体 | 尺寸 | 字重 | 颜色 | 使用次数 |
|---|---|---|---|---|---|
| Inter | 24px | semi_bold | #212121 | 1 |
| Inter | 24px | semi_bold | #222222 | 1 |
| Inter | 14px | 400 | #8F8F8F | 1 |
| Inter | 13px | 400 | #525252 | 2 |
| Inter | 13px | 400 | #5B5B5B | 1 |
| Inter | 13px | 400 | #565656 | 1 |
| Inter | 11px | 400 | #8A8A8A | 1 |
| Inter | 11px | 400 | #8D8D8D | 1 |
| Inter | 10px | 400 | #5C5C5C | 2 |
| Inter | 10px | 400 | #575757 | 2 |
Typography Reference
排版参考
Font Families:
- (used 19x)
Inter
Font Sizes: 7px, 10px, 11px, 13px, 14px, 24px
字体族:
- (使用19次)
Inter
**字体尺寸:**7px、10px、11px、13px、14px、24px
Spacing
间距规范
- MUST use 4px grid for spacing
- SHOULD use spacing from scale: 4px, 5px, 6px, 7px, 10px, 11px, 31px, 32px
- SHOULD use 4px as default gap between elements
- NEVER use arbitrary spacing values (use design scale)
- SHOULD maintain consistent padding within containers
- 间距必须使用4px网格系统
- 应使用以下间距刻度值:4px、5px、6px、7px、10px、11px、31px、32px
- 元素间默认间距应设为4px
- 不得使用任意间距值(需遵循设计刻度)
- 容器内边距应保持一致
Borders
边框规范
- MUST use border-radius from scale: 16px, 18px, 19px, 22px
- SHOULD use 22px+ radius for pill-shaped elements
- MUST use 1px border width consistently
- SHOULD use 19px as default border-radius
- NEVER use arbitrary border-radius values (use design scale)
- SHOULD use subtle borders (1px) for element separation
- 圆角半径必须使用以下刻度值:16px、18px、19px、22px
- 胶囊形元素应使用22px及以上的圆角半径
- 边框宽度必须统一为1px
- 默认圆角半径应设为19px
- 不得使用任意圆角半径值(需遵循设计刻度)
- 元素分隔应使用细微边框(1px)
Border Radius Reference
圆角半径参考
Scale: 16px, 18px, 19px, 22px
**刻度值:**16px、18px、19px、22px
Layout
布局规范
- MUST design for 1920px base viewport width
- SHOULD use 202px for sidebar width
- SHOULD use consistent element widths: 8px, 21px, 14px, 61px, 36px
- SHOULD maintain text-heavy layout with clear hierarchy
- NEVER use , use
h-screenfor full viewport heighth-dvh - MUST respect for fixed elements
safe-area-inset - SHOULD use for square elements instead of
size-*+w-*h-*
- 必须以1920px作为基础视口宽度进行设计
- 侧边栏宽度应设为202px
- 元素宽度应保持一致:8px、21px、14px、61px、36px
- 应保持文本主导的布局,并具备清晰的层级结构
- 不得使用,需使用
h-screen实现全屏高度h-dvh - 固定元素必须遵循安全区域规则
safe-area-inset - 方形元素应使用,而非
size-*+w-*组合h-*
Detected Layout Patterns
已识别的布局模式
- Sidebar: width: 202px, position: left
- 侧边栏:宽度202px,位置居左
Components
组件规范
- MUST use height for input fields
0px
- 输入框高度必须设为
0px
Buttons
按钮组件
| Variant | Background | Text | Border | Height | Radius |
|---|---|---|---|---|---|
| Ghost | transparent | #8A8A8A | none | - | - |
| 变体 | 背景 | 文本 | 边框 | 高度 | 圆角 |
|---|---|---|---|---|---|
| Ghost | transparent | #8A8A8A | none | - | - |
Inputs
输入组件
- Height:
0px
- 高度:
0px
Interactive States
交互状态
Focus
聚焦状态
- MUST use outline with accent color (
2px)#5E6AD2 - MUST use outline-offset
2px - NEVER remove focus indicators
- 必须使用2px宽的轮廓线,颜色为强调色()
#5E6AD2 - 轮廓线偏移量必须为2px
- 不得移除聚焦指示器
Hover
悬停状态
- Buttons (primary): lighten background by 10%
- Buttons (secondary): use background
surface-raised - List items: use background
surface-raised
- 主按钮:背景色提亮10%
- 次级按钮:使用背景
surface-raised - 列表项:使用背景
surface-raised
Disabled
禁用状态
- MUST use
opacity: 0.5 - MUST use
cursor: not-allowed
- 必须设置
opacity: 0.5 - 必须设置
cursor: not-allowed
Interaction
交互规范
- MUST use an for destructive or irreversible actions
AlertDialog - SHOULD use structural skeletons for loading states
- MUST show errors next to where the action happens
- NEVER block paste in or
inputelementstextarea - MUST add an to icon-only buttons
aria-label
- 破坏性或不可逆操作必须使用组件
AlertDialog - 加载状态应使用结构化骨架屏
- 错误提示必须显示在操作发生的位置旁
- 不得阻止或
input元素的粘贴功能textarea - 纯图标按钮必须添加属性
aria-label
Animation
动画规范
- NEVER add animation unless it is explicitly requested
- MUST animate only compositor props (,
transform)opacity - NEVER animate layout properties (,
width,height,top,left,margin)padding - SHOULD use on entrance animations
ease-out - NEVER exceed for interaction feedback
200ms - SHOULD respect
prefers-reduced-motion
- 除非明确要求,否则不得添加动画
- 只能对合成器属性(、
transform)添加动画opacity - 不得对布局属性(、
width、height、top、left、margin)添加动画padding - 入场动画应使用缓动函数
ease-out - 交互反馈时长不得超过200ms
- 必须遵循(减少动画)的系统设置
prefers-reduced-motion
Performance
性能规范
- NEVER animate large or
blur()surfacesbackdrop-filter - NEVER apply outside an active animation
will-change - NEVER use for anything that can be expressed as render logic
useEffect
- 不得对大面积区域的或
blur()添加动画backdrop-filter - 不得在非活跃动画场景下使用属性
will-change - 任何可通过渲染逻辑实现的功能,都不得使用
useEffect