web-design-mastery

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Web Design Mastery

Web设计精通指南

Production-grade UI design principles from Refactoring UI by Adam Wathan & Steve Schoger.

基于Adam Wathan和Steve Schoger所著《Refactoring UI》的生产级UI设计原则。

Core Design Workflow

核心设计工作流

1. Start with a Feature, Not a Layout

1. 从功能入手,而非布局

  • Design the actual piece of functionality first
  • Don't start with navigation, sidebar, or shell
  • Details come later—work in grayscale first
  • Don't design too much—work in cycles
  • 先设计实际的功能模块
  • 不要从导航栏、侧边栏或框架开始
  • 先以灰度模式设计,细节后续完善
  • 不要过度设计,分阶段迭代

2. Establish Systems Before Designing

2. 先建立系统,再开展设计

Define these systems up front to eliminate decision fatigue:
Spacing Scale (px):
TokenSizeUse Case
14Micro gaps
28Tight, within components
312Related elements
416Section padding
624Between sections
832Major separation
1248Large gaps
1664Hero spacing
2496Maximum separation
Type Scale (px):
SizeUse Case
12Labels, meta, fine print
14Body text, default
16Emphasis, subheadings
18Section headings
20Card titles
24Page section titles
30Page headings
36Hero subheading
48Hero heading
60-72Display text
Shadow Scale (5 levels):
LevelUse Case
1Buttons, subtle lift
2Cards, inputs
3Dropdowns, popovers
4Sticky elements
5Modals, dialogs
预先定义以下系统,消除决策疲劳:
间距比例(像素):
标识尺寸适用场景
14微小间隙
28组件内部紧凑间距
312关联元素间间距
416区块内边距
624区块间间距
832主要区域分隔
1248大间隙
1664Hero区域间距
2496最大分隔间距
字体比例(像素):
尺寸适用场景
12标签、元数据、小字说明
14正文文本、默认字体
16强调文本、子标题
18区块标题
20卡片标题
24页面区块标题
30页面标题
36Hero区域子标题
48Hero区域标题
60-72展示型文本
阴影层级(5级):
层级适用场景
1按钮、轻微悬浮效果
2卡片、输入框
3下拉菜单、弹出框
4固定定位元素
5模态框、对话框

3. Build Hierarchy, Not Decoration

3. 构建层级,而非装饰

  • Primary: Dark color (headlines, key actions)
  • Secondary: Grey (supporting text, dates)
  • Tertiary: Light grey (metadata, copyright)
Key principles:
  • Size isn't everything—use weight and color
  • Emphasize by de-emphasizing competing elements
  • Labels are a last resort—combine with values
  • Semantics are secondary to hierarchy
  • 主层级:深色(标题、关键操作元素)
  • 次层级:灰色(辅助文本、日期)
  • 第三层级:浅灰色(元数据、版权信息)
核心原则:
  • 尺寸不是唯一因素——结合字重与色彩
  • 通过弱化其他元素来突出重点
  • 标签是最后选择——尽量与内容值结合展示
  • 语义性次于层级结构

4. Apply Depth Meaningfully

4. 有意义地运用层次感

  • Light comes from above
  • Shadows convey elevation (closer = more attention)
  • Use two-part shadows for premium look
  • Consider overlapping elements for layers
  • 光源来自上方
  • 阴影传达元素层级(越靠近用户,越受关注)
  • 使用双层阴影打造高端质感
  • 考虑元素重叠来构建图层

5. Finish with Polish

5. 细节优化收尾

  • Supercharge defaults (bullets → icons, style quotes)
  • Add accent borders for visual interest
  • Design empty states as first impressions
  • Use fewer borders—prefer shadows or spacing

  • 优化默认样式(项目符号→图标,美化引用文本)
  • 添加装饰性边框提升视觉吸引力
  • 将空状态设计作为第一印象展示
  • 减少边框使用——优先选择阴影或间距

Color System

色彩系统

Categories needed:
  1. Greys (8-10 shades): Text, backgrounds, panels, borders
  2. Primary (5-10 shades): Actions, active states, links
  3. Accents (per semantic): Success, warning, error states
Process for defining shades:
  1. Pick base color (500) that works as button background
  2. Pick edges (100 for tinted bg, 900 for text)
  3. Fill gaps: 700, 300 → 800, 600, 400, 200
Key rules:
  • Use HSL for intuitive adjustments
  • Increase saturation at lightness extremes
  • Rotate hue toward bright (60°, 180°, 300°) for lighter
  • Greys can be warm (yellow/orange tint) or cool (blue tint)
  • Accessibility: 4.5:1 contrast for normal text, 3:1 for large

所需色彩类别:
  1. 灰色系(8-10种色调):文本、背景、面板、边框
  2. 主色调(5-10种色调):操作按钮、激活状态、链接
  3. 语义强调色:成功、警告、错误状态
色调定义流程:
  1. 选择基础色(500色调)作为按钮背景色
  2. 确定两端色调(100色调用于浅色背景,900色调用于文本)
  3. 填充中间色调:700、300 → 800、600、400、200
核心规则:
  • 使用HSL进行直观调整
  • 在亮度极值处提高饱和度
  • 亮色色调向明亮色相(60°、180°、300°)偏移
  • 灰色系可偏暖(黄/橙色调)或偏冷(蓝色调)
  • 无障碍性:普通文本对比度≥4.5:1,大文本对比度≥3:1

Anti-Patterns

反模式

NEVER do:
  • Grey text on colored backgrounds (hand-pick colors instead)
  • Fill the whole screen when content needs less
  • Use grids religiously (fixed widths often better)
  • Ambiguous spacing (more space between groups than within)
  • Relative sizing that doesn't scale
  • Scale icons beyond intended size
  • Rely on color alone for meaning

绝对不要做这些:
  • 在彩色背景上使用灰色文本(应手动选择适配色彩)
  • 内容较少时仍填满整个屏幕
  • 刻板使用网格布局(固定宽度通常效果更好)
  • 间距模糊(组间间距不应小于组内间距)
  • 使用无法缩放的相对尺寸
  • 超出预设尺寸缩放图标
  • 仅依赖色彩传达信息

Reference Files

参考文档

For detailed guidance on specific topics:
TopicFileWhen to Read
Visual hierarchy, labels, emphasishierarchy.mdBalancing element importance
Spacing, white space, layout gridsspacing-layout.mdLayout decisions
Typography, fonts, line-heighttypography.mdText styling
HSL, shades, accessibilitycolor.mdColor palette creation
Shadows, elevation, layersdepth.mdAdding depth to UI
Borders, backgrounds, empty statesfinishing-touches.mdPolishing design
如需特定主题的详细指导:
主题文档阅读时机
视觉层级、标签、强调hierarchy.md平衡元素重要性时
间距、留白、布局网格spacing-layout.md做布局决策时
排版、字体、行高typography.md文本样式设计时
HSL、色调、无障碍性color.md创建色彩调色板时
阴影、层级、图层depth.md为UI添加层次感时
边框、背景、空状态finishing-touches.md做细节优化时