Maison & Atelier
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
前端百科全书
把「好看」拆开讲透——从色彩、字体、字号、间距,到设计原则与视觉层次。不只给你素材,更教你为什么。一页学完前端的视觉系统。
系统层 · 基础
好看的配色不是凭感觉——它建立在色相、饱和度、明度三个维度,和一套可推导的和谐关系之上。这里教你原理,并给你能直接复制的工具。
任何颜色都能拆成色相(是什么色)、饱和度(多鲜艳)、明度(多亮)。拖动滑块,感受每个维度。
从上面的基色出发,色轮上的固定角度会生成和谐的配色。点任意色板复制 CSS 变量。
文字与背景的对比度决定可读性。WCAG 要求正文至少 4.5:1 (AA),理想 7:1 (AAA)。
可读性预览 Aa
通过,可安全用于文字。
原理之外,几条经验法则能立刻让配色更专业。
主色 60%、次色 30%、强调色 10% —— 平衡又有重点。
暖色(红橙黄)前进、有活力;冷色(蓝绿紫)后退、显冷静。
用户对这几种颜色有固定预期 —— 别违背它。
精选字体方向
经过重新筛选的开源字体组合,针对真实界面风格而设计。比较字形、了解适用场景,并复制可直接使用的 CSS 或 Tailwind 字体令牌。
共 41 个配对
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
Considered typography that endures. Every letterform carries tradition while remaining comfortable for long-form reading.
Considered typography that endures. Every letterform carries tradition while remaining comfortable for long-form reading.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Bright, friendly type for products that keep the experience light without becoming childish.
Long-form reading deserves rhythm and contrast. A serif headline sets the tone; the body face carries the story.
Long-form reading deserves rhythm and contrast. A serif headline sets the tone; the body face carries the story.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Considered typography that endures. Every letterform carries tradition while remaining comfortable for long-form reading.
Long-form reading deserves rhythm and contrast. A serif headline sets the tone; the body face carries the story.
Considered typography that endures. Every letterform carries tradition while remaining comfortable for long-form reading.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Bright, friendly type for products that keep the experience light without becoming childish.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Bright, friendly type for products that keep the experience light without becoming childish.
Bright, friendly type for products that keep the experience light without becoming childish.
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
系统层 · 排版
字号不该靠猜。模块化比例从一个基准尺寸出发,乘以固定比例得到每一级,让整套排版有统一的数学关系——再用 clamp() 让它随视口流体缩放,无需断点。
基准 16px、比例 1.25(Major Third)下,每一级是上一级的 1.25 倍。基准建议 16px(不是 14/15px),它是浏览器默认正文尺寸。
Standard — most products (Stripe/Material)
:root {
--text-xs: 0.64rem; /* 10.24px */
--text-sm: 0.8rem; /* 12.8px */
--text-base: 1rem; /* 16px */
--text-lg: 1.25rem; /* 20px */
--text-xl: 1.5625rem; /* 25px */
--text-2xl: 1.9531rem; /* 31.25px */
--text-3xl: 2.4414rem; /* 39.06px */
--text-4xl: 3.0518rem; /* 48.83px */
--text-5xl: 3.8147rem; /* 61.04px */
}@theme {
--text-xs: 0.64rem;
--text-sm: 0.8rem;
--text-base: 1rem;
--text-lg: 1.25rem;
--text-xl: 1.5625rem;
--text-2xl: 1.9531rem;
--text-3xl: 2.4414rem;
--text-4xl: 3.0518rem;
--text-5xl: 3.8147rem;
}| 比例 | 适合 |
|---|---|
| 1.125–1.2 | 密集 UI、仪表盘、数据表 |
| 1.25–1.333 | 多数产品、SaaS、文档 |
| 1.414–1.618 | 编辑、营销、display 主导 |
系统层 · 布局
间距是布局的节奏。把所有 padding、margin、gap 都约束到一个 8 像素的网格上,页面就有了统一的呼吸感——而不是一堆随手定的 13px、17px。
所有间距都是 8 的倍数(4px 作为精细的半步)。为什么是 8?常见屏幕密度 1×、1.5×、2×、3× 都能整除 8,得到整数像素——所以 8px 的内边距在手机、桌面、高清屏上都像素完美,而 5px、7px 会因子像素渲染发虚。
铁律:值要么落在阶梯上,要么扩展阶梯——绝不在原地发明 13px。
12 列 · gutter 32px · margin 24px。12 整除 2/3/4/6,半/三分/四分/六分都能对齐。
:root {
--space-0: 0rem; /* 0px */
--space-xs: 0.25rem; /* 4px */
--space-sm: 0.5rem; /* 8px */
--space-md: 1rem; /* 16px */
--space-lg: 1.5rem; /* 24px */
--space-xl: 2rem; /* 32px */
--space-2xl: 3rem; /* 48px */
--space-3xl: 4rem; /* 64px */
--space-4xl: 6rem; /* 96px */
--space-5xl: 8rem; /* 128px */
}@theme {
--spacing-0: 0rem;
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
--spacing-lg: 1.5rem;
--spacing-xl: 2rem;
--spacing-2xl: 3rem;
--spacing-3xl: 4rem;
--spacing-4xl: 6rem;
--spacing-5xl: 8rem;
}系统层 · 设计原理
色彩、字体、字号、间距给你正确的元素;CRAP 教你怎么组织它们。对比、重复、对齐、亲密性——四条原则把一堆正确的 token 变成一个看起来「刻意」的版面。
如果两个元素不一样,就让它们明显不一样,绝不似是而非。对比建立层次,把视线引向最重要的东西。
别犹豫——元素要有别,就让差异够大。
在整个设计中重复视觉元素——颜色、形状、字体、间距。重复建立统一感,让布局像一个系统,而不是零散的拼凑。
到处复用同一套 token——一致会被读成「刻意」。
页面上每个元素都该和别的元素有视觉连接。没有东西是随手一放的——共享的边线和基线建立起一种眼睛信赖的隐形秩序。
没有东西该飘着——一切都落在共享的边线或基线上。
把相关的东西聚拢、把无关的推远。亲密性把零散元素归并成几个清晰的单元,减少读者眼睛要做的功。
靠近 = 相关——按含义分组,而不是凭手感。
切换开关,看同样的内容从「随手摆」变成「守原则」——差距一眼可见。
一套有层次的排版,胜过十句说明。
产品名称
简短的一句话描述
立即体验
.title {
font-size: 2.5rem;
font-weight: 700;
}
.body {
font-size: 1rem;
font-weight: 400;
color: var(--muted);
}:root {
--radius: 8px;
--shadow: 0 1px 3px rgb(0 0 0 / 0.1);
}
.card {
border-radius: var(--radius);
box-shadow: var(--shadow);
}.form {
display: grid;
gap: 12px;
}
.form > * {
text-align: left;
}.field {
display: flex;
flex-direction: column;
gap: 4px;
}
.form {
display: flex;
flex-direction: column;
gap: 24px;
}系统层 · 注意力
视觉层次是对「眼睛先看什么、后看什么」的控制。四个杠杆——大小、字重、颜色对比、留白——决定了每个元素的视觉重量,进而决定注意力的流动顺序。
更大的元素先被看到——大小是房间里最响亮的信号。
更重的笔画有更大的视觉质量,留住视线更久。
与背景高对比的跳到前面,灰暗的色调后退。
留白与隔离给元素空间去掌控注意力。
打开/关闭杠杆,左侧序号是眼睛的扫描顺序(按视觉重量实时排序)。全部关闭,一切扁平、只能从上往下硬扫;逐个打开,主次秩序浮现。
把层次固化成三级文本 token——主、次、辅。用相对字号、字重、不透明度区分,而不是每次现调。
.text-primary {
font-size: 1.5rem;
font-weight: 700;
opacity: 1;
}
.text-secondary {
font-size: 1rem;
font-weight: 500;
opacity: 0.9;
}
.text-tertiary {
font-size: 0.875rem;
font-weight: 400;
opacity: 0.6;
}